githubEdit

Pentesting Java RMI/JMX

Discovery

# Nmap identifies RMI
nmap -sC -sV TARGET -p 1099,2222,9010

# Common RMI output
2222/tcp open  java-rmi   Java RMI
| rmi-dumpregistry:
|   jmxrmi
|     javax.management.remote.rmi.RMIServerImpl_Stub

Common Ports:

  • 1099 - Default RMI registry

  • 2222 - Alternative RMI

  • 9010 - JMX remote


remote-method-guesser (rmg)

Tool for Java RMI vulnerability scanning.

Installation

Enumeration

Method Guessing

Known Objects Info


Beanshooter (JMX Exploitation)

JMX enumeration and attacking tool.

Installation

Enumeration

Enumerate Tomcat Users via JMX

List MBeans

File System Access via Model MBean

Deploy a Model MBean with java.io.File to enumerate the filesystem:

Remote Code Execution via StandardMBean

Tonka Shell (Full Build Required)


References

  • https://book.hacktricks.wiki/en/network-services-pentesting/1099-pentesting-java-rmi.html

  • https://github.com/qtc-de/remote-method-guesser

  • https://github.com/qtc-de/beanshooter

Last updated