Re: Recent Application Test

From: Ben Timby (asp@webexc.com)
Date: Wed Aug 18 2004 - 18:14:37 EDT


See comments inline.

ramatkal@hotmail.com wrote:

>
> During a recent Application pen test I came across a url of the form:
>
> http://www.vulnsite.com/cgi-bin/vulnscript.jsp?url=www.website.com&id=12345
>
> I changed the url parameter to something like url=www.google.com and google appeared in my browser. Next, i changed the url to url=www.whatismyip.com, hoping that the ip address of the webserver would be displayed, however, only my ip address was displayed.
>
> This means that my browser is loading the url parameter as opposed to the webserver script fethching the url and then displaying it for me in my browser right? Is this a security issue?

Yes, the URL is either:

A. being redirected to by the site you were testing.
B. being loaded in a frame or iframe.
C. some other method of directing your browser to the url provided.

I cannot think of any security issues associated with this behavior.
Likely this is a link/clickthru tracking arrangement.

> Assuming that it was the actual webserver script fetching the url parameter and then displaying it for me, I've come up with a few vulnerabilities (listed below) and was hoping that people might like to share some of their ideas.
>
> 1) Can use vulnsite as a proxy (& hack other sites)
> 2) Can port scan using the vuln site by changing url=www.website.com to url=www.sitetoscan.com:port
> 3) Can connect to & port scan machines behind the firewall.

If the webserver _were_ making the connection on your behalf (which it
appears to not be doing), then the above would be true, depending on how
the client code validated and handled the provided url. In addition,
some XSS may be possible:

http://www.vulnsite.com/cgi-bin/vulnscript.jsp?url=www.ev1ldom41n.com/grabmycookies_fromvulnsite.php

You would know if this were the case based on the test you did with
whatismyip.com (which indicates YOUR BROWSER makes the request).

I have written an HTTP proxy in ASP/COM, that does just what you are
describing, the hard part was parsing the HTML, and replacing all links,
form targets, image references and image maps with URLs pointing back to
the asp proxy, so it could fetch these on the client's behalf. It even
supports HTTPS. It also stripped javascript (from stupid sites that did
not support browsecaps), as I found this was just too hard to parse and
would cause many errors once I had modified the HTML. I wrote this to
allow my friends that work for nazi corporations which disallow browsing
to still browse the sites they wanted to (oh, and the url= part of my
querystring was encrypted to bypass their silly keyword rules). My
script has the potential for being abused in the manner you describe,
but is of course password protected.

Hope that helps.

------------------------------------------------------------------------------
Ethical Hacking at the InfoSec Institute. All of our class sizes are
guaranteed to be 12 students or less to facilitate one-on-one interaction
with one of our expert instructors. Check out our Advanced Hacking course,
learn to write exploits and attack security infrastructure. Attend a course
taught by an expert instructor with years of in-the-field pen testing
experience in our state of the art hacking lab. Master the skills of an
Ethical Hacker to better assess the security of your organization.

http://www.securityfocus.com/sponsor/InfoSecInstitute_pen-test_040817
-------------------------------------------------------------------------------



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:53:59 EDT