CS426Fall 2010/Lecture 361 Computer Security CS 426 Lecture 41 StuxNet, Cross Site Scripting & Cross Site Request Forgery.

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 Request Forgery (CSRF) Attacks
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.
Chapter 17: WEB COMPONENTS
©2009 Justin C. Klein Keane PHP Code Auditing Session 5 XSS & XSRF Justin C. Klein Keane
EECS 354 Network Security Cross Site Scripting (XSS)
CMSC 414 Computer and Network Security Lecture 24 Jonathan Katz.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
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.
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
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)
Security and JavaScript. Learning Objectives By the end of this lecture, you should be able to: – Describe what is meant by JavaScript’s same-origin security.
STUXNET. Summary What is Stuxnet? Industial Control Systems The target/s of Stuxnet. How Stuxnet spreads. The impact of Stuxnet on PLC’s.
 Discovered in June/July 2010  Targeted Siemens software and equipment running Microsoft Windows  First malware for SCADA systems to spy and subvert.
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
INTRODUCTION TO WEB DATABASE PROGRAMMING
Cookies Cross site scripting
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
A sophisticated Malware Arpit Singh CPSC 420
Copyright© 2002 Avaya Inc. All rights reserved Advanced Cross Site Scripting Evil XSS Anton Rager.
CSCD 303 Essential Computer Security Winter 2014 Lecture 12 – XSS, SQL Injection and CRSF Reading: See links - End of Slides.
Cross-Site Scripting Vulnerabilities Adam Doupé 11/24/2014.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Lecture 16. OWASP: The Open Web Application Security Project
Prevent Cross-Site Scripting (XSS) attack
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
1 All Your iFRAMEs Point to Us Mike Burry. 2 Drive-by downloads Malicious code (typically Javascript) Downloaded without user interaction (automatic),
Jonathan Baulch  A worm that spreads via USB drives  Exploits a previously unknown vulnerability in Windows  Trojan backdoor that looks for a specific.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
CS526Topic 8: Web Security Part 11 Information Security CS 526 Topic 8 Web Security Part 1.
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.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
3-Protecting Systems Dr. John P. Abraham Professor UTPA.
Hilton Giesenow Software Architect ConseQuent Software Development
1 Welcome to CSC 301 Web Programming Charles Frank.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
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.
Web Security SQL Injection, XSS, CSRF, Parameter Tampering, DoS Attacks, Session Hijacking SoftUni Team Technical Trainers Software University
CS526Topic 11: Web Security Part 11 Information Security CS 526 Topic 11 Web Security Part 1.
Lecture 16 Page 1 CS 236 Online Web Security CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
Stuxnet.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
CSRF Attacks Daniel Chen 11/18/15. What is CSRF?  Cross Site Request Forgery (Sea-Surf)  AKA XSRF/ One Click / Sidejacking / Session Riding  Exploits.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
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.
Computer & Network Security
Web Programming Language
Javascript worms By Benjamin Mossé SecPro
Scripting - Client-side vs. Server-side Scripting
World Wide Web policy.
AJAX.
AJAX.
Database Driven Websites
Riding Someone Else’s Wave with CSRF
CSC 495/583 Topics of Software Security Intro to Web Security
JavaScript.
Advanced Cross Site Scripting Evil XSS
Exploring DOM-Based Cross Site Attacks
Security and JavaScript
Cross-Site Scripting Attack (XSS)
Cross Site Request Forgery (CSRF)
Presentation transcript:

CS426Fall 2010/Lecture 361 Computer Security CS 426 Lecture 41 StuxNet, Cross Site Scripting & Cross Site Request Forgery

StuxNet: Overview Windows-based Worm First reported in June 2010, the general public aware of it only in July 2010 –Have existed a year or more before being discovered –Updated several times Written to attack systems used to control and monitor industrial processes. –built by German firm Siemens. Seems to be a digital weapon –60% (more than 62 thousand) of infected computers in Iran –Iran confirmed that nuclear program damaged by Stuxnet Origin is unknown, but conjectures exist CS426Fall 2010/Lecture 362

What StuxNet Does Its final goal is to reprogram industrial control systems (ICS) by modifying code on programmable logic controllers (PLCs) to make them work in a manner the attacker intended and to hide those changes from the operator of the equipment. Attacking three targets –Windows operating system –Siemens SIMATIC WinCC/Step 7 software that controls the PLCs –Siemons PLCs CS426Fall 2010/Lecture 363

Highlights Exploit four zero-day attacks –Zero-day exploit computer application vulnerabilities that are unknown to others or undisclosed to the software developer.computer applicationvulnerabilities Use stolen private key to sign rootkit drivers Code size: half a megabyte Written in multiple languages Updated over at least one year Likely by a nation-state. CS426Fall 2010/Lecture 364

How It Propagates? Use USB drive to get on computers in closed networks –Exploit “Microsoft Windows Shortcut ‘LNK/PIF’ Files Automatic File Execution Vulnerability” Spread through local network through multiple methods –Exploit vulnerability in Windows Print Spooler –Exploit vulnerability in Windows Server Service (same as conficker worm) –Copy and execute itself through network shares Exploit two zero-day vulnerabilities for privilege escalation attacks on local computers Install a kernel rootkit on the computer –Kernel rootkite as device drivers digitally signed with stolen private keys from JMicron and Realtek.JMicronRealtek CS426Fall 2010/Lecture 365

