mirror of
https://github.com/nmap/nmap.git
synced 2026-10-21 11:22:05 +00:00
Add a check to see if reponse from which we wish to extract links is not nil.
This commit is contained in:
parent
4f84ae1f13
commit
2424c6d2a4
1 changed files with 7 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue