JMX Enumeration with jmxterm (JMX over RMI)
remote-method-guesser (rmg) is a more capable RMI client than the nmap NSE scripts — it handles endpoint redirection, lists bindings with type detail, and can follow a registry reference to the actual RMI server port when they differ. This matters because firewalls often expose the registry port (1099) but block the actual RMI endpoint port that objects redirect to. Use rmg when nmap output is incomplete or empty despite the port being open.
Install rmg
Explain command
| https://github.com/qtc-de/remote-method-guesser/releases/latest/download/rmg.jar | URL of the remote-method-guesser JAR file to download. |
| -O /opt/rmg.jar | Save downloaded file to the specified output path. |
| -jar /opt/rmg.jar | Tells the JVM to execute the specified JAR file. |
List Registry Bindings
[+] RMI registry bound names: [+] jmxrmi [+] Implementing classes: [+] javax.management.remote.rmi.RMIServer [+] Endpoint: 10.10.10.50:45231 [+] HelloService [+] Implementing classes: [+] com.example.HelloService [+] Endpoint: 10.10.10.50:45232
Explain command
| $TARGET_IP | Target host IP address to connect to. |
| 1099 | Target RMI registry port number (default RMI port). |
rmg shows the actual endpoint port each binding redirects to. In this example jmxrmi points to port 45231 — this is the port jmxterm needs for the JMX service URL, not the registry port 1099. Confirm that port is reachable before building the URL.
Follow Redirection — Check Endpoint Reachability
[+] Bound name jmxrmi is bound to: 10.10.10.50:45231 [+] Endpoint is reachable
Explain command
| $TARGET_IP | Target host IP address to connect to. |
| 1099 | RMI registry port to query on the target host. |
| jmxrmi | RMI registry name/binding to look up on the registry. |
Connection to 10.10.10.50 45231 port [tcp/*] succeeded! endpoint reachable
Explain command
| -z | Zero-I/O mode; scan without sending data, used for port scanning. |
| -v | Verbose mode; prints connection status and diagnostic info. |
| $TARGET_IP 45231 | Target host and port number to test connectivity against. |
Endpoint blocked means you have partial exposure — the registry is reachable but the actual RMI server port is firewalled. You need a pivot or port forward to exploit this further. Endpoint reachable means you can proceed directly to JMX enumeration.
Scan Common RMI/JMX Ports
1099/tcp open rmiregistry Java RMI 8686/tcp open rmiregistry Java RMI
Explain command
| -sV | Probe open ports to determine service/version info. |
| -p 1099,8686,9010,9999,1100,4444,7001,7002 | Scan only these specific ports (common RMI/JMX/WebLogic ports). |
| $TARGET_IP | Placeholder for the target host IP address. |
| --open | Show only ports with open state in the results. |
Explain command
| $TARGET_IP | Target host IP address to connect to. |
| 8686 | Target port number where the RMI registry is listening. |
Warning
rmg has vulnerability scanning and exploitation capabilities beyond registry enumeration. Keep usage to enum and lookup commands when operating under OSCP or other exam constraints.
References
-
remote-method-guesser (rmg)github.com/qtc-de/remote-method-guesser (opens in new tab)
RMI enumeration, lookup, and endpoint reachability checking
Was this helpful?
Your feedback helps improve this page.