1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00

Correct RPC reserved port range is 512-1023

Some RPC services are strict about this and reject calls when the source port
is outside this range, causing nmap RPC calls to fail 50% of the time.
This commit is contained in:
nnposter
2020-02-29 22:29:51 +00:00
parent 6753d2efdd
commit 80f4733c32
2 changed files with 5 additions and 2 deletions

View File

@@ -172,7 +172,7 @@ Comm = {
if nmap.is_privileged() then
-- Try to bind to a reserved port
for i = 1, 10, 1 do
local resvport = math.random(1, 1024)
local resvport = math.random(512, 1023)
socket = new_socket()
status, err = socket:bind(nil, resvport)
if status then
@@ -189,7 +189,7 @@ Comm = {
if nmap.is_privileged() then
-- Try to bind to a reserved port
for i = 1, 10, 1 do
local resvport = math.random(1, 1024)
local resvport = math.random(512, 1023)
socket = new_socket("udp")
status, err = socket:bind(nil, resvport)
if status then