Computer Security CS 426 Lecture 41

Similar documents
Information Security CS 526 Topic 8

Information Security CS 526 Topic 11

CS526: Information security

CIS 5373 Systems Security

Computer and Network Security

Lecture 17 Browser Security. Stephen Checkoway University of Illinois at Chicago CS 487 Fall 2017 Some slides from Bailey's ECE 422

Web Security II. Slides from M. Hicks, University of Maryland

Is Browsing Safe? Web Browser Security. Subverting the Browser. Browser Security Model. XSS / Script Injection. 1. XSS / Script Injection

CIS 551 / TCOM 401 Computer and Network Security. Spring 2008 Lecture 24

Web Security: XSS; Sessions

Web basics: HTTP cookies

CS 142 Winter Session Management. Dan Boneh

Web Application Security. Philippe Bogaerts

Web basics: HTTP cookies

How is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach

P2_L12 Web Security Page 1

WEB SECURITY: XSS & CSRF

CSCD 303 Essential Computer Security Fall 2018

Web 2.0 and AJAX Security. OWASP Montgomery. August 21 st, 2007

2/16/18. CYSE 411/AIT 681 Secure Software Engineering. Secure Coding. The Web. Topic #11. Web Security. Instructor: Dr. Kun Sun

CSCD 303 Essential Computer Security Fall 2017

RKN 2015 Application Layer Short Summary

Web Application with AJAX. Kateb, Faris; Ahmed, Mohammed; Alzahrani, Omar. University of Colorado, Colorado Springs

2/16/18. Secure Coding. CYSE 411/AIT 681 Secure Software Engineering. Web Security Outline. The Web. The Web, Basically.

Web Security, Part 2

Web Attacks, con t. CS 161: Computer Security. Prof. Vern Paxson. TAs: Devdatta Akhawe, Mobin Javed & Matthias Vallentin

Web Security Part 2. Professor Ristenpart h9p:// rist at cs dot wisc dot edu

Application Layer Attacks. Application Layer Attacks. Application Layer. Application Layer. Internet Protocols. Application Layer.

CIS 4360 Secure Computer Systems XSS

Common Websites Security Issues. Ziv Perry

CSC 482/582: Computer Security. Cross-Site Security

XSS and CSRF Nov 6, 2018

Web Application Security

PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH

Security for the Web. Thanks to Dave Levin for some slides

Application vulnerabilities and defences

Security for the Web. Thanks to Dave Levin for some slides

COMP9321 Web Application Engineering

Web Application Security

CSC 405 Computer Security. Web Security

s642 web security computer security adam everspaugh

Security. CSC309 TA: Sukwon Oh

Presented By Rick Deacon DEFCON 15 August 3-5, 2007

Chrome Extension Security Architecture

Attacks Against Websites. Tom Chothia Computer Security, Lecture 11

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14

Web Application Penetration Testing

PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH

Advanced Web Technology 10) XSS, CSRF and SQL Injection

Web Security: Web Application Security [continued]

INF3700 Informasjonsteknologi og samfunn. Application Security. Audun Jøsang University of Oslo Spring 2015

7.2.4 on Media content; on XSS) sws2 1


Web Security Part 2. Professor Ristenpart h9p:// rist at cs dot wisc dot edu

Application Security through a Hacker s Eyes James Walden Northern Kentucky University

Hacking Intranet Websites from the Outside

Computer Security 3e. Dieter Gollmann. Chapter 18: 1

Web Application Security

OWASP Top 10 Risks. Many thanks to Dave Wichers & OWASP

Web Security: Vulnerabilities & Attacks

Web Application Vulnerabilities: OWASP Top 10 Revisited

Copyright

WHY CSRF WORKS. Implicit authentication by Web browsers

GOING WHERE NO WAFS HAVE GONE BEFORE

Some Facts Web 2.0/Ajax Security

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang

Project 3 Web Security Part 1. Outline

Cross-Site Request Forgery: The Sleeping Giant. Jeremiah Grossman Founder and CTO, WhiteHat Security

