mirror of
https://github.com/nmap/nmap.git
synced 2026-09-15 16:58:12 +00:00
Removes parse_url from http.lua and makes url.parse more functional. Closes #952.
This commit is contained in:
parent
011e65c1b7
commit
c2a9a5bbe3
4 changed files with 109 additions and 97 deletions
|
|
@ -29,6 +29,7 @@ local target = require "target"
|
|||
local shortport = require "shortport"
|
||||
local httpspider = require "httpspider"
|
||||
local stdnse = require "stdnse"
|
||||
local url = require "url"
|
||||
|
||||
getLastLoc = function(host, port, useragent)
|
||||
|
||||
|
|
@ -71,7 +72,7 @@ action = function(host, port)
|
|||
-- If the mobile browser request is redirected to a different page, that must be the mobile version's page.
|
||||
if loc ~= mobloc then
|
||||
local msg = "Found mobile version: " .. mobloc
|
||||
local mobhost = http.parse_url(mobloc)
|
||||
local mobhost = url.parse(mobloc)
|
||||
if not crawler:iswithinhost(mobhost.host) then
|
||||
msg = msg .. " (Redirected to a different host)"
|
||||
if newtargets then
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ local httpspider = require "httpspider"
|
|||
local shortport = require "shortport"
|
||||
local stdnse = require "stdnse"
|
||||
local table = require "table"
|
||||
local url = require "url"
|
||||
|
||||
getLastLoc = function(host, port, useragent)
|
||||
|
||||
|
|
@ -158,7 +159,7 @@ action = function(host, port)
|
|||
-- If the library's request returned a different location, that means the request was redirected somewhere else, hence is forbidden.
|
||||
if libloc and loc ~= libloc then
|
||||
forb[l] = {}
|
||||
local libhost = http.parse_url(libloc)
|
||||
local libhost = url.parse(libloc)
|
||||
if not crawler:iswithinhost(libhost.host) then
|
||||
forb[l]['Different Host'] = tostring(libloc)
|
||||
if newtargets then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue