Checking if an HTTP proxy is open

HTTP proxies are used to make requests through their addresses, therefore hiding our real IP address from the target. Detecting them is important if you are a system administrator who needs to keep the network secure, or an attacker who spoofs his real origin.

This recipe shows you how to use Nmap to detect an open HTTP proxy.

How to do it...

Open your terminal and enter the following command:

$ nmap --script http-open-proxy -p8080 <target>

The results include the HTTP methods that were successfully tested:

PORT     STATE SERVICE
8080/tcp open  http-proxy
|  proxy-open-http: Potentially OPEN proxy.
|_ Methods successfully tested: GET HEAD CONNECT

How it works...

We use the argument --script http-open-proxy -p8080 to launch the NSE script http-open-proxy if a web server is found running on port 8080, a common port for HTTP proxies.

The NSE script http-open-proxy was submitted by Arturo "Buanzo" Busleiman and it was designed to detect open proxies, as its name indicates. By default it requests google.com, wikipedia.org, and computerhistory.org, and looks for a known text pattern to determine if there is an open HTTP proxy running on the target web server.

There's more...

You may request a different URL and specify the pattern that will be returned if the connection is successful by using the script parameters http-open-proxy.url and http-open-proxy.pattern:

$ nmap --script http-open-proxy –script-args http-open-proxy.url=http://whatsmyip.org,http-open-proxy.pattern="Your IP address is" -p8080 <target>

HTTP User Agent

There are some packet filtering products that block requests that use Nmap's default HTTP user agent. You can use a different HTTP User Agent by setting the argument http.useragent:

$ nmap -p80 --script http-trace --script-args http.useragent="Mozilla 42" <target>

See also

  • The Detecting possible XST vulnerabilities recipe
  • The Discovering interesting files and directories on web various servers recipe
  • The Detecting web application firewalls recipe
  • The Brute forcing HTTP authentication recipe
  • The Abusing mod_userdir to enumerate user accounts recipe
  • The Testing default credentials in web applications recipe
  • The Brute-force password auditing WordPress installations recipe
  • The Brute-force password auditing Joomla! installations recipe
  • The Finding SQL injection vulnerabilities in web applications recipe
  • The Detecting web servers vulnerable to slowloris denial of service attacks recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.21.47