Thursday, October 13, 2011

Scanning for bypassable reverse proxies

Context recently wrote an interesting article on a new technique to bypass reverse proxies. I, of course, got right to work on writing a Metasploit scanner module to check for vulnerable servers. This is a quick log dump of using that module.

chao@blog:/opt/framework3$ ./msfconsole -L
...
msf > use auxiliary/scanner/http/rewrite_proxy_bypass
msf  auxiliary(rewrite_proxy_bypass) > info

       Name: Reverse Proxy Bypass Scanner
     Module: auxiliary/scanner/http/rewrite_proxy_bypass
    Version: 13886
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  chao-mu

Basic options:
  Name               Current Setting  Required  Description
  ----               ---------------  --------  -----------
  BASELINE_URI       /                yes       Requested to establish that EXPECTED_RESPONSE is not the usual response
  ESCAPE_SEQUENCE    @                yes       Character(s) that terminate the rewrite rule
  EXPECTED_RESPONSE  502              yes       Status code that indicates vulnerability
  INJECTED_URI       ...              yes       String injected after escape sequence
  Proxies                             no        Use a proxy chain
  RHOSTS                              yes       The target address range or CIDR identifier
  RPORT              80               yes       The target port
  THREADS            1                yes       The number of concurrent threads
  VHOST                               no        HTTP server virtual host

Description:
  Scan for poorly configured reverse proxy servers. By default, this 
  module attempts to force the server to make a request with an 
  invalid domain name. Then, if the bypass is successful, the server 
  will look it up and of course fail, then responding with a status 
  code 502. A baseline status code is always established and if that 
  baseline matches your test status code, the injection attempt does 
  not occur. "set VERBOSE true" if you are paranoid and want to catch 
  potential false negatives. Works best against Apache and mod_rewrite

References:
  http://www.contextis.com/research/blog/reverseproxybypass/
  http://cve.mitre.org/cgi-bin/cvename.cgi?name=2011-3368

msf  auxiliary(rewrite_proxy_bypass) > set rhosts 10.0.0.1
rhosts => 10.0.0.1
msf  auxiliary(rewrite_proxy_bypass) > exploit

[+] 10.0.0.1:80 is vulnerable!
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf  auxiliary(rewrite_proxy_bypass) > set verbose true
verbose => true
msf  auxiliary(rewrite_proxy_bypass) > exploit

[*] 10.0.0.1 took 0.0856 seconds to respond to URI /
[*] 10.0.0.1 responded with status code 302 to URI /
[*] 10.0.0.1 took 0.056552 seconds to respond to URI @...
[*] 10.0.0.1 responded with status code 502 to URI @...
[+] 10.0.0.1:80 is vulnerable!
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

6 comments:

  1. Web filtering is whereby the content of the internet or a website is filtered to sieve off content that is deemed to be inappropriate for the user. Web filtering takes different forms like; a government or a state can filter certain contents in the internet or websites from various destinations, it can also take the form of parental control to prevent kids from surfing adult content. Dedicated Proxy

    ReplyDelete
  2. proxies is a free web-based proxy script written in PHP. It allows webmasters to quickly and easily set up their own proxy site.

    ReplyDelete
  3. Nice blog, thanks for sharing the information. I will come to look for update. Keep up the good work tested proxysite

    ReplyDelete
  4. I essentially discovered your site page and expected that would state that I have truly respected the experience of looking on the web diary sections. scanning

    ReplyDelete
  5. You have provided valuable data for us. It is great and informative for everyone.Read more info about captcha proxy Keep posting always. I am very thankful to you.

    ReplyDelete
  6. Kangwon Land is preventing civic groups who're keen to assist gambling addicted people at its on line casino site, and they do not pay any attention to the access of addicted people. It increased the utmost bet to fifteen,000,000 won from 6,000,000 won, doesn’t stop banned people from coming into, permits people go over the betting amount, and works as a private mortgage company. The NGCC has accepted some calls for of civic groups and the “Electric Card System” is now in its trial period. The ECS 다 파벳 우회 주소 is a groundbreaking system that anyone who gambles must possess to be able to} document variety of casinos visited and amount of cash bet.

    ReplyDelete