From 76f7cced70dba2019d72074df7a8fae6681bc9ce Mon Sep 17 00:00:00 2001 From: fyodor Date: Sat, 31 May 2008 03:24:25 +0000 Subject: [PATCH] change http User-Agent header value to: Mozilla/5.0 (compatible; Nmap Scripting Engine; http://nmap.org/book/nse.html) --- nselib/http.lua | 2 +- scripts/SQLInject.nse | 2 +- scripts/UPnP-info.nse | 2 +- scripts/showHTTPVersion.nse | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nselib/http.lua b/nselib/http.lua index 79908edb4..9d8c15047 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -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 diff --git a/scripts/SQLInject.nse b/scripts/SQLInject.nse index 01ce456c4..86ca7f023 100644 --- a/scripts/SQLInject.nse +++ b/scripts/SQLInject.nse @@ -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')) diff --git a/scripts/UPnP-info.nse b/scripts/UPnP-info.nse index df783bd58..f21de3602 100644 --- a/scripts/UPnP-info.nse +++ b/scripts/UPnP-info.nse @@ -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" diff --git a/scripts/showHTTPVersion.nse b/scripts/showHTTPVersion.nse index 75c3e39b7..fc8c574bf 100644 --- a/scripts/showHTTPVersion.nse +++ b/scripts/showHTTPVersion.nse @@ -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()