CyberSansar is one of the most visited websites in Nepal. Its popularity is due to its content which includes pictures of hot models. I haven't heard of another website with so many pictures of hot Nepali Females and in my guess, this website is a major attraction to a lot of Nepali males :-)
Level of Vulnerability 3/5
Review Of CyberSansar Website
Most of the webpages seem to take no arguments at all and strangely each link points to a specific named php file. All artists had artistname.php or Event informations were in event.php format.
This means the guys at CyberSansar must have a hell of a time managing all those .php files. My guess is that they have a centralized theming system and all pages use that theme.
To execute XSS, i had to find a page taking arguements. The download page was where i found it.
http://www.cybersansar.com/music/videos/music_videos.php and click on any picture takes you to say
Cross Site Scripting (XSS) in Detail
http://www.cybersansar.com/music/videos/video.php?id=drabyaz_dherailamo#download is interesting url. I can just change the text after ?id= in video.php?id=drabyaz_dherailamo#download to anything else, say xyz
ok this time what you get is a small picture not found image like this
looking at the source what you can see is
that means whatever you type after video.php?id=
if you test with characters like (", <,>,/, ...) all bypass any kind of string escaping. Not good at all. Someone forgot to check the security.
A simple ur like
will give you an alert message, humm scripts execute successfully.
To display some another webpage, its pretty simple just include a iframe like this
url starts from here ----------------------
http://www.cybersansar.com/music/videos/download_events_programs.php?id="><iframe src="http://www.google.com" height="400" width="500"><
url ends from here ---------------------
will give you this
Cool huh?? but how do i deface CyberSansar?
Actually you cannot do server damages using XSS, AFAIK
How can this be misused?
There are tons of articles explaining the misuse ofXSS, so please read them.
Some of the misuses i can think of are
- the google webpage is just an example, what if someone shows a porn site and tries to defame CyberSansar
- Include a fake phishing page with a username and password field saying "Insert your hotmail username/password here and we will send your frields a special something", humm interesting.
How to remove the XSS vulnerability in CyberSansar??
pretty simple, escape the passed id by using htmlspecialchars() function in php, very simple :-)
$id = htmlspecialchars($_GET['id']);
single line can work wonders. :-)
The admin of http://www.cybersansar.com has been emailed about this.
SO don't be surprised if this didn't work.
XSS Cheat Sheet at http://ha.ckers.org/xss.html
big thanks to them.