Applications. Cloud. See voting example (DC Internet voting pilot) Select * from userinfo WHERE id = %%% (variable)

Similar documents
CS 161 Computer Security

Memory Safety (cont d) Software Security

Exploiting Stack Buffer Overflows Learning how blackhats smash the stack for fun and profit so we can prevent it

Module: Return-oriented Programming. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

Hacking Blind BROP. Presented by: Brooke Stinnett. Article written by: Andrea Bittau, Adam Belay, Ali Mashtizadeh, David Mazie`res, Dan Boneh

Why bother? Default configurations Buffer overflows Authentication mechanisms Reverse engineering Questions?

Remix: On-demand Live Randomization

Software Security II: Memory Errors - Attacks & Defenses

CSC 591 Systems Attacks and Defenses Stack Canaries & ASLR

Writing your first windows exploit in less than one hour

CS 161 Computer Security

Software Security: Buffer Overflow Defenses

ECS 153 Discussion Section. April 6, 2015

Cyber Moving Targets. Yashar Dehkan Asl

Is Exploitation Over? Bypassing Memory Protections in Windows 7

Why bother? Default configurations Buffer overflows Authentication mechanisms Reverse engineering Questions?

Software Security: Buffer Overflow Attacks

ECE 471 Embedded Systems Lecture 22

Simple Overflow. #include <stdio.h> int main(void){ unsigned int num = 0xffffffff;

Malware

Inline Reference Monitoring Techniques

Writing Exploits. Nethemba s.r.o.

Robust Shell Code Return Oriented Programming and HeapSpray. Zhiqiang Lin

Defeat Exploit Mitigation Heap Attacks. compass-security.com 1

CSCE 548 Building Secure Software Buffer Overflow. Professor Lisa Luo Spring 2018

This time. Defenses and other memory safety vulnerabilities. Everything you ve always wanted to know about gdb but were too afraid to ask

Lecture 10 Code Reuse

CS161 Midterm 1 Review

Lecture 1: Buffer Overflows

Beyond Stack Smashing: Recent Advances in Exploiting. Jonathan Pincus(MSR) and Brandon Baker (MS)

CSE 127: Computer Security Control Flow Hijacking. Kirill Levchenko

Module: Return-oriented Programming. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

Leveraging CVE for ASLR Bypass & RCE. Gal De Leon & Nadav Markus

CSE 127: Computer Security. Memory Integrity. Kirill Levchenko

CS 161 Computer Security

ENEE 457: Computer Systems Security. Lecture 16 Buffer Overflow Attacks

Module: Program Vulnerabilities. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

Stack Vulnerabilities. CS4379/5375 System Security Assurance Dr. Jaime C. Acosta

Secure Software Development: Theory and Practice

Smashing the Buffer. Miroslav Štampar

CSE 127 Computer Security

How to Sandbox IIS Automatically without 0 False Positive and Negative

Module: Program Vulnerabilities. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

Survey of Cyber Moving Targets. Presented By Sharani Sankaran

String Oriented Programming Exploring Format String Attacks. Mathias Payer

SoK: Eternal War in Memory

CMSC 414 Computer and Network Security

CSE 509: Computer Security

Outline. Memory Exploit

Secure Systems 2.0: Revisiting and Rethinking the Challenges of Secure System Design. Todd Austin University of Michigan

CSCE 548 Building Secure Software Integers & Integer-related Attacks & Format String Attacks. Professor Lisa Luo Spring 2018

Play with FILE Structure Yet Another Binary Exploitation Technique. Abstract

Advanced Systems Security: Program Diversity

Bypassing Browser Memory Protections

Software Security: Buffer Overflow Defenses and Miscellaneous

Module: Program Vulnerabilities. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

Identifying Memory Corruption Bugs with Compiler Instrumentations. 이병영 ( 조지아공과대학교

Other array problems. Integer overflow. Outline. Integer overflow example. Signed and unsigned

logistics: ROP assignment

finding vulnerabilities

20: Exploits and Containment

IoT The gift that keeps on giving

Exploits and gdb. Tutorial 5

Return-orientated Programming

Countermeasures in Modern Operating Systems. Yves Younan, Vulnerability Research Team (VRT)

Q: Exploit Hardening Made Easy

CSE 227 Computer Security Spring 2010 S f o t ftware D f e enses I Ste St f e an f Sa v Sa a v g a e g

One-Slide Summary. Lecture Outline. Language Security

Advanced Buffer Overflow

Lecture 4: Threats CS /5/2018

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

CS 161 Computer Security

CSC 405 Computer Security Stack Canaries & ASLR

Software Vulnerabilities August 31, 2011 / CS261 Computer Security

EXPLOITING BUFFER OVERFLOWS ON MIPS ARCHITECTURES

Patching Exploits with Duct Tape: Bypassing Mitigations and Backward Steps

Digital Forensics Lecture 02 PDF Structure

Analysis/Bug-finding/Verification for Security

Runtime Defenses against Memory Corruption

Betriebssysteme und Sicherheit Sicherheit. Buffer Overflows

COMP3441 Lecture 7: Software Vulnerabilities

Lecture Notes for 04/04/06: UNTRUSTED CODE Fatima Zarinni.

Security Workshop HTS. LSE Team. February 3rd, 2016 EPITA / 40

PRACTICAL CONTROL FLOW INTEGRITY & RANDOMIZATION FOR BINARY EXECUTABLES

Taintscope: A Checksum-Aware Directed Fuzzing Tool for Automatic Software Vulnerability Detection

Vulnerability Analysis I:

It was a dark and stormy night. Seriously. There was a rain storm in Wisconsin, and the line noise dialing into the Unix machines was bad enough to

Lecture 4 September Required reading materials for this class

CSE 565 Computer Security Fall 2018

Software security, secure programming

Advanced Buffer Overflow

Software Security: Buffer Overflow Attacks (continued)

BUFFER OVERFLOW DEFENSES & COUNTERMEASURES

Return-Oriented Rootkits

1358 IEEE TRANSACTIONS ON COMPUTER-AIDED DESIGN OF INTEGRATED CIRCUITS AND SYSTEMS, VOL. 37, NO. 7, JULY 2018

Security and Exploit Mitigation. CMSC Spring 2016 Lawrence Sebald

Undermining Information Hiding (And What to do About it)

Bypassing Mitigations by Attacking JIT Server in Microsoft Edge

Hacking Blind. Andrea Bittau, Adam Belay, Ali Mashtizadeh, David Mazières, Dan Boneh. Stanford University

System Security Class Notes 09/23/2013

Transcription:

Software Security Requirements General Methodologies Hardware Firmware Software Protocols Procedure s Applications OS Cloud Attack Trees is one of the inside requirement 1. Attacks 2. Evaluation 3. Mitigation Basic Attacks on software 1. Code injection attacks i. Command line injection See voting example (DC Internet voting pilot) ii. Sql injection Select * from userinfo WHERE id = %%% (variable) We can construct this by first constructing a string and then executing it: string = SELECT * from userinfo WHERE id = + var + ; exec (string) And then if var is malicious instantiated, for example: var = 1; DROP TABLE userinfo Both commands (the SELECT and the DROP TABLE) will execute. The variable could end up this way due to user input. iii. HTML Guestbook Hi there <script> malicious.js </script> 2. Overflow Attacks i. Stack buffer overflow

Stack has all sorts of useful data in it Stack contains local variables, return addresses, functions, pointers, exception handlers Return address is the most common one Program [code data heap stack] 00 Main 01 F1 ( ) 20 F2 ( ) 30 HEAD 89 Return 10 99 Buffer Return 99 NOOP Code What the attackers need to know? They need to know the following three things to conduct a stack buffer overflow 1) Know where buffer starts 2) Know where return is (+10) 3) Optional Know what original return value is i-e (10). (It may or may not be important depends on scenario of what you wants to do). It stops program from crashing. ii. Heap Overflow Heap contains data structures object pointers Abuse malloc/free 3. Return Oriented Programming Attack It is an advance attack. One prevention technique to combat code injection is to separate data from executable code (e.g stack is not executable) i. Data Execution Prevention (DEP) Assume all code is fixed (we can t change it so it is in read only memory) Also assume that no user supply data will ever be executed ii. Hardcoded Program

We have some routines and sub-routines Routines Gadgets (tail end of the code) return return return return return Normal Jump (Using buffer overflow) Ø We can jump into sub-routine but must run them until they return Ø Examine the tail end of every sub-routine (everything before a return) Ø You may also misalign the code Real 01 02 00 04 (byte) = id bc, 2, ret Attack: Jump in at 02 02 00 04 = id (bc) a, noop, ret Ø Collect interesting sets of operations Gadgets Build a collection of gadgets Turning completeness What kind of gadgets can we build? Evaluations We are at the mercy of the available code Anything that ends with a return is a potential gadget. Requires just one buffer overflow to insert a chain of addresses Techniques developed to do two things 1) Evaluate your code (give source code)

2) Evaluate someone else s code (e.g malware detection) 1. Static Analysis Just look at the code we don t run it Examine the code with an automated tool Find unbounded buffers, unsanitized inputs etc. Hard to make it inter-procedural and path sensitive Result errors (many false positives, some true negatives) Example: Fortify (HP) 2. Dynamic analysis Run the code Only see your chosen execution path Might not trigger bad behavior Does not have full code coverage Input generation is hard Fuzzing Smart fuzzing: where you start with a normal input Mutate it slightly and randomly Ø Static analysis and dynamic analysis are things we developed to find different types of bugs, e.g: not security bugs, however they application to security 3. Taint Analysis Go through the code and taint all variables that meet a rule Rule example: user supplied data When these variables interact with the other portions of the code, you taint any data that depends on the user supplied variables as well It is mostly used as a monitoring tool a run time, however can be used for analysis Mitigation Protects data from being executable (protects against code injection, some buffer overflow and NOT ROP 1. Address space layout randomization (ASLR) (Common) [code data heap stack] Put it at random locations Do this at runtime so every time you run it has different randomization It prevent buffer overflow It prevent ROP It does not prevent Code Injection

In Practice ASLR can often be bypassed. 2. Error correcting code (canarg) (Not Common) Place an error correcting code between buffer and return and check it doesn t get over written. 3. Encrypt Return Address (Not Common) Encrypt return address. 4. Control Flow Integrity Instrument your code with additional functions checked as it is running Run tool which will make your software run in more specific way Run at compile Almost 90% of ROP gadgets are eliminated Example Ø 3 functions in our program bool lt (int x, int y) { ret x<y } bool gt (int x, int y) { ret x>y } sort2 (int a[ ], int b[ ], int len) { sort (a, len, lt); sort (b, len, gt); } Ø Define a control Flow graph sort2 ( ) sort gt lt call sort call R (R is register with

call sort pointer to lt or gt) ret ret ret ret 1. Direct Call (ok) 2. Indirect call (Unique Label) 3. Returns (label return point) sort2 ( ) call sort label xyz call sort label xyz ret ABC sort ( ) call R, JXR label FZO ret xyz lt ( ) label JXR gt label JXR ret FZO ret FZO