Minor syntax; add logging for unhandled fields

GSoC/Meterpreter_Web_Console
Jon Hart 2019-01-31 18:41:27 -08:00
parent 4681ed9669
commit f0519a5af5
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
1 changed files with 5 additions and 4 deletions

View File

@ -35,13 +35,13 @@ class MetasploitModule < Msf::Auxiliary
def scanner_process(data, shost, sport)
offset = 0
if data.length < 4
return
return
end
type, length = data.unpack("vn")
offset += 4
if type != 1 || length != data.length - offset
return
return
end
remaining = data.length - offset
@ -52,11 +52,11 @@ class MetasploitModule < Msf::Auxiliary
remaining -= 4
field_data = data.slice(offset, length)
offset += length
remaining -= length
if field_data.empty?
next
end
offset += length
remaining -= length
# name
if type == 0x0b
info['name'] = field_data
@ -80,6 +80,7 @@ class MetasploitModule < Msf::Auxiliary
elsif type == 0x0d
info['essid'] = field_data
else
vprint_warning("#{shost}:#{sport} skipping unhandled #{length}-byte field type '#{type}': '#{field_data.unpack("H*")}'")
end
end