mirror of
https://github.com/nmap/nmap.git
synced 2025-12-30 11:29:01 +00:00
Removes parse_url from http.lua and makes url.parse more functional. Closes #952.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user