mirror of
https://github.com/nmap/nmap.git
synced 2025-12-30 19:39:07 +00:00
Add a check to see if reponse from which we wish to extract links is not nil.
This commit is contained in:
@@ -213,11 +213,13 @@ function action(host, port)
|
||||
-- now try inclusion by parameters
|
||||
local injectable = {}
|
||||
-- search for injectable links (as in sql-injection.nse)
|
||||
local links = httpspider.LinkExtractor:new(r.url, r.response.body, crawler.options):getLinks()
|
||||
for _,u in ipairs(links) do
|
||||
local url_parsed = url.parse(u)
|
||||
if url_parsed.query then
|
||||
table.insert(injectable, u)
|
||||
if r.response.status and r.response.body then
|
||||
local links = httpspider.LinkExtractor:new(r.url, r.response.body, crawler.options):getLinks()
|
||||
for _,u in ipairs(links) do
|
||||
local url_parsed = url.parse(u)
|
||||
if url_parsed.query then
|
||||
table.insert(injectable, u)
|
||||
end
|
||||
end
|
||||
end
|
||||
if #injectable > 0 then
|
||||
|
||||
Reference in New Issue
Block a user