Fix 'check()' in glossword_upload_exec

bug/bundler_fix
bcoles 2013-02-25 15:52:07 +10:30
parent 1f46b3aa02
commit d7c0ce4e4a
1 changed files with 8 additions and 6 deletions

View File

@ -60,13 +60,15 @@ class Metasploit3 < Msf::Exploit::Remote
print_status("#{peer} - Authenticating as user '#{user}'")
begin
res = login(base, user, pass)
if res and res.code == 200
if res
if res.code == 200
print_error("#{peer} - Authentication failed")
return Exploit::CheckCode::Unknown
elsif res.code == 301 and res.headers['set-cookie'] =~ /sid([\da-f]+)=([\da-f]{32})/
print_good("#{peer} - Authenticated successfully")
return Exploit::CheckCode::Appears
end
end
return Exploit::CheckCode::Safe
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
print_error("#{peer} - Connection failed")