mirror of
https://github.com/nmap/nmap.git
synced 2025-12-08 13:41:29 +00:00
apply patch by Jah to handle some bogus responses from some devices. See http://seclists.org/nmap-dev/2008/q2/0731.html and http://seclists.org/nmap-dev/2008/q2/0732.html
This commit is contained in:
@@ -116,11 +116,12 @@ request = function( host, port, data, options )
|
|||||||
|
|
||||||
-- build nicer table for header
|
-- build nicer table for header
|
||||||
local last_header, match
|
local last_header, match
|
||||||
for number, line in pairs( header ) do
|
for number, line in ipairs( header ) do
|
||||||
if number == 1 then
|
if number == 1 then
|
||||||
local code
|
local code
|
||||||
_, _, code = string.find( line, "HTTP/%d\.%d (%d+)")
|
_, _, code = string.find( line, "HTTP/%d\.%d (%d+)")
|
||||||
result.status = tonumber(code)
|
result.status = tonumber(code)
|
||||||
|
if not result.status then table.insert(body,line) end
|
||||||
else
|
else
|
||||||
match, _, key, value = string.find( line, "(.+): (.*)" )
|
match, _, key, value = string.find( line, "(.+): (.*)" )
|
||||||
if match and key and value then
|
if match and key and value then
|
||||||
@@ -133,8 +134,10 @@ request = function( host, port, data, options )
|
|||||||
last_header = key
|
last_header = key
|
||||||
else
|
else
|
||||||
match, _, value = string.find( line, " +(.*)" )
|
match, _, value = string.find( line, " +(.*)" )
|
||||||
if match and value then
|
if match and value and last_header then
|
||||||
result.header[last_header] = result.header[last_header] .. ',' .. value
|
result.header[last_header] = result.header[last_header] .. ',' .. value
|
||||||
|
elseif match and value then
|
||||||
|
table.insert(body,line)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user