1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-02 21:09:00 +00:00

More DNS TCP support from John Bond

http://seclists.org/nmap-dev/2014/q1/154
This commit is contained in:
dmiller
2014-02-12 17:08:40 +00:00
parent 9365d50cad
commit 6a98f70197
4 changed files with 61 additions and 27 deletions

View File

@@ -149,20 +149,21 @@ local function sendPacketsTCP(data, host, port, timeout)
local send_data = '\000' .. string.char(#data) .. data
socket:send(send_data)
local response = ''
local got_response = false
while true do
local status, recv_data = socket:receive_bytes(1)
if not status then break end
got_response = true
response = response .. recv_data
end
local status, _, _, ip, _ = socket:get_info()
socket:close()
if not got_response then
return false
end
-- remove payload size
table.insert(responses, { data = string.sub(response,3), peer = ip } )
socket:close()
if (#responses>0) then
return true, responses
end
return false
return true, responses
end
---