1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-23 16:09:02 +00:00

Merge from /nmap-exp/david/nselib-http. This is an overhaul of HTTP

parsing mostly. Response parsing is centralized, and fewer operations
are done on raw HTTP data.

The biggest user-visible change is that http.request goes back to
returning a parsed result table, not raw HTTP data. I believe this is
how the function worked in the past; it's what the NSEDoc for the
function says. The only thing that used http.request was citrixxml.lua,
and this commit alters it to match the new expectations.

The other change is that the http.pipeline function no longer accepts
the "raw" option. The only script that used that was sql-injection.nse,
and this commit modifies that script as well.
This commit is contained in:
david
2010-01-13 02:53:13 +00:00
parent b04a80b557
commit 19c2d93903
3 changed files with 715 additions and 684 deletions

View File

@@ -43,15 +43,15 @@ if it is vulnerable
local function check_injection_response(response)
response = string.lower(response)
local body = string.lower(response.body)
if not (string.find(response, 'http/%d\.%d%s*[25]00')) then
if not (response.status == 200 or response.status ~= 500) then
return false
end
return (string.find(response, "invalid query") or
string.find(response, "sql syntax") or
string.find(response, "odbc drivers error"))
return (string.find(body, "invalid query") or
string.find(body, "sql syntax") or
string.find(body, "odbc drivers error"))
end
--[[
@@ -90,7 +90,6 @@ Creates a pipeline table and returns the result
local function inject(host, port, injectable)
local all = {}
local pOpts = {}
pOpts.raw = true
for k, v in pairs(injectable) do
all = http.pGet(host, port, v, nil, nil, all)
end