Ezekiel
02-06-2006, 01:42 PM
There have been a few posts on this forum, and webpages about cross site scripting, for example:
http://www.net-force.nl/files/articles/hotmail_xss/
But nearly all of them do not work, by the time the exploit has been made public enough to have a whole page written about it, the vulnerable pages have either been fixed or will be within days. I am just posting an example of a working XSS exploit (at the moment it is anyway) so people can actually see how it works, instead of following links in that tutorial that are outdated and fixed months ago. It took me about 20 minutes looking through the latest exploits from various mailing lists and websites to find one good enough to post about, it is for aol mail. First I will explain cross site scripting though. Cross site scripting (or XSS) is exploiting bad programming in websites, people like us find vulnerabilities in a page and exploit it. The things we exploit are holes where we can inject code, usually websites filter html, javascript etc, but these holes allow us to add code to the page that can do anything. The thing that XSS is used for is to steal someone's cookie, a text file that is created whenever you log in to any online service, like email. Cookies are restricted; they are only accessible when you are on the site that created it, for example when you log in to hotmail the cookie will stay and can be accessed from any site that is .msn.com, like the ilovemessenger.msn.com exploit. It's a pretty good security system, only trusted sites from the correct domain can access the cookie, which could potentially give the attacker access to the account. XSS can get around this though, like I said before, XSS can "inject" custom code, so you could add whatever malicious code you liked, so you can craft a url which will exploit the vulnerability, and will transmit the cookie to your own server, giving you access to their account, because it was stolen while they were still on the correct domain, the code just added stuff to the page and you were on a trusted page. Back to the exploit then, the one I found was from here:
http://seclists.org/lists/bugtraq/2006/Jan/0*25.html
It was from January, but from what I can tell it is still working (it is aol, what did you expect). I would have preferred a XSS from hotmail (because I use hotmail), but it's still a pretty big exploit, anyone reading this who uses or knows someone who uses aol has the ability to hack their account just by the target clicking one link from an email (you have to have a ftp server, get one for free), if someone spammed out this link you could hack *000s of accounts within days if the vulnerability isn't fixed. I do not have time to go through everything about this, I may do later though. The vulnerability exists in about 7 aol pages, listed on that link I gave you. To prove it works, go to this url:
http://aimtoday.aol.com/features/main_redesign.adp?fid=acct_linking"><script>alert('VULNERABLE')</script>
Copy the WHOLE link right up to the end of the page, copy and paste if necessary. That should bring up a popup of "VULNERABLE", if it does then it is still working and that means you can replace the simple "vulnerable" popup with a malicious cookie stealing script. If there's anyone who has an aol account reading this, sign in to your aol mail account, then when you are on your inbox in your browser type and go to this url:
http://aimtoday.aol.com/features/main_redesign.adp?fid=acct_linking"><script>alert(document.cookie)</script>
It should popup with your cookie data, this means that you can steal other people's cookies. I will post more on this later, like how to log stolen cookies to your website.
http://www.net-force.nl/files/articles/hotmail_xss/
But nearly all of them do not work, by the time the exploit has been made public enough to have a whole page written about it, the vulnerable pages have either been fixed or will be within days. I am just posting an example of a working XSS exploit (at the moment it is anyway) so people can actually see how it works, instead of following links in that tutorial that are outdated and fixed months ago. It took me about 20 minutes looking through the latest exploits from various mailing lists and websites to find one good enough to post about, it is for aol mail. First I will explain cross site scripting though. Cross site scripting (or XSS) is exploiting bad programming in websites, people like us find vulnerabilities in a page and exploit it. The things we exploit are holes where we can inject code, usually websites filter html, javascript etc, but these holes allow us to add code to the page that can do anything. The thing that XSS is used for is to steal someone's cookie, a text file that is created whenever you log in to any online service, like email. Cookies are restricted; they are only accessible when you are on the site that created it, for example when you log in to hotmail the cookie will stay and can be accessed from any site that is .msn.com, like the ilovemessenger.msn.com exploit. It's a pretty good security system, only trusted sites from the correct domain can access the cookie, which could potentially give the attacker access to the account. XSS can get around this though, like I said before, XSS can "inject" custom code, so you could add whatever malicious code you liked, so you can craft a url which will exploit the vulnerability, and will transmit the cookie to your own server, giving you access to their account, because it was stolen while they were still on the correct domain, the code just added stuff to the page and you were on a trusted page. Back to the exploit then, the one I found was from here:
http://seclists.org/lists/bugtraq/2006/Jan/0*25.html
It was from January, but from what I can tell it is still working (it is aol, what did you expect). I would have preferred a XSS from hotmail (because I use hotmail), but it's still a pretty big exploit, anyone reading this who uses or knows someone who uses aol has the ability to hack their account just by the target clicking one link from an email (you have to have a ftp server, get one for free), if someone spammed out this link you could hack *000s of accounts within days if the vulnerability isn't fixed. I do not have time to go through everything about this, I may do later though. The vulnerability exists in about 7 aol pages, listed on that link I gave you. To prove it works, go to this url:
http://aimtoday.aol.com/features/main_redesign.adp?fid=acct_linking"><script>alert('VULNERABLE')</script>
Copy the WHOLE link right up to the end of the page, copy and paste if necessary. That should bring up a popup of "VULNERABLE", if it does then it is still working and that means you can replace the simple "vulnerable" popup with a malicious cookie stealing script. If there's anyone who has an aol account reading this, sign in to your aol mail account, then when you are on your inbox in your browser type and go to this url:
http://aimtoday.aol.com/features/main_redesign.adp?fid=acct_linking"><script>alert(document.cookie)</script>
It should popup with your cookie data, this means that you can steal other people's cookies. I will post more on this later, like how to log stolen cookies to your website.