N /ˆ{‹„„-i[D<†ªoZƒ›Ù«Ð 653_‘I|¥‰ÓMdœv ©ƒ†ü+=ÉÏ�‹½—]o›0†ïû+<_ì.qBC³¶„��×¢A@5UÓT9@‚U‚#ã,ë~ýÌÇÚtJÖUC\qŽýr8�ící�57£[ƒëÈu€óѱM}95²"«é˜ Gc„°Ì„Ø\ ´Û톻Ó!ã+(ë|‚JÁi,†‰H ~¢Umú в”$ò 4AEžêv‘¤?[Ķ¢¤I:A9] œÅ$OQLîpø!Ýr¦¡F/# 6„¶`ÉCyüŠ(R\œ,ê`•ÉuMdà;É骘AÁ6P×èzJÏ ¢1+J´ÈIq?\Ñ%$3øÕ6çߤ‰¬z[×ÈxºœÁ÷æÌ»œÏ ¨{d�jˆÖ¸�Æ!¥k–Ð%M“£â°‡ôçñ€–ÔXP·Ò2æt#(+ž¤H"î£Æ,/7D²ª’ ãûªF’¼4$~6¾`/²ì ’¤ ñ”ÝÁ9�ºOxZ`QžÆ‚ñ‡6ßæå·Å¢Ü\þvA› §«L@€8¨|¶¸/خا�#t0Ǽ3,+Àa('ìÑÞO÷�ü”‘r6MÊ(ÊÅxÀáXU{1çŽcD¸ií.@d÷çžAªmªÁ¨¬. ”sµgÛ’ec²M#²ç^Mó¼© ¬Óé¨çEæb#¼ °+Ij¦=¿›Åvþß@K–')ßç9¶{Õù‡¡q…CÔÒ´Þ‹,ê`<£³ utœ¥÷­Ì�{82‚Û†¥uº)¥gÏp›- 2:YYgïúF¸qq`› EcwÒwÍû†�ƒ£¶:�˜ô aûײ&j�G¯uÚ7ŒÝVGetr� §9ÿñ~‰Ú›·†êÛ»†šÿ‚_¬åͬz 6ˆl–Ðz¾” ŠeJeAà™¸ËêbÑ¿�þD¤Y¹Dã­ÆGŠñüÿÓ ƒxN?ÒÊÐ Mlocal proxy = require "proxy" local shortport = require "shortport" local stdnse = require "stdnse" local string = require "string" local table = require "table" local url = require "url" description=[[ Checks if an HTTP proxy is open. The script attempts to connect to www.google.com through the proxy and checks for a valid HTTP response code. Valid HTTP response codes are 200, 301, and 302. If the target is an open proxy, this script causes the target to retrieve a web page from www.google.com. ]] --- -- @usage -- nmap --script http-open-proxy.nse \ -- --script-args proxy.url=,proxy.pattern= -- @output -- Interesting ports on scanme.nmap.org (64.13.134.52): -- PORT STATE SERVICE -- 8080/tcp open http-proxy -- | proxy-open-http: Potentially OPEN proxy. -- |_ Methods successfully tested: GET HEAD CONNECT -- Arturo 'Buanzo' Busleiman / www.buanzo.com.ar / linux-consulting.buanzo.com.ar -- Changelog: Added explode() function. Header-only matching now works. -- * Fixed set_timeout -- * Fixed some \r\n's -- 2008-10-02 Vlatko Kosturjak -- * Match case-insensitively against "^Server: gws" rather than -- case-sensitively against "^Server: GWS/". -- 2009-05-14 Joao Correa -- * Included tests for HEAD and CONNECT methods -- * Included url and pattern arguments -- * Script now checks for http response status code, when url is used -- * If google is used, script checks for Server: gws author = "Arturo 'Buanzo' Busleiman" license = "Same as Nmap--See https://nmap.org/book/man-legal.html" categories = {"default", "discovery", "external", "safe"} --- Performs the custom test, with user's arguments -- @param host The host table -- @param port The port table -- @param test_url The url te send the request -- @param pattern The pattern to check for valid result -- @return status if any request succeeded -- @return response String with supported methods function custom_test(host, port, test_url, pattern) local lstatus = false local response = {} -- if pattern is not used, result for test is code check result. -- otherwise it is pattern check result. -- strip hostname if not string.match(test_url, "^http://.*") then test_url = "http://" .. test_url stdnse.debug1("URL missing scheme. URL concatenated to http://") end local url_table = url.parse(test_url) local hostname = url_table.host local get_status = proxy.test_get(host, port, "http", test_url, hostname, pattern) local head_status = proxy.test_head(host, port, "http", test_url, hostname, pattern) local conn_status = proxy.test_connect(host, port, "http", hostname) if get_status then lstatus = true response[#response+1] = "GET" end if head_status then lstatus = true response[#response+1] = "HEAD" end if conn_status then lstatus = true response[#response+1] = "CONNECTION" end if lstatus then response = "Methods supported: " .. table.concat(response, " ") end return lstatus, response end --- Performs the default test -- First: Default google request and checks for Server: gws -- Seconde: Request to wikipedia.org and checks for wikimedia pattern -- Third: Request to computerhistory.org and checks for museum pattern -- -- If any of th