mirror of
https://github.com/nmap/nmap.git
synced 2025-12-31 11:59:03 +00:00
Handle exception generated when the spider process hands http-backup-finder a URL that is only a hostname. When url.parse processes this value on line 107 of http-backup-finder it returns nil for the .path property.
http-backup-finder.nse:107: attempt to index field 'path' (a nil value) stack traceback: Addressed this by setting nil .path values to '/'. Tested with sites with and without backup files. Verified that duplicate results were not returned.
This commit is contained in:
@@ -102,6 +102,11 @@ action = function(host, port)
|
||||
|
||||
-- parse the returned url
|
||||
local parsed = url.parse(tostring(r.url))
|
||||
|
||||
-- handle case where only hostname was provided
|
||||
if ( parsed.path == nil ) then
|
||||
parsed.path = '/'
|
||||
end
|
||||
|
||||
-- only pursue links that have something looking as a file
|
||||
if ( parsed.path:match(".*%.*.$") ) then
|
||||
|
||||
Reference in New Issue
Block a user