1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-16 10:26:33 +00:00

Re-enabled connection attempts to RPC services when running in non-privileged

mode. This also fixes a bug in the privileged port binding loop, don't always try to
bind() to port 1000 but use the current resvport instead.
This commit is contained in:
henri
2012-07-27 17:23:03 +00:00
parent 4b77d989e2
commit d1d1c7a6f4

View File

@@ -167,19 +167,21 @@ Comm = {
if nmap.is_privileged() then
-- Try to bind to a reserved port
for resvport = 600, 1024, 1 do
status, err = socket:bind(nil, 1000)
status, err = socket:bind(nil, resvport)
if status then
status, err = socket:connect(host, port)
if status then break end
end
end
else
status, err = socket:connect(host, port)
end
else
socket = nmap.new_socket("udp")
if nmap.is_privileged() then
-- Try to bind to a reserved port
for resvport = 600, 1024, 1 do
status, err = socket:bind(nil, 1000)
status, err = socket:bind(nil, resvport)
if status then break end
end
end