SlideShare a Scribd company logo
1 of 20
Injection attacks
CROSS SITE SCRIPTING
(XSS) ATTACKS
06/21/19 1
Whoami
• Adam Nurudini
CEH, ITIL V3, CCNA, CCNP, CASP, PCI-DSS..
Lead Security Researcher @ Netwatch Technologies
Project Consultant, Information Security Architects Ltd
Member, Cybersecurity Resilience Service Team
President – GIMPA School Of Technology Student Association
Black Hat Attendee
06/21/19 2
DISCLAIMER
Any Views or opinions presented in this presentation are solely mine and do not
necessarily represent my employer.
I am not a lawyer or giving you legal advice
I am not giving you permission or authorizing you to do anything ever.
In fact don't do anything ever .
06/21/19 3
06/21/19 4
• What is Cross-site Scripting
• Different types of Cross-Site Scripting
• Impact of Cross-Site Scripting
• Ways to identify XSS vulnerabilities
• Preventing Cross-Site Scripting attacks
TakeAways
06/21/19 5
What is XSS
Cross site scripting (XSS) is a common attack vector that injects
malicious code into a vulnerable web application.
XSS differs from other web attack vectors (e.g., SQL injections), in that
it does not directly target the application itself. Instead, the users of the
web application are the ones at risk.
A successful cross site scripting attack can have devastating
consequences for an online business’s reputation and its relationship with
its clients.
06/21/19 6
What is XSS
06/21/19 7
Types of XSS
There are mainly three different types of Cross-site Scripting vulnerability;
•Reflected XSS
A reflected XSS vulnerability happens when the user input from a URL or
POST data is reflected on the page without being stored.
•Persistent or Stored XSS
Stored Cross-site scripting vulnerabilities happens when the payload is saved,
for example in a database and then is executed when a user opens the page.
Stored cross-site scripting is very dangerous for a number of reasons
•DOM-based XSS
The DOM Based XSS vulnerability happens in the DOM (Document Object
Model) instead of part of the HTML.
06/21/19 8
Types of XSS
For years, most people thought of these (Stored, Reflected, DOM) as
three different types of XSS, but in reality, they overlap. You can have
both Stored and Reflected DOM Based XSS.
You can also have Stored and Reflected Non-DOM Based XSS too, but
that’s confusing, so to help clarify things, starting about mid 2012, the
research community proposed and started using two new terms to help
organize the types of XSS that can occur:
1. Server XSS
2. Client XSS
06/21/19 9
Server XSS
06/21/19 10
Client XSS
06/21/19 11
Impact of XSS
06/21/19 12
The impact of an exploited XSS vulnerability varies a lot. It ranges from
• Redirection
• Session Hijacking
• Cross Site Request forgery
• Keylogging
• Phishing
By exploiting a cross-site scripting vulnerability an attacker can
impersonate the victim and take over the account. If the victim has
administrative rights it might even lead to code execution on the server,
depending on the application and the privileges of the account
Ways to identify & verify XSS vulnerabilities
06/21/19 13
Cross-site Scripting vulnerabilities can be identified in 2 ways namely;
• Static Analysis (Source code review)
• Dynamic analysis (Fuzzing)
Static Analysis Tools
• OWASP WAP - Web Application Protection Project
• RIPS - A static source code analyser
• Codacy: Automated code reviews & code analytics
Dynamic Analysis Tools
• Burp suite
• Hack bar Firefox addon or burp addon
• Automated vulnerability scanner (eg. Arachni)
Brace your self demo is starting
Everybody is interested in something06/21/19 14
Preventing Cross-Site Scripting
06/21/19 15
• Never trust user input
• Never trust user input
• Never trust user input
• Never trust user input
• Never trust user input
• Never trust user input
• Never trust user input
• Never trust user input
• Never trust user input
Prevention?
Preventing Cross-Site Scripting
06/21/19 16
Recall that an XSS attack is a type of code injection: user input is
mistakenly interpreted as malicious program code. In order to prevent
this type of code injection, secure input handling is needed. For a web
developer, there are two fundamentally different ways of performing
secure input handling:
• Encoding, which escapes the user input so that the browser interprets it only
as data, not as code.
• Validation, which filters the user input so that the browser interprets it as
code without malicious commands.
Preventing XSS - Encoding
06/21/19 17
Encoding is the act of escaping user input so that the browser interprets it
only as data, not as code. The following pseudocode is an example of how
user input could be encoded using HTML escaping
If the user input were the string <script>...</script>, the resulting HTML would be as follows
Preventing XSS - Validating
06/21/19 18
Validation is the act of filtering user input so that all malicious parts of it
are removed, without necessarily removing all code in it. One of the most
recognizable types of validation in web development is allowing some
HTML elements (such as <em> and <strong>) but disallowing others
(such as <script>).
There are two main characteristics of validation that differ between
implementations:
Classification strategy: User input can be classified using either
blacklisting or whitelisting.
Validation outcome: User input identified as malicious can either be
rejected or sanitised.
XSS is not the user’s problem like any other security
vulnerability. If it is affecting your users, it affects you.
I hope that you found this talk useful
References
https://www.netsparker.com
https://www.acunetix.com
https://excess-xss.com/
https://www.incapsula.com
https://www.owasp.org
https://www.google.com
06/21/19 19
Thank You
Questions & Answers
Lets connect
Twitter: @Bra__Qwesi
Email: adam.nurudini at gmail dot com
06/21/19 20

