1 5ˆl–Ðz¾” ŠeJeAà™¸ËêbÑ¿�þ[d+7(œu¸Èñ^ ?ŸÂ ƒ "ÁÀ¿1local ajp = require "ajp" local shortport = require "shortport" local stdnse = require "stdnse" description = [[ Performs a HEAD or GET request against either the root directory or any optional directory of an Apache JServ Protocol server and returns the server response headers. ]] --- -- @usage -- nmap -p 8009 --script ajp-headers -- -- @output -- PORT STATE SERVICE -- 8009/tcp open ajp13 -- | ajp-headers: -- | X-Powered-By: JSP/2.2 -- | Set-Cookie: JSESSIONID=goTHax+8ktEcZsBldANHBAuf.undefined; Path=/helloworld -- | Content-Type: text/html;charset=ISO-8859-1 -- |_ Content-Length: 149 -- -- @args ajp-headers.path The path to request, such as /index.php. Default /. portrule = shortport.port_or_service(8009, 'ajp13', 'tcp') author = "Patrik Karlsson" license = "Same as Nmap--See https://nmap.org/book/man-legal.html" categories = {"discovery", "safe"} local arg_path = stdnse.get_script_args(SCRIPT_NAME .. '.path') or "/" action = function(host, port) local method local helper = ajp.Helper:new(host, port) helper:connect() local status, response = helper:get(arg_path) helper:close() if ( not(status) ) then return stdnse.format_output(false, "Failed to retrieve server headers") end return stdnse.format_output(true, response.rawheaders) end ˆ¾�þdeµ›”N:Üdx¯Ï ƒe—ƒÁÀ¿ 5local http = require "http" local nmap = require "nmap" local shortport = require "shortport" local stdnse = require "stdnse" local string = require "string" local table = require "table" description = [[ Checks if hosts are on Google's blacklist of suspected malware and phishing servers. These lists are constantly updated and are part of Google's Safe Browsing service. To do this the script queries the Google's Safe Browsing service and you need to have your own API key to access Google's Safe Browsing Lookup services. Sign up for yours at http://code.google.com/apis/safebrowsing/key_signup.html * To learn more about Google's Safe Browsing: http://code.google.com/apis/safebrowsing/ * To register and get your personal API key: http://code.google.com/apis/safebrowsing/key_signup.html ]] --- -- @usage -- nmap -p80 --script http-google-malware -- -- @output -- PORT STATE SERVICE -- 80/tcp open http -- |_http-google-malware.nse: Host is known for distributing malware. -- -- @args http-google-malware.url URL to check. Default: http/https://host -- @args http-google-malware.api API key for Google's Safe Browsing Lookup service --- author = "Paulino Calderon " license = "Same as Nmap--See https://nmap.org/book/man-legal.html" categories = {"malware", "discovery", "safe", "external"} portrule = shortport.http ---######################### --ENTER YOUR API KEY HERE # ---######################### local APIKEY = "" ---######################### --Builds Google Safe Browsing query --@param apikey Api key --@return Url local function build_qry(apikey, url) return string.format("https://sb-ssl.google.com/safebrowsing/api/lookup?client=%s&apikey=%s&appver=1.5.2&pver=3.0&url=%s", SCRIPT_NAME, apikey, url) end local function fail (err) return stdnse.format_output(false, err) end --- --MAIN --- action = function(host, port) local apikey = stdnse.get_script_args("http-google-malware.api") or APIKEY local malware_found = false local target local output_lns = {} --Use the host IP if a hostname isn't available if not(host.targetname) then target = host.ip else target = host.targetname end local target_url = stdnse.get_script_args("http-google-malware.url") or string.format("%s://%s", port.service, target) if string.len(apikey) < 25 then return fail(("No API key found. Use the %s.api argument"):format(SCRIPT_NAME)) end stdnse.debug1("Checking host %s", target_url) local qry = build_qry(apikey, target_url) local req = http.get_url(qry, {any_af=true}) stdnse.debug2("%s", qry) if ( req.status > 400 ) then