mirror of
https://github.com/nmap/nmap.git
synced 2025-12-16 04:39:03 +00:00
Make http-slowloris use the Nmap user agent
This can now be changed with --script-args http.useragent=X
This commit is contained in:
@@ -128,8 +128,7 @@ local function do_half_http(host, port, obj)
|
|||||||
-- Build a half-http header.
|
-- Build a half-http header.
|
||||||
local half_http = "POST /" .. tostring(math.random(100000, 900000)) .. " HTTP/1.1\r\n" ..
|
local half_http = "POST /" .. tostring(math.random(100000, 900000)) .. " HTTP/1.1\r\n" ..
|
||||||
"Host: " .. host.ip .. "\r\n" ..
|
"Host: " .. host.ip .. "\r\n" ..
|
||||||
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; " ..
|
"User-Agent: " .. http.USER_AGENT .. "\r\n" ..
|
||||||
".NET CLR 1.1.4322; .NET CLR 2.0.503l3; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSOffice 12)\r\n" ..
|
|
||||||
"Content-Length: 42\r\n"
|
"Content-Length: 42\r\n"
|
||||||
|
|
||||||
try(slowloris:send(half_http))
|
try(slowloris:send(half_http))
|
||||||
@@ -166,8 +165,7 @@ local function do_monitor(host, port)
|
|||||||
|
|
||||||
local request = "GET / HTTP/1.1\r\n" ..
|
local request = "GET / HTTP/1.1\r\n" ..
|
||||||
"Host: " .. host.ip ..
|
"Host: " .. host.ip ..
|
||||||
"\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; " ..
|
"\r\nUser-Agent: " .. http.USER_AGENT .. "\r\n\r\n"
|
||||||
".NET CLR 1.1.4322; .NET CLR 2.0.503l3; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSOffice 12)\r\n\r\n"
|
|
||||||
local opts = {}
|
local opts = {}
|
||||||
local _
|
local _
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user