Fix #9602, a little defensive programming
Check for a nil message and unnecessary auth failures while looping.MS-2855/keylogger-mettle-extension
parent
95a019675f
commit
0e4fc48df4
|
@ -29,15 +29,22 @@ module Msf::Exploit::Remote::Fortinet
|
|||
password || ''
|
||||
))
|
||||
|
||||
tried = false
|
||||
|
||||
loop do
|
||||
message = session.next_message
|
||||
|
||||
return false unless message
|
||||
|
||||
case message.type
|
||||
when USERAUTH_SUCCESS
|
||||
debug { 'Received SSH_MSG_USERAUTH_SUCCESS' }
|
||||
return true
|
||||
when USERAUTH_FAILURE
|
||||
debug { 'Received SSH_MSG_USERAUTH_FAILURE' }
|
||||
|
||||
break if tried
|
||||
|
||||
debug { 'Sending SSH_MSG_USERAUTH_REQUEST (keyboard-interactive)' }
|
||||
|
||||
send_message(userauth_request(
|
||||
|
@ -54,6 +61,8 @@ module Msf::Exploit::Remote::Fortinet
|
|||
'',
|
||||
''
|
||||
))
|
||||
|
||||
tried = true
|
||||
when USERAUTH_INFO_REQUEST
|
||||
debug { 'Received SSH_MSG_USERAUTH_INFO_REQUEST' }
|
||||
|
||||
|
|
Loading…
Reference in New Issue