What is Cross Site Scripting (XSS)?

Aug 20, 2016 | 10:00 am

Published by | Chandan Singh

xss

About Cross Site Scripting (XSS)

It’s a very common vulnerability found in Web Applications, ‘XSS’ allows the attacker to insert malicious code, generally there are many types of XSS attacks, I will mention 3 widely used XSS that allows an attacker to inject some malicious code into the applications damaged as a way to bypass access to the web site or to apply “phishing” on end users.
This technique is also used for website Cracking.

what is cross site scripting

Types of XSS:

  • DOM-Based XSS
  • Non-persistent XSS
  • Persistent XSS

DOM-Based XSS: The DOM-Based Cross-Site Scripting allows a attacker to attack on a machine not on victim website.

Following are the problems faced by victim’s local machine in the DOM-Based XSS:
– The attacker provides an impressive well build malicious website
– The ingenuous user starts that site
– The user has a susceptible page on his machine
– The attacker’s website sends malicious command to check the vulnerable HTML page
– The vulnerable local web page execute that malicious commands with the victim’s privileges on that machine.
– The attacker get access and control on the victim computer system.

Non-Persistent: The non-persistent XSS are in reality the most commons vulnerabilities that can be found on net. It is commonly named as “non-persistent”, since it works on an immediate HTTP response from the victim website.

With the help of non-persistent XSS the attacker has full privilege over victim’s page and thus attacker is in state to provide any data to victim’s page. This will help attacker to provide some malicious code and get it associated with server to execute it to obtain desired results.

The most typical application of this kind of vulnerabilities is to find websites which have search option. Attacker creates some malicious HTML code in the search text box and, if the website is vulnerable, the end result page will return the result of these HTML CODE entities.

Persistent: Persistent XSS and Non-Persistent XSS, both works on victim website and tries to get access users information’s but difference is, websites vulnerable too Persistent XSS the attacker doesn’t need to supply the crafted Url to you, because the website permits attacker to insert fixed data into the system.

Example is “guestbooks”. Generally, the users use that kind of tool to leave messages to the owner of the website including the first look but it doesn’t seem to something harmful or malicious, but if an attacker find that the computer system vulnerable, that can add some malicious code in attacker’s message and then all visitors will be a victim of that same vulnerability.

This works when the tool provided (guestbook) does not keep check on the content of the injected message. It just inserts the information provided from the user to the result web page.

 

Major threats with Cross Site Scripting (XSS)

  • End user accounts session hijacking (stealing cookies) or through get username and security password
  • The ability for attackers to track your browser and machine details (User Agents) and privacy.
  • Misuse of credentials and trust
  • Keystroke logging of your site visitors
  • The ability for assailants to exploit your visitor’s browser
  • Data theft
  • Website defacement and vandalism
  • Website link injections
  • Content theft