mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 21:21:31 +00:00
Provides a common function, url.get_default_port(), for obtaining
the default port number for a given scheme. Fixes #781
This commit is contained in:
@@ -147,12 +147,8 @@ PHP files are not handling safely the variable $_SERVER["PHP_SELF"] causing Refl
|
||||
|
||||
--Only work with .php files
|
||||
if ( parsed.path and parsed.path:match(".*.php") ) then
|
||||
--The following port/scheme code was seen in http-backup-finder and its neat =)
|
||||
local host, port = parsed.host, parsed.port
|
||||
if ( not(port) ) then
|
||||
port = (parsed.scheme == 'https') and 443
|
||||
port = port or ((parsed.scheme == 'http') and 80)
|
||||
end
|
||||
local host = parsed.host
|
||||
local port = parsed.port or url.get_default_port(parsed.scheme)
|
||||
local escaped_link = parsed.path:gsub(" ", "%%20")
|
||||
if launch_probe(host,port,escaped_link) then
|
||||
table.insert(vulnpages, parsed.scheme..'://'..host..escaped_link..PHP_SELF_PROBE)
|
||||
|
||||
Reference in New Issue
Block a user