1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-01 12:29:03 +00:00

Correctly pack TCP payload size for dns.lua

This commit is contained in:
dmiller
2024-11-13 19:15:12 +00:00
parent cffc94e845
commit d21a4ee4ce

View File

@@ -145,8 +145,7 @@ local function sendPacketsTCP(data, host, port, timeout)
local responses = {}
socket:set_timeout(timeout)
socket:connect(host, port)
-- add payload size we are assuming a minimum size here of 256?
local send_data = '\000' .. string.char(#data) .. data
local send_data = string.pack(">s2", data)
socket:send(send_data)
local response = ''
local got_response = false