mirror of
https://github.com/nmap/nmap.git
synced 2025-12-22 07:29:01 +00:00
The NSE HTTP library now uses the host name specified on the command
line when making requests, which improves script scanning against web servers with virtual hosts. Thanks to Sven Klemm for the patch.
This commit is contained in:
@@ -24,7 +24,7 @@ get = function( host, port, path, options )
|
||||
options = options or {}
|
||||
local presets = {Host=host,Connection="close",['User-Agent']="Nmap NSE"}
|
||||
if type(host) == 'table' then
|
||||
presets['Host'] = ( host.name ~= '' and host.name ) or host.ip
|
||||
presets['Host'] = host.targetname or ( host.name ~= '' and host.name ) or host.ip
|
||||
end
|
||||
|
||||
local header = options.header or {}
|
||||
@@ -72,7 +72,7 @@ request = function( host, port, data, options )
|
||||
options = options or {}
|
||||
|
||||
if type(host) == 'table' then
|
||||
host = host.targetname or ( host.name ~= '' and host.name ) or host.ip
|
||||
host = host.ip
|
||||
end
|
||||
|
||||
local protocol = 'tcp'
|
||||
|
||||
Reference in New Issue
Block a user