Code Monkey home page Code Monkey logo

Comments (7)

neykov avatar neykov commented on May 28, 2024

Thank you for the detailed report @trittimo.

Nothing obvious comes to mind, so a few of guiding questions:

  • Which Java version are you using?
  • Could the jar be using some non-standard encryption library?
  • Is that HTTP requests or TCP communication?

from extract-tls-secrets.

fancywriter avatar fancywriter commented on May 28, 2024

@neykov same thing is happening for me.
This tool says "successfully attached to process XXXX" and exits without creating any file with any keys.

I did some research and found out that this java app uses Apache HTTP client 4.5.2 and JRE-1.8.0_66.

UPDATED: I was wrong, seems it works... but I was confused by wrong path.

from extract-tls-secrets.

neykov avatar neykov commented on May 28, 2024

@fancywriter could you provide some more details on the relative path - what didn't work and what worked for you?

from extract-tls-secrets.

fancywriter avatar fancywriter commented on May 28, 2024

@neykov I have attached logging.properties similarly how @trittimo did, and I see that it creates file when I do it like this

-javaagent:extract-tls-secrets-4.0.0.jar=secrets.txt

However, it doesn't work with absolute path on another Windows drive letter (sorry, I have to use Windows here, because app is not really portable, though is written on Java)

-javaagent:extract-tls-secrets-4.0.0.jar=A:\secrets.txt

It says

java.io.FileNotFoundException: A:\secrets.txt (The system cannot find the path specified)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileWriter.<init>(Unknown Source)
	at name.neykov.secrets.MasterSecretCallback.write(MasterSecretCallback.java:76)
	at name.neykov.secrets.MasterSecretCallback.onCalculateKeys(MasterSecretCallback.java:42)
	at sun.security.ssl.Handshaker.calculateConnectionKeys(Unknown Source)
	at sun.security.ssl.ClientHandshaker.serverHello(Unknown Source)
	at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
	at sun.security.ssl.Handshaker.processLoop(Unknown Source)
	at sun.security.ssl.Handshaker.process_record(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
	at sun.security.ssl.AppOutputStream.write(Unknown Source)
	at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
	at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
	at sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
	at sun.nio.cs.StreamEncoder.flush(Unknown Source)
	at java.io.OutputStreamWriter.flush(Unknown Source)

Which doesn't make much sense, it has to create file and the root directory of A: exists.

from extract-tls-secrets.

fancywriter avatar fancywriter commented on May 28, 2024

What's weird, that from any java app (if I do one-liner doing nothing, but opening the file) it works fine.
For example, either new FileWriter("A:\\secrets.txt", true) or new FileWriter("A:/secrets.txt", true) work just fine. But, for example, new FileWriter("B:\\secrets.txt", true) doesn't (I don't have drive B, I have only A which is network and C which is system). Could you try to reproduce it?

from extract-tls-secrets.

fancywriter avatar fancywriter commented on May 28, 2024

Oh... I have found root cause of why it happened. Sorry. It has nothing to do with Java or your lovely app.
This is how Windows works. 🤦

The network drive A: is accessible for non-admin user, but not accessible for admin user... The app is run by admin. That's why it "doesn't see" drive A.

So looks great. Thanks again for amazing tool!

from extract-tls-secrets.

neykov avatar neykov commented on May 28, 2024

Thanks for digging into this @fancywriter.

from extract-tls-secrets.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.