1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Fix a crash in rpc-grind when scanning a non-RPC service

This commit is contained in:
dmiller
2024-06-03 19:00:29 +00:00
parent 296d8bd1e7
commit 929a29d310

View File

@@ -103,12 +103,14 @@ local isRPC = function(host, port)
-- If we got response, set port to open -- If we got response, set port to open
nmap.set_port_state(host, port, "open") nmap.set_port_state(host, port, "open")
rxid, msgtype = string.unpack(">I4 I4", data) if #data >= 8 then
-- If response XID does match request XID rxid, msgtype = string.unpack(">I4 I4", data)
-- and message type equals 1 (REPLY) then -- If response XID does match request XID
-- it is a RPC port. -- and message type equals 1 (REPLY) then
if rxid == xid and msgtype == 1 then -- it is a RPC port.
return true if rxid == xid and msgtype == 1 then
return true
end
end end
end end
end end