Friday, July 20, 2012

What is XSS ?


XSS stands for Cross-Site-Scripting. It is basically an attack, that is used to execute HTML and Javascript on the web-page. This attack can be done by submitting queries into text-boxes, or even into the URL. The results come back reading the text as HTML, so it executes the scripts instead of displaying them in plain text. With an XSS attack, you can steal cookies from a Web-Administrator, or even use some social-engineering to manipulate someone into download a virus that you've created. Such as a Botnet, or RAT, maybe even a Keylogger. XSS can be very dangerous, but can also be very mild. Most of my attacks are mild XSS attacks, that can be difficult to use against a website. There are many ways to use XSS to your advantage. I will name a few examples. You can use an alert box to advertise yourself, or alert the web-admin that you've discovered a security breach involving XSS. You can also setup a Cookie-Stealer/Logger.Anything you can do with HTML, can be used against a site with this attack. 

Demo : Find any vulnerable site which is prone to XSS attacks and input the below XSS scripts in the following input text box :-

1) Search Field .
2) Login text boxes.
3) Registration form Input fields .
4) Comment boxes.
5) Feedback form input fields.


 Basically in any web site in which you can find some char , numeric to enter there u can input XSS scripts.

There are various types of XSS :-


Non Persistant XSS :-


When it is executed it doesnt stay on the web page but on the client browser . its affect gets nullified when user refreshes the browser. Usually the mailicious user may sent the url to the other user with the xss getting executed on the web page . It is also called as Reflected XSS.


Example : -





Persistant XSS :-


Persistant XSS persists if the XSS script executed stays on the website everytime you visit the page or the area where you have injected the XSS script.It usually gets stored somewhere and everytime you visit the web page the script gets executed . in addition to it you could also steal or peep into valuable information . 


Example :- Consider a Web application that allows users to enter a user name which is displayed on each user’s profile page. The application stores each user name in a local database. A malicious user notices that the Web application fails to sanitize the user name field and inputs malicious JavaScript code as part of their user name. When other users view the attacker’s profile page, the malicious code automatically executes in the context of their session.






cross site scripting vulnerabilities and XSS
Xss scriptlets could be obtained fron the following links :-


http://ha.ckers.org/xss.html