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