More Related Content

Similar to Cross Site scripting Attacks - by Adam Nurudini

A Survey of Exploitation and Detection Methods of XSS Vulnerabilities.pptx
A Survey of Exploitation and Detection Methods of XSS Vulnerabilities.pptxA Survey of Exploitation and Detection Methods of XSS Vulnerabilities.pptx
A Survey of Exploitation and Detection Methods of XSS Vulnerabilities.pptxGitam Gadtaula
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionVishal Kumar
 
HallTumserFinalPaper
HallTumserFinalPaperHallTumserFinalPaper
HallTumserFinalPaperDaniel Tumser
 
Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Nabin Dutta
 
Web Vulnerabilities And Exploitation - Compromising The Web
Web Vulnerabilities And Exploitation - Compromising The WebWeb Vulnerabilities And Exploitation - Compromising The Web
Web Vulnerabilities And Exploitation - Compromising The WebZero Science Lab
 
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...IRJET Journal
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)Ritesh Gupta
 
The Cross Site Scripting Guide
The Cross Site Scripting GuideThe Cross Site Scripting Guide
The Cross Site Scripting GuideDaisuke_Dan
 
Web security landscape Unit 3 part 2
Web security landscape Unit 3 part 2Web security landscape Unit 3 part 2
Web security landscape Unit 3 part 2SURBHI SAROHA
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Ikhade Maro Igbape
 
Security testing for web developers
Security testing for web developersSecurity testing for web developers
Security testing for web developersmatthewhughes
 
What is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgetsWhat is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgetsZiv Ginsberg
 
React security vulnerabilities
React security vulnerabilitiesReact security vulnerabilities
React security vulnerabilitiesAngelinaJasper
 
Tracing out Cross Site Scripting Vulnerabilities in Modern Scripts
Tracing out Cross Site Scripting Vulnerabilities in Modern ScriptsTracing out Cross Site Scripting Vulnerabilities in Modern Scripts
Tracing out Cross Site Scripting Vulnerabilities in Modern ScriptsEswar Publications
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Jay Nagar
 
Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site ScriptingAli Mattash
 
Study of Cross-Site Scripting Attacks and Their Countermeasures
Study of Cross-Site Scripting Attacks and Their CountermeasuresStudy of Cross-Site Scripting Attacks and Their Countermeasures
Study of Cross-Site Scripting Attacks and Their CountermeasuresEditor IJCATR
 

Similar to Cross Site scripting Attacks - by Adam Nurudini (20)

A Survey of Exploitation and Detection Methods of XSS Vulnerabilities.pptx
A Survey of Exploitation and Detection Methods of XSS Vulnerabilities.pptxA Survey of Exploitation and Detection Methods of XSS Vulnerabilities.pptx
A Survey of Exploitation and Detection Methods of XSS Vulnerabilities.pptx
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL Injection
 
HallTumserFinalPaper
HallTumserFinalPaperHallTumserFinalPaper
HallTumserFinalPaper
 
Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)
 
Web Vulnerabilities And Exploitation - Compromising The Web
Web Vulnerabilities And Exploitation - Compromising The WebWeb Vulnerabilities And Exploitation - Compromising The Web
Web Vulnerabilities And Exploitation - Compromising The Web
 
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
 
Xss
XssXss
Xss
 
Xss ppt
Xss pptXss ppt
Xss ppt
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
The Cross Site Scripting Guide
The Cross Site Scripting GuideThe Cross Site Scripting Guide
The Cross Site Scripting Guide
 
Web security landscape Unit 3 part 2
Web security landscape Unit 3 part 2Web security landscape Unit 3 part 2
Web security landscape Unit 3 part 2
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation
 
Security testing for web developers
Security testing for web developersSecurity testing for web developers
Security testing for web developers
 
What is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgetsWhat is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgets
 
React security vulnerabilities
React security vulnerabilitiesReact security vulnerabilities
React security vulnerabilities
 
Tracing out Cross Site Scripting Vulnerabilities in Modern Scripts
Tracing out Cross Site Scripting Vulnerabilities in Modern ScriptsTracing out Cross Site Scripting Vulnerabilities in Modern Scripts
Tracing out Cross Site Scripting Vulnerabilities in Modern Scripts
 
Web hack & attacks
Web hack & attacksWeb hack & attacks
Web hack & attacks
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )
 
Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site Scripting
 
Study of Cross-Site Scripting Attacks and Their Countermeasures
Study of Cross-Site Scripting Attacks and Their CountermeasuresStudy of Cross-Site Scripting Attacks and Their Countermeasures
Study of Cross-Site Scripting Attacks and Their Countermeasures
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
#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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
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
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"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...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 

