Check for nil, EOFError, and zero-length response
This commit is contained in:
@@ -77,7 +77,13 @@ class MetasploitModule < Msf::Exploit::Remote
|
||||
begin
|
||||
connect
|
||||
|
||||
if sock.get_once.length == 0
|
||||
res = begin
|
||||
sock.get_once || ''
|
||||
rescue EOFError
|
||||
''
|
||||
end
|
||||
|
||||
if res.length == 0
|
||||
print_good('Detected telnetenabled on TCP')
|
||||
else
|
||||
print_good('Detected telnetd on TCP')
|
||||
|
||||
Reference in New Issue
Block a user