How It Propagates? Copy itself into the control software Step 7 and make it loaded when the app starts Modify code on Siemons PLCs and hide its presence (rootkit for PLC) Use two websites for updates and information storage Also perform peer-to-peer updating CS426Fall 2010/Lecture 366

Cross Site Scripting CS426Fall 2010/Lecture 367

Browser and Network Browser Network Browser sends requests Browser receives information, code Interaction susceptible to network attacks OS Hardware Web site request reply

Client Side Scripting Web pages (HTML) can embed dynamic contents (code) that can executed on the browser JavaScript –embedded in web pages and executed inside browser VBScript –similar to JavaScript, only for Windows Java applets –small pieces of Java bytecodes that execute in browsers

HTML and Scripting … var num1, num2, sum num1 = prompt("Enter first number") num2 = prompt("Enter second number") sum = parseInt(num1) + parseInt(num2) alert("Sum = " + sum) … Browser receives content, displays HTML and executes scripts

Scripts are Powerful Client-side scripting is powerful and flexible –host access read / write local files –webpage resources cookies Domain Object Model (DOM) objects –steal private information –control what users see –impersonate the user

Same Origin Policy The basic security model enforced in the browser Web users visits multiple websites simultaneously SoP isolates the scripts and resources downloaded from different origin –bank.com vs. evil.org Origin = domain name + protocol + port –all three must be equal for origin to be considered the same

Same Original Policy: What it Controls Same-origin policy applies to the following accesses: –manipulating browser windows –URLs requested via the XmlHttpRequest XmlHttpRequest is an API that can be used by web browser scripting languages to transfer XML and other text data to and from a web server using HTTP, by establishing an independent and asynchronous communication channel. –used by AJAX –manipulating frames (including inline frames) –manipulating documents (included using the object tag) –manipulating cookies

Problems with S-O Principle Poorly enforced on some browsers –Particularly older browsers Limitations if site hosts unrelated pages –Example: Web server often hosts sites for unrelated parties –Same-origin policy, allows script on one page to access properties of document from another Can be bypassed in Cross-Site-Scripting attacks

Cross Site Scripting (XSS) Recall the basics –scripts embedded in web pages run in browsers –scripts can access cookies get private information –and manipulate DOM objects controls what users see –scripts controlled by the same-origin policy Why would XSS occur –Web applications often take user inputs and use them as part of webpage (these inputs can have scripts)

How XSS Works on Online Blog Everyone can post comments, which will be displayed to everyone who view the post Attacker posts a malicious comment that includes scripts (which reads local authentication credentials and send of to the attacker) Anyone who view the post can have local authentication cookies stolen Web apps will check that posts do not include scripts, but the check sometimes fail. Bug in the web application. Attack happens in browser. CS426Fall 2010/Lecture 3616

Effect of the Attack Attacker can execute arbitrary scripts in browser Can manipulate any DOM component on victim.com –Control links on page –Control form fields (e.g. password field) on this page and linked pages. Can infect other users: MySpace.com worm.

MySpace.com (Samy worm) Users can post HTML on their pages –MySpace.com ensures HTML contains no,, onclick, –However, attacker find out that a way to include Javascript within CSS tags: And can hide “javascript” as “java\nscript” With careful javascript hacking: –Samy’s worm: infects anyone who visits an infected MySpace page … and adds Samy as a friend. –Samy had millions of friends within 24 hours. More info:

Avoiding XSS bugs (PHP) Main problem: –Input checking is difficult --- many ways to inject scripts into HTML. Preprocess input from user before echoing it PHP: htmlspecialchars(string) &  & "  " '  '  > –htmlspecialchars( " Test ", ENT_QUOTES ); Outputs: <a href='test'>Test</a>

Avoiding XSS bugs (ASP.NET) ASP.NET 1.1: –Server.HtmlEncode(string) Similar to PHP htmlspecialchars –validateRequest: (on by default) Crashes page if finds in POST data. Looks for hardcoded list of patterns. Can be disabled:

CS526Fall 2008/Lecture 3121 Cross site request forgery

Cross site request forgery (abbrev. CSRF or XSRF) Also known as one click attack or session riding Transmits unauthorized commands from a user who has logged in to a website to the website.

CSRF Explained Example: –User logs in to bank.com. Forgets to sign off. –Session cookie remains in browser state –Then user visits another site containing: … document.F.submit(); –Browser sends user auth cookie with request Transaction will be fulfilled Problem: –browser is a confused deputy

GMail Incidence: Jan 2007 Google docs has a script that run a callback function, passing it your contact list as an object. The script presumably checks a cookie to ensure you are logged into a Google account before handing over the list. Unfortunately, it doesn’t check what page is making the request. So, if you are logged in on window 1, window 2 (an evil site) can make the function call and get the contact list as an object. Since you are logged in somewhere, your cookie is valid and the request goes through.

Real World CSRF Vulnerabilities Gmail NY Times ING Direct (4 th largest saving bank in US) YouTube Various DSL Routers Purdue WebMail PEFCU Purdue CS Portal …

Prevention Server side: –use cookie + hidden fields to authenticate hidden fields values need to be unpredictable and user- specific –requires the body of the POST request to contain cookies User side: –logging off one site before using others –selective sending of authentication tokens with requests

CS426Fall 2010/Lecture 3627 Coming Attractions … Final Exam