1

As a penetration tester, I have come across an open JDWP port. I can connect to it with Eclipse and browse the threads and memory, but I don't have the source code for the application. I'd like to inject my own Java code, perhaps as an Exception handler, in order to return a shell. How can I modify the running/suspended Java application over JDWP, preferably using Eclipse as my debugger?

bonsaiviking
  • 5,825
  • 1
  • 20
  • 35
  • Um, isn't that your job to figure out? – bmargulies Feb 01 '12 at 18:54
  • @user1183387:I was wondering why do you want to do that?An open port either for remote debugging or for remote management via JMX in the field is a finding by itself.I.e. it should be closed.So why are you trying to do an exploit?Just report it as a finding. – Cratylus Feb 01 '12 at 19:58
  • 1
    @bmargulies Congratulations, you have found the universal comment that can be applied to every question on stackoverflow. – bonsaiviking Feb 08 '12 at 19:42
  • @user384706 If the test were a vulnerability scan, then yes. As part of a penetration test, though, I want to exploit the vulnerability to gain privileges on the system. – bonsaiviking Feb 08 '12 at 19:49

1 Answers1

2

I found the answer to my question: JavaPayload by Michael 'mihi' Schierl lets you load Java payloads through JDWP, among others.

DaveShaw
  • 52,123
  • 16
  • 112
  • 141
bonsaiviking
  • 5,825
  • 1
  • 20
  • 35