Cross Site scripting Attacks - by Adam Nurudini

  • 1. Injection attacks CROSS SITE SCRIPTING (XSS) ATTACKS 06/21/19 1
  • 2. Whoami • Adam Nurudini CEH, ITIL V3, CCNA, CCNP, CASP, PCI-DSS.. Lead Security Researcher @ Netwatch Technologies Project Consultant, Information Security Architects Ltd Member, Cybersecurity Resilience Service Team President – GIMPA School Of Technology Student Association Black Hat Attendee 06/21/19 2
  • 3. DISCLAIMER Any Views or opinions presented in this presentation are solely mine and do not necessarily represent my employer. I am not a lawyer or giving you legal advice I am not giving you permission or authorizing you to do anything ever. In fact don't do anything ever . 06/21/19 3
  • 5. • What is Cross-site Scripting • Different types of Cross-Site Scripting • Impact of Cross-Site Scripting • Ways to identify XSS vulnerabilities • Preventing Cross-Site Scripting attacks TakeAways 06/21/19 5
  • 6. What is XSS Cross site scripting (XSS) is a common attack vector that injects malicious code into a vulnerable web application. XSS differs from other web attack vectors (e.g., SQL injections), in that it does not directly target the application itself. Instead, the users of the web application are the ones at risk. A successful cross site scripting attack can have devastating consequences for an online business’s reputation and its relationship with its clients. 06/21/19 6
  • 8. Types of XSS There are mainly three different types of Cross-site Scripting vulnerability; •Reflected XSS A reflected XSS vulnerability happens when the user input from a URL or POST data is reflected on the page without being stored. •Persistent or Stored XSS Stored Cross-site scripting vulnerabilities happens when the payload is saved, for example in a database and then is executed when a user opens the page. Stored cross-site scripting is very dangerous for a number of reasons •DOM-based XSS The DOM Based XSS vulnerability happens in the DOM (Document Object Model) instead of part of the HTML. 06/21/19 8
  • 9. Types of XSS For years, most people thought of these (Stored, Reflected, DOM) as three different types of XSS, but in reality, they overlap. You can have both Stored and Reflected DOM Based XSS. You can also have Stored and Reflected Non-DOM Based XSS too, but that’s confusing, so to help clarify things, starting about mid 2012, the research community proposed and started using two new terms to help organize the types of XSS that can occur: 1. Server XSS 2. Client XSS 06/21/19 9
  • 12. Impact of XSS 06/21/19 12 The impact of an exploited XSS vulnerability varies a lot. It ranges from • Redirection • Session Hijacking • Cross Site Request forgery • Keylogging • Phishing By exploiting a cross-site scripting vulnerability an attacker can impersonate the victim and take over the account. If the victim has administrative rights it might even lead to code execution on the server, depending on the application and the privileges of the account
  • 13. Ways to identify & verify XSS vulnerabilities 06/21/19 13 Cross-site Scripting vulnerabilities can be identified in 2 ways namely; • Static Analysis (Source code review) • Dynamic analysis (Fuzzing) Static Analysis Tools • OWASP WAP - Web Application Protection Project • RIPS - A static source code analyser • Codacy: Automated code reviews & code analytics Dynamic Analysis Tools • Burp suite • Hack bar Firefox addon or burp addon • Automated vulnerability scanner (eg. Arachni)
  • 14. Brace your self demo is starting Everybody is interested in something06/21/19 14
  • 15. Preventing Cross-Site Scripting 06/21/19 15 • Never trust user input • Never trust user input • Never trust user input • Never trust user input • Never trust user input • Never trust user input • Never trust user input • Never trust user input • Never trust user input Prevention?
  • 16. Preventing Cross-Site Scripting 06/21/19 16 Recall that an XSS attack is a type of code injection: user input is mistakenly interpreted as malicious program code. In order to prevent this type of code injection, secure input handling is needed. For a web developer, there are two fundamentally different ways of performing secure input handling: • Encoding, which escapes the user input so that the browser interprets it only as data, not as code. • Validation, which filters the user input so that the browser interprets it as code without malicious commands.
  • 17. Preventing XSS - Encoding 06/21/19 17 Encoding is the act of escaping user input so that the browser interprets it only as data, not as code. The following pseudocode is an example of how user input could be encoded using HTML escaping If the user input were the string <script>...</script>, the resulting HTML would be as follows
  • 18. Preventing XSS - Validating 06/21/19 18 Validation is the act of filtering user input so that all malicious parts of it are removed, without necessarily removing all code in it. One of the most recognizable types of validation in web development is allowing some HTML elements (such as <em> and <strong>) but disallowing others (such as <script>). There are two main characteristics of validation that differ between implementations: Classification strategy: User input can be classified using either blacklisting or whitelisting. Validation outcome: User input identified as malicious can either be rejected or sanitised.
  • 19. XSS is not the user’s problem like any other security vulnerability. If it is affecting your users, it affects you. I hope that you found this talk useful References https://www.netsparker.com https://www.acunetix.com https://excess-xss.com/ https://www.incapsula.com https://www.owasp.org https://www.google.com 06/21/19 19
  • 20. Thank You Questions & Answers Lets connect Twitter: @Bra__Qwesi Email: adam.nurudini at gmail dot com 06/21/19 20