XSS Homework. 1 Overview. 2 Lab Environment

Web 2.0 Attacks Explained

Web Security IV: Cross-Site Attacks

GUI based and very easy to use, no security expertise required. Reporting in both HTML and RTF formats - Click here to view the sample report.

LECT 8 WEB SECURITY BROWSER SECURITY. Repetition Lect 7. WEB Security

CSE 484 / CSE M 584: Computer Security and Privacy. Web Security. Autumn Tadayoshi (Yoshi) Kohno

Web Security. Aggelos Kiayias Justin Neumann

Web Security: Vulnerabilities & Attacks

CNIT 129S: Securing Web Applications. Ch 10: Attacking Back-End Components

Web Security. Thierry Sans

Cross-Site Scripting (XSS) Professor Larry Heimann Web Application Security Information Systems

Secure Coding and Code Review. Berlin : 2012

Top 10 AJAX security holes & driving factors

CS 161 Computer Security

Certified Secure Web Application Engineer

More attacks on clients: Click-jacking/UI redressing, CSRF

CS 161 Computer Security


COMP9321 Web Application Engineering

Code-Injection Attacks in Browsers Supporting Policies. Elias Athanasopoulos, Vasilis Pappas, and Evangelos P. Markatos FORTH-ICS

Web 2.0 and Security

Web Security: Web Application Security [continued]

Facebook API Breach. Jake Williams Rendition Infosec

CS 161 Computer Security

EasyCrypt passes an independent security audit

User Interaction: jquery

Solutions Business Manager Web Application Security Assessment

Hackveda Training - Ethical Hacking, Networking & Security

Web Security, Summer Term 2012

CS 155 Project 2. Overview & Part A

Web Security, Summer Term 2012

Attacking Web2.0. Daiki Fukumori Secure Sky Technology Inc.

Transcription:

Computer Security CS 426 Lecture 41 StuxNet, Cross Site Scripting & Cross Site Request Forgery CS426 Fall 2010/Lecture 36 1

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 Oi Origin i is unknown, but conjectures exist CS426 Fall 2010/Lecture 36 2

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 CS426 Fall 2010/Lecture 36 3

Highlights g Exploit four zero-day attacks Zero-day exploit computer application vulnerabilities that are unknown to others or undisclosed to the software developer. 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. CS426 Fall 2010/Lecture 36 4

How It Propagates? pg 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. CS426 Fall 2010/Lecture 36 5

How It Propagates? pg 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 CS426 Fall 2010/Lecture 36 6

Cross Site Scripting CS426 Fall 2010/Lecture 36 7

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

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 <html> Browser receives content, displays HTML and executes scripts <P> <script> var num1, num2, sum num1 = prompt("enter first number") num2 = prompt("enter t second number") sum = parseint(num1) + parseint(num2) alert("sum = " + sum) </script> </html>

Scripts are Powerful Client-side id 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 http://www.example.com/account/ http://www.example.com/otheraccount/ 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 i 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. CS426 Fall 2010/Lecture 36 16

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 <script>, <body>, onclick, <a href=javascript://> However, attacker find out that a way to include Javascript within CSS tags: <div style= background:url( javascript:alert(1) ) > 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: http://namb.la/popular/tech.html

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) & & " " ' &#039; < < > > htmlspecialchars( "<a href='test'>test</a>", ENT_QUOTES); Outputs: <a href=&#039;test&#039;>test</a>

Avoiding XSS bugs (ASP.NET) ASP.NET 1.1: 1 Server.HtmlEncode(string) Similar to PHP htmlspecialchars validaterequest: (on by default) Crashes page if finds <script> in POST data. Looks for hardcoded list of patterns. Can be disabled: <%@ Page validaterequest= false" %>

Cross site request forgery CS526 Fall 2008/Lecture 31 21

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: <form name=f action=http://bank.com/billpay.php> <input name=recipient value=badguy> <script> document.f.submit(); </script> 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 userspecific 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

Coming Attractions Final Exam CS426 Fall 2010/Lecture 36 27