1
0
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:
perdo
2012-07-17 16:11:10 +00:00
parent 4f84ae1f13
commit 2424c6d2a4

View File

@@ -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