Use Gem::Version
parent
2615a7a3be
commit
7563c0bd0e
|
@ -69,37 +69,43 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
# Test for Desktop Central
|
||||
def check
|
||||
# Test for Desktop Central
|
||||
res = send_request_cgi({
|
||||
'uri' => normalize_uri("configurations.do"),
|
||||
'method' => 'GET'
|
||||
})
|
||||
|
||||
if res && res.code == 200
|
||||
build = "0"
|
||||
build = nil
|
||||
|
||||
if res.body.to_s =~ /ManageEngine Desktop Central 7/ ||
|
||||
res.body.to_s =~ /ManageEngine Desktop Central MSP 7/ # DC v7
|
||||
res.body.to_s =~ /ManageEngine Desktop Central MSP 7/ # DC v7
|
||||
|
||||
print_status("#{peer} - Detected Desktop Central v7")
|
||||
elsif res.body.to_s =~ /ManageEngine Desktop Central 8/ ||
|
||||
res.body.to_s =~ /ManageEngine Desktop Central MSP 8/
|
||||
if res.body.to_s =~ /id="buildNum" value="([0-9]+)"\/>/ # DC v8 (later versions)
|
||||
res.body.to_s =~ /ManageEngine Desktop Central MSP 8/
|
||||
|
||||
if res.body.to_s =~ /id="buildNum" value="([0-9]+)"\/>/ # DC v8 (later versions)
|
||||
build = $1
|
||||
print_status("#{peer} - Detected Desktop Central v8 #{build}")
|
||||
else # DC v8 (earlier versions)
|
||||
else # DC v8 (earlier versions)
|
||||
print_status("#{peer} - Detected Desktop Central v8")
|
||||
end
|
||||
elsif res.body.to_s =~ /id="buildNum" value="([0-9]+)"\/>/ # DC v9 (and higher?)
|
||||
elsif res.body.to_s =~ /id="buildNum" value="([0-9]+)"\/>/ # DC v9 (and higher?)
|
||||
build = $1
|
||||
end
|
||||
|
||||
if build < "80293"
|
||||
if build.nil?
|
||||
return Exploit::CheckCode::Unknown
|
||||
elsif Gem::Version.new(build) < Gem::Version.new("80293")
|
||||
return Exploit::CheckCode::Appears
|
||||
else
|
||||
return Exploit::CheckCode::Safe
|
||||
end
|
||||
end
|
||||
|
||||
Exploit::CheckCode::Unknown
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue