mirror of
https://github.com/nmap/nmap.git
synced 2025-12-29 02:49:01 +00:00
Fixes false positives in RFC1918 IP address detection
This commit is contained in:
@@ -104,14 +104,11 @@ end
|
||||
|
||||
-- a function to extract internal ip addresses from PROPFIND response.
|
||||
local function getIPs(body)
|
||||
local ip_pat1 = '192%.168%.%d+%.%d+'
|
||||
local ip_pat2 = '10%.%d+%.%d+%.%d+'
|
||||
local ip_pat3 = '172%.%d+%.%d+%.%d+'
|
||||
local ip_pats = {
|
||||
ip_pat1,
|
||||
ip_pat2,
|
||||
ip_pat3,
|
||||
}
|
||||
local ip_pats = {'%f[%d]192%.168%.%d+%.%d+',
|
||||
'%f[%d]10%.%d+%.%d+%.%d+',
|
||||
'%f[%d]172%.1[6-9]%.%d+%.%d+',
|
||||
'%f[%d]172%.2%d%.%d+%.%d+',
|
||||
'%f[%d]172%.3[01]%.%d+%.%d+'}
|
||||
local result = {}
|
||||
for _, ip_pat in pairs(ip_pats) do
|
||||
for ip in body:gmatch(ip_pat) do
|
||||
|
||||
Reference in New Issue
Block a user