JexBoss: The Blunt Instrument for Testing Legacy JBoss Deserialization Flaws
Hook
A single HTTP request containing 180 bytes of serialized Java can give you complete control of an enterprise application server—and JexBoss automates finding and exploiting exactly these openings across entire networks.
Context
Between 2013 and 2017, the Java ecosystem experienced a crisis of trust. Researchers discovered that Java's built-in serialization mechanism—a feature designed for convenience—had become an attack vector of catastrophic proportions. Applications running on JBoss, WebLogic, and other J2EE servers were deserializing untrusted data from HTTP requests, cookies, and RMI calls without validation. An attacker who could slip a malicious serialized object into these data streams could execute arbitrary code on the server.
JBoss Application Server, in particular, exposed multiple attack surfaces: the JMX console allowed unauthenticated deployment of web applications, the invoker servlets accepted serialized objects over HTTP, and the admin console often shipped with default credentials. JexBoss emerged in 2015 as João Filho's answer to a practical problem faced by penetration testers: manually testing dozens or hundreds of JBoss instances for known vulnerabilities was tedious and error-prone. The tool automated both detection and exploitation, condensing what might take hours of manual work into minutes of automated scanning.
Technical Insight
JexBoss operates as a three-stage attack platform: reconnaissance, exploitation, and post-exploitation. The reconnaissance phase methodically probes target servers for vulnerable endpoints and deserialization vectors. It sends HTTP requests to known JBoss paths like /jmx-console/HtmlAdaptor, /web-console/Invoker, /invoker/JMXInvokerServlet, and /admin-console/, analyzing responses to fingerprint server versions and identify accessible management interfaces.
The deserialization testing mechanism is particularly interesting from an architectural standpoint. JexBoss doesn't just check for open ports—it actively attempts exploitation by injecting serialized payloads crafted with gadget chains. A gadget chain is a sequence of existing Java classes that, when deserialized in a specific order, can be manipulated to execute arbitrary code. The tool leverages well-known gadgets from libraries like Apache Commons Collections, Spring Framework, and Groovy that are commonly present in JBoss classpaths.
Here's a simplified example of how JexBoss structures an exploitation attempt against the JMX invoker:
def exploit_jmx_invoker(target_url, payload_type):
endpoint = target_url + "/invoker/JMXInvokerServlet"
# Generate serialized payload based on available gadgets
if payload_type == "commons-collections":
serialized_payload = generate_cc_gadget(command="whoami")
elif payload_type == "spring":
serialized_payload = generate_spring_gadget(command="whoami")
headers = {
'Content-Type': 'application/x-java-serialized-object',
'User-Agent': 'Mozilla/5.0'
}
try:
response = requests.post(
endpoint,
data=serialized_payload,
headers=headers,
timeout=10,
verify=False
)
# Check for successful exploitation indicators
if response.status_code == 200:
return verify_command_execution(target_url)
except Exception as e:
return False
The auto-scan mode demonstrates JexBoss's batch processing capabilities. When provided a CIDR range like 192.168.1.0/24, it generates all IP addresses in that subnet and tests each host on common JBoss ports (8080, 8443, 80, 443). This parallelized approach allows security teams to assess entire network segments for vulnerable JBoss deployments during time-constrained penetration tests.
Once exploitation succeeds, JexBoss transitions into post-exploitation mode. It uploads a JSP webshell to the compromised server, typically by abusing the JMX console's deployment functionality or by writing directly to the server's deployment directory through deserialization gadgets. The webshell provides an interactive command interface where testers can execute shell commands, enumerate the system, or establish a Metasploit meterpreter reverse shell for more sophisticated post-exploitation.
The tool's architecture reveals a pragmatic, red-team focused design philosophy. Rather than building a sophisticated vulnerability database or implementing safe, non-exploitative checks, JexBoss follows a "try it and see" approach. It attempts actual exploitation with live payloads, which provides definitive proof of vulnerability but carries significant risk. This design choice makes it effective for proving exploitability during authorized engagements but dangerous if misused.
JexBoss also extends beyond JBoss to test for Java deserialization vulnerabilities in other contexts. It can detect vulnerable Jenkins CLI implementations, Apache Struts2 servers affected by CVE-2017-5638 (the Equifax breach vulnerability), and generic deserialization endpoints in JSF and Seam applications. This broader scope reflects the ubiquitous nature of Java deserialization issues across the enterprise Java landscape during that period.
Gotcha
The most immediate limitation is JexBoss's hard dependency on Python 2.7, which reached end-of-life on January 1, 2020. Running the tool requires maintaining a Python 2 environment, which introduces security risks and compatibility challenges on modern operating systems. Some distributions no longer ship Python 2 by default, requiring manual installation or containerization. While technically functional, this dependency signals that the tool is not actively maintained for current Python standards.
The exploitation-first approach, while effective for proving vulnerabilities, creates operational risks. JexBoss doesn't just detect vulnerabilities—it actively exploits them by uploading webshells, executing commands, and potentially disrupting services. In production environments or during compliance audits where non-disruptive testing is required, this aggressive behavior is problematic. There's no "safe mode" that stops at detection without exploitation. Additionally, the tool's coverage focuses heavily on vulnerabilities disclosed between 2013-2017. Newer JBoss versions (EAP 7+, WildFly) and recent deserialization vulnerabilities may not be adequately tested. The referenced CVEs and exploit modules reflect the state of JBoss security from nearly a decade ago, making it less relevant for modern Java application security assessments.
Verdict
Use JexBoss if you're conducting authorized penetration tests against legacy enterprise environments running JBoss Application Server versions 3 through 6, need to quickly assess the exploitability of known deserialization vulnerabilities across multiple hosts, or require definitive proof-of-concept exploitation for security findings rather than passive vulnerability detection. It excels in red team engagements where demonstrating full system compromise validates risk severity to stakeholders. Skip it if you're testing modern Java applications (JBoss EAP 7+, WildFly, Spring Boot), lack explicit written authorization for exploitation activities, need Python 3 compatibility for integration with modern toolchains, require non-disruptive vulnerability scanning suitable for production environments, or want actively maintained tools with current CVE coverage. For most security teams today, Metasploit's JBoss modules or Burp Suite with Java deserialization extensions provide similar capabilities with better maintenance and more granular control over exploitation depth.