mirror of
https://github.com/nmap/nmap.git
synced 2026-07-11 18:55:08 +00:00
change http User-Agent header value to: Mozilla/5.0 (compatible; Nmap Scripting Engine; http://nmap.org/book/nse.html)
This commit is contained in:
parent
746e2872b8
commit
76f7cced70
4 changed files with 4 additions and 4 deletions
|
|
@ -22,7 +22,7 @@ require 'url'
|
|||
-- fetch relative URL with get request
|
||||
get = function( host, port, path, options )
|
||||
options = options or {}
|
||||
local presets = {Host=host,Connection="close",['User-Agent']="Nmap NSE"}
|
||||
local presets = {Host=host,Connection="close",['User-Agent']="Mozilla/5.0 (compatible; Nmap Scripting Engine; http://nmap.org/book/nse.html)"}
|
||||
if type(host) == 'table' then
|
||||
presets['Host'] = host.targetname or ( host.name ~= '' and host.name ) or host.ip
|
||||
end
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ local function get_page(host, port, httpurl)
|
|||
query = query .. "GET " .. httpurl .. " HTTP/1.1"
|
||||
query = query .. "Accept: */*"
|
||||
query = query .. "Accept-Language: en"
|
||||
query = query .. "User-Agent: Nmap NSE"
|
||||
query = query .. "User-Agent: Mozilla/5.0 (compatible; Nmap Scripting Engine; http://nmap.org/book/nse.html)"
|
||||
query = query .. "Host: " .. host.ip .. ":" .. port.number
|
||||
try(soc:send(strbuf.dump(query, '\r\n') .. '\r\n\r\n'))
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ action = function(host, port)
|
|||
-- create an HTTP request for the file, using the host and port we extracted earlier
|
||||
payload = payload .. "GET /" .. xfile .. " HTTP/1.1\r\n"
|
||||
payload = payload .. "Accept: text/xml, application/xml, text/html\r\n"
|
||||
payload = payload .. "User-Agent: Mozilla/4.0 (compatible; NMAP NSE)\r\n"
|
||||
payload = payload .. "User-Agent: Mozilla/5.0 (compatible; Nmap Scripting Engine; http://nmap.org/book/nse.html)\r\n"
|
||||
payload = payload .. "Host: " .. xhost .. ":" .. xport .. "\r\n"
|
||||
payload = payload .. "Connection: Keep-Alive\r\n"
|
||||
payload = payload .. "Cache-Control: no-cache\r\n"
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ action = function(host, port)
|
|||
local query = "GET / HTTP/2.1\r\n"
|
||||
query = query .. "Accept: */*\r\n"
|
||||
query = query .. "Accept-Language: en\r\n"
|
||||
query = query .. "User-Agent: Nmap NSE\r\n"
|
||||
query = query .. "User-Agent: Mozilla/5.0 (compatible; Nmap Scripting Engine; http://nmap.org/book/nse.html)\r\n"
|
||||
query = query .. "Host: " .. host.ip .. ":" .. port.number .. "\r\n\r\n"
|
||||
|
||||
local socket = nmap.new_socket()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue