Pinpointing Vulnerabilities

Slides:



Advertisements
Similar presentations
Buffer Overflows Nick Feamster CS 6262 Spring 2009 (credit to Vitaly S. from UT for slides)
Advertisements

Software & Services Group PinPlay: A Framework for Deterministic Replay and Reproducible Analysis of Parallel Programs Harish Patil, Cristiano Pereira,
CS457 – Introduction to Information Systems Security Software 4 Elias Athanasopoulos
Integrity & Malware Dan Fleck CS469 Security Engineering Some of the slides are modified with permission from Quan Jia. Coming up: Integrity – Who Cares?
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Computer Security: Principles and Practice EECS710: Information Security Professor Hossein Saiedian Fall 2014 Chapter 10: Buffer Overflow.
Lecture 16 Buffer Overflow modified from slides of Lawrie Brown.
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
TaintCheck and LockSet LBA Reading Group Presentation by Shimin Chen.
Inline Assembly Section 1: Recitation 7. In the early days of computing, most programs were written in assembly code. –Unmanageable because No type checking,
LIFT: A Low-Overhead Practical Information Flow Tracking System for Detecting Security Attacks Feng Qin, Cheng Wang, Zhenmin Li, Ho-seop Kim, Yuanyuan.
1 Achieving Trusted Systems by Providing Security and Reliability (Research Project #22) Project Members: Ravishankar K. Iyer, Zbigniew Kalbarczyk, Jun.
Achieving Trusted Systems by Providing Security and Reliability Ravishankar K. Iyer, Zbigniew Kalbarczyk, Jun Xu, Shuo Chen, Nithin Nakka and Karthik Pattabiraman.
@ NCSU Zhi NCSU Xuxian Microsoft Research Weidong Microsoft NCSU Peng NCSU ACM CCS’09.
MemTracker Efficient and Programmable Support for Memory Access Monitoring and Debugging Guru Venkataramani, Brandyn Roemer, Yan Solihin, Milos Prvulovic.
1 RISE: Randomization Techniques for Software Security Dawn Song CMU Joint work with Monica Chew (UC Berkeley)
Address Obfuscation: An Efficient Approach to Combat a Broad Range of Memory Error Exploits Sandeep Bhatkar, Daniel C. DuVarney, and R. Sekar Stony Brook.
University of Washington CSE 351 : The Hardware/Software Interface Section 5 Structs as parameters, buffer overflows, and lab 3.
CS252: Systems Programming Ninghui Li Final Exam Review.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
Vulnerability-Specific Execution Filtering (VSEF) for Exploit Prevention on Commodity Software Authors: James Newsome, James Newsome, David Brumley, David.
Address Space Layout Permutation
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Computer Security and Penetration Testing
A Survey of Dynamic Techniques for Detecting Device Driver Errors Olatunji Ruwase LBA Reading Group 18 th May 2010.
Automatic Diagnosis and Response to Memory Corruption Vulnerabilities Authors: Jun Xu, Peng Ning, Chongkyung Kil, Yan Zhai, Chris Bookholt In ACM CCS’05.
Page 1 2P13 Week 6. Page 2 Table 7.1 Memory Management Terms Frame A fixed-length block of main memory. Page A fixed-length block of data that resides.
Automatic Diagnosis and Response to Memory Corruption Vulnerabilities Presenter: Jianyong Dai Jun Xu, Peng Ning, Chongkyung Kil, Yan Zhai, Chris Bookhot.
MICHALIS POLYCHRONAKIS(COLUMBIA UNIVERSITY,USA), KOSTAS G. ANAGNOSTAKIS(NIOMETRICS, SINGAPORE), EVANGELOS P. MARKATOS(FORTH-ICS, GREECE) ACSAC,2010 Comprehensive.
Title of Selected Paper: IMPRES: Integrated Monitoring for Processor Reliability and Security Authors: Roshan G. Ragel and Sri Parameswaran Presented by:
File System Implementation
Exploitation possibilities of memory related vulnerabilities
CSCE 548 Integer Overflows Format String Problem.
Kirk Scott Computer Science The University of Alaska Anchorage 1.
An Integrated Framework for Dependable and Revivable Architecture Using Multicore Processors Weidong ShiMotorola Labs Hsien-Hsin “Sean” LeeGeorgia Tech.
On the Effectiveness of Address-Space Randomization Hovav Shacham, Matthew Page, Ben Pfaff, Eu-Jin Goh, Nagendra Modadugu, Dan Boneh.
Dynamic Taint Analysis for Automatic Detection, Analysis, and Signature Generation of Exploits on Commodity Software Paper by: James Newsome and Dawn Song.
Convicting Exploitable Software Vulnerabilities: An Efficient Input Provenance Based Approach Zhiqiang Lin Xiangyu Zhang, Dongyan Xu Purdue University.
Security Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
Slides by Kent Seamons and Tim van der Horst Last Updated: Nov 11, 2011.
Beyond Stack Smashing: Recent Advances In Exploiting Buffer Overruns Jonathan Pincus and Brandon Baker Microsoft Researchers IEEE Security and.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Qin Zhao1, Joon Edward Sim2, WengFai Wong1,2 1SingaporeMIT Alliance 2Department of Computer Science National University of Singapore
Communication in Distributed Systems. . The single most important difference between a distributed system and a uniprocessor system is the interprocess.
22/05/2015 – ICSE 2015 – Florence, Italy Hercules: Reproducing Crashes in Real-World Application Binaries Van-Thuan Pham, Wei Boon Ng, Konstantin Rubinov,
Secure Coding Rules for C++ Copyright © 2016 Curt Hill
Remix: On-demand Live Randomization
Free Transactions with Rio Vista
Presented by: Daniel Taylor
Adaptive Android Kernel Live Patching
YAHMD - Yet Another Heap Memory Debugger
Control Unit Lecture 6.
Chapter 9: Virtual Memory – Part I
Chapter 9: Virtual Memory
nZDC: A compiler technique for near-Zero silent Data Corruption
CSC 495/583 Topics of Software Security Stack Overflows (2)
Taint tracking Suman Jana.
Secure Coding Rules for C++ Copyright © Curt Hill
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Chapter 9: Virtual-Memory Management
Machine Independent Features
All You Ever Wanted to Know About Dynamic Taint Analysis & Forward Symbolic Execution (but might have been afraid to ask) Edward J. Schwartz, Thanassis.
Free Transactions with Rio Vista
Representing Information (2)
IntScope: Automatically Detecting Integer overflow vulnerability in X86 Binary Using Symbolic Execution Tielei Wang, TaoWei, ZhingiangLin, weiZou Purdue.
CSE 153 Design of Operating Systems Winter 2019
Dynamic Binary Translators and Instrumenters
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Dirty COW Race Condition Attack
Presentation transcript:

Pinpointing Vulnerabilities Yue Chen, Mustakimur Khandaker, Zhi Wang Florida State University Vulnerabilities Pinpointing Vulnerabilities

Question When an attack is detected, how to locate the underlying vulnerability? Attack Vulnerability Pinpointing Vulnerabilities

Example A control-flow violation is detected at line 6. Root Cause Symptom A control-flow violation is detected at line 6. The vulnerability lies at line 4 (buffer overflow). Pinpointing Vulnerabilities

Attack Detection v.s. Vulnerability Locating Control-flow Integrity (CFI) Detect the control-flow graph violation (e.g., on function returns) Taint Analysis Detect tainted data being loaded to PC System Call Interposition Detect abnormal syscalls made by the payload Manifestation of attack rarely coincides with the vulnerabilities Pinpointing Vulnerabilities

Ravel – Three Components Root-cause Analysis of Vulnerabilities from Exploitation Log Online attack detector Record & replay with instrumentation Offline vulnerability locator Pinpointing Vulnerabilities

Ravel – Strengths Reliably reproduce real-world attacks in the lab environment Low online performance overhead Locating vulnerabilities is time-consuming Extensible: New attack detection and vulnerability locating techniques can be easily integrated (already support a variety of vulnerability locating techniques) Pinpointing Vulnerabilities

Attack Detection Ravel uses existing attack detection methods Program crash (or other exceptions) Abnormal system calls (sequence/arguments) Control-flow integrity violation (to be included) New methods can be easily adopted by Ravel Pinpointing Vulnerabilities

More robust against attacks, with low cost Record & Replay What to record & replay? All the non-deterministic inputs (e.g., network packets) Where to record & replay? Application interface Library interface Virtual machine interface System call interface More robust against attacks, with low cost Pinpointing Vulnerabilities

Record System call return values Userspace data structures modified by syscalls Data copied from kernel to userspace Asynchronous signals Special instructions (e.g., RDTSC) Synchronization primitives Pinpointing Vulnerabilities

Replay with Instrumentation Some syscalls replayed without real execution e.g., gettimeofday Some syscalls need to be re-executed e.g., mmap Replay under a binary translation (BT) engine BT collects detailed memory accesses by the target Replay distinguishes syscalls made by the target from those made by BT Pinpointing Vulnerabilities

Vulnerability Locator Data-flow Analysis Race Condition Use-after-free Double-free Integer Errors Pinpointing Vulnerabilities

Data-flow Analysis Analyze def-use relations between instructions Define: writes to a memory address Use: reads from a memory address write read define use A B Pinpointing Vulnerabilities

Data-flow Analysis Precompute a data-flow graph (DFG) DFG: the valid def-use relations in the program Our prototype uses dynamic analysis Extra relations regarded as violations Violation to DFG indicates the vulnerability location It could be the def or the use, but which one? Refine the results with heuristics Pinpointing Vulnerabilities

Data-flow Analysis Heuristics One def, many uses: def is closer to the vulnerability Example: buffer overflow def Normal Violating use use use Pinpointing Vulnerabilities

Data-flow Analysis Heuristics One def, many uses: def is closer to the vulnerability Example: buffer overflow Many defs, one use: use is closer to the vulnerability Example: information leakage … use def Pinpointing Vulnerabilities

Integer Errors Focus on common integer errors Example: Start from common functions/instructions that take integer operands E.g., memcpy, recvfrom; movs, stos… Search backwards for integer errors Example: memcpy ( void * destination, const void * source, size_t num ); Search from num backwards for integer errors. Pinpointing Vulnerabilities

Integer Errors Benign integer errors? Assignment truncation (e.g., 0x12345678 → 0x5678) To detect: assign from a longer to a shorter integer type Integer overflow/underflow (e.g., 0xFFFFFFFF + 1) To detect: check the RFLAGS register Signedness error (e.g., unsigned_int_var = signed_int_var) To detect: collect hints from functions and instructions Instructions: jg, jge, ja, jae, cmovg, cmova, idiv, div, etc. Functions: memmove, strncat, etc. Benign integer errors? Related to a reported vulnerability! Pinpointing Vulnerabilities

Use-after-free and Double-free Ravel instruments memory allocation/free functions to track the memory life-time Use-after-free: freed memory is accessed again Double-free: memory freed more than once without re-allocation Pinpointing Vulnerabilities

Race Condition When race condition happens, the execution deviates from the recorded one as we do not implement strict R&R When detected, use the happens-before relation to check for race conditions Pinpointing Vulnerabilities

Implementation Record & replay: Vulnerability locator: FreeBSD release 10.2 Kernel modification + small user-space utility Vulnerability locator: Extended from Valgrind Pinpointing Vulnerabilities

Evaluation – Effectiveness Buffer overflow Integer errors Information leakage Use-after-free and double-free Format string vulnerabilities Pinpointing Vulnerabilities

CVE-2013-2028 of Nginx signed comparison Ravel unsigned signed Data-flow Violation Signedness Conflict Memory Exception unsigned signed larger than expected buffer overflow Pinpointing Vulnerabilities

Evaluation – Effectiveness More examples are in the paper (Heartbleed, etc.) Pinpointing Vulnerabilities

Evaluation – Performance Performance overhead of Ravel’s online components relative to the original FreeBSD system Pinpointing Vulnerabilities

Pinpointing Vulnerabilities Q&A http://YueChen.me Vulnerabilities Pinpointing Vulnerabilities

Backup Slides Pinpointing Vulnerabilities

Attack Detection Example Typical scenario example: Attacker guesses memory addresses Program crashes (due to ASLR, DEP, etc.) Victim forks a new process Attack Fork Pinpointing Vulnerabilities