mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 20:29:03 +00:00
Couple of patches from Sven Klemm that speed up http nse scripts by telling the server to automatically close the connection
This commit is contained in:
@@ -71,6 +71,7 @@ action = function(host, port)
|
||||
query = query .. "Accept: */*\r\n"
|
||||
query = query .. "Accept-Language: en\r\n"
|
||||
query = query .. "User-Agent: Nmap NSE\r\n"
|
||||
query = query .. "Connection: close\r\n"
|
||||
query = query .. "Host: " .. host.ip .. ":" .. port.number .. "\r\n\r\n"
|
||||
|
||||
local headers = get_http_headers(host.ip, port.number, query)
|
||||
@@ -100,6 +101,7 @@ action = function(host, port)
|
||||
query = query .. "Accept: */*\r\n"
|
||||
query = query .. "Accept-Language: en\r\n"
|
||||
query = query .. "User-Agent: Nmap NSE\r\n"
|
||||
query = query .. "Connection: close\r\n"
|
||||
query = query .. "Host: " .. host.ip .. ":" .. port.number .. "\r\n\r\n"
|
||||
|
||||
auth = ""
|
||||
@@ -115,6 +117,7 @@ action = function(host, port)
|
||||
query = query .. "Accept: */*\r\n"
|
||||
query = query .. "Accept-Language: en\r\n"
|
||||
query = query .. "User-Agent: Nmap NSE\r\n"
|
||||
query = query .. "Connection: close\r\n"
|
||||
query = query .. "Host: " .. host.ip .. ":" .. port.number .. "\r\n\r\n"
|
||||
|
||||
auth = ""
|
||||
|
||||
@@ -48,6 +48,7 @@ action = function(host, port)
|
||||
query = query .. "Accept-Language: en"
|
||||
query = query .. "User-Agent: Nmap NSE"
|
||||
query = query .. "Host: " .. host.ip .. ":" .. port.number
|
||||
query = query .. "Connection: close"
|
||||
query = query .. '\r\n\r\n';
|
||||
try(soc:send(strbuf.dump(query, '\r\n')))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user