1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-03 13:19:04 +00:00

Remove bin.lua packing from more scripts

This commit is contained in:
dmiller
2018-09-05 21:57:41 +00:00
parent c47e3961b6
commit 0b9bcba19b
14 changed files with 42 additions and 52 deletions

View File

@@ -1,4 +1,3 @@
local bin = require "bin"
local ipOps = require "ipOps"
local math = require "math"
local nmap = require "nmap"
@@ -494,14 +493,14 @@ function make_udp_packet(response)
-- dummy headers
-- ip
local dh = "\x45\x00" -- IPv4, 20-byte header, no DSCP, no ECN
.. bin.pack('>S', iplen) -- total length
.. string.pack('>I2', iplen) -- total length
.. "\x00\x00" -- IPID 0
.. "\x40\x00" -- DF
.. "\x40\x11" -- TTL 0x40, UDP (proto 17)
.. "\x00\x00" -- checksum 0
.. "\x00\x00\x00\x00\x00\x00\x00\x00" -- Source, destination 0.0.0.0
.. "\x00\x00\x00\x00" -- UDP source, dest port 0
.. bin.pack('S', udplen) -- UDP length
.. string.pack('>I2', udplen) -- UDP length
.. "\x00\x00" -- UDP checksum 0
return packet.Packet:new(dh .. response, iplen)