A Survey on Runtime Smashed Stack Detection 坂井研究室 M1 46424 豊島隆志.

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

MTL 坂井・五島研究室 修士1年 豊島 隆 志 新たな高信頼アーキテクチャに向けた研究 A First Step Towards A Novel Dependable Architecture.
Introduction to Memory Management. 2 General Structure of Run-Time Memory.
Defenses. Preventing hijacking attacks 1. Fix bugs: – Audit software Automated tools: Coverity, Prefast/Prefix. – Rewrite software in a type safe languange.
Computer Security: Principles and Practice EECS710: Information Security Professor Hossein Saiedian Fall 2014 Chapter 10: Buffer Overflow.
Computer Security: Principles and Practice First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown Chapter 11 – Buffer Overflow.
Lecture 16 Buffer Overflow modified from slides of Lawrie Brown.
CMSC 414 Computer and Network Security Lecture 22 Jonathan Katz.
Foundations of Network and Computer Security J J ohn Black Lecture #30 Nov 26 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
Breno de MedeirosFlorida State University Fall 2005 Buffer overflow and stack smashing attacks Principles of application software security.
Stack-Based Buffer Overflows Attacker – Can take over a system remotely across a network. local malicious users – To elevate their privileges and gain.
Gabe Kanzelmeyer CS 450 4/14/10.  What is buffer overflow?  How memory is processed and the stack  The threat  Stack overrun attack  Dangers  Prevention.
Stack buffer overflow
Beyond Stack Smashing: Recent Advances in Exploiting Buffer Overruns Jonathan Pincus Microsoft Research Brandon Baker Microsoft Carl Hartung CSCI 7143:
Memory Management (II)
Security Protection and Checking in Embedded System Integration Against Buffer Overflow Attacks Zili Shao, Chun Xue, Qingfeng Zhuge, Edwin H.-M. Sha International.
CS 300 – Lecture 22 Intro to Computer Architecture / Assembly Language Virtual Memory.
Memory Management 2010.
Computer Organization and Architecture
Branch Regulation: Low-Overhead Protection from Code Reuse Attacks Mehmet Kayaalp, Meltem Ozsoy, Nael Abu-Ghazaleh and Dmitry Ponomarev Department of Computer.
1 RAKSHA: A FLEXIBLE ARCHITECTURE FOR SOFTWARE SECURITY Computer Systems Laboratory Stanford University Hari Kannan, Michael Dalton, Christos Kozyrakis.
Lecture 16 Buffer Overflow
Efficient Instruction Set Randomization Using Software Dynamic Translation Michael Crane Wei Hu.
Address Obfuscation: An Efficient Approach to Combat a Broad Range of Memory Error Exploits Sandeep Bhatkar, Daniel C. DuVarney, and R. Sekar Stony Brook.
On-Chip Control Flow Integrity Check for Real Time Embedded Systems Fardin Abdi Taghi Abad, Joel Van Der Woude, Yi Lu, Stanley Bak, Marco Caccamo, Lui.
Security in the industry H/W & S/W What is AMD’s ”enhanced virus protection” all about? What’s coming next? Presented by: Micha Moffie.
System Calls 1.
Shuo Chen, Jun Xu, Emre C. Sezer, Prachi Gauriar, and Ravishankar K. Iyer Brett Hodges April 8, 2010.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Exploiting Buffer Overflows on AIX/PowerPC HP-UX/PA-RISC Solaris/SPARC.
Understand stack Buffer overflow attack and defense Controls against program threats.
Detection and Prevention of Buffer Overflow Exploit Cai Jun Anti-Virus Section Manager R&D Department Beijing Rising Tech. Corp. LTD.
Buffer Overflows Lesson 14. Example of poor programming/errors Buffer Overflows result of poor programming practice use of functions such as gets and.
KGuard: Lightweight Kernel Protection against Return-to-User Attacks Authors: Vasileios P. Kemerlis Georgios Portokalidis Angelos D. Keromytis Presenter:
Introduction: Exploiting Linux. Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend,
Buffer Overflow Detection Stuart Pickard CSCI 297 June 14, 2005.
Mitigation of Buffer Overflow Attacks
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 10 “Buffer Overflow”.
Buffer Overflow CS461/ECE422 Spring Reading Material Based on Chapter 11 of the text.
Buffer Overflow Attack-proofing by Transforming Code Binary Gopal Gupta Parag Doshi, R. Reghuramalingam The University of Texas at Dallas 11/15/2004.
Buffer Overflow Proofing of Code Binaries By Ramya Reguramalingam Graduate Student, Computer Science Advisor: Dr. Gopal Gupta.
Buffer Overflow Group 7Group 8 Nathaniel CrowellDerek Edwards Punna ChalasaniAxel Abellard Steven Studniarz.
Buffer Overflow Attack Proofing of Code Binary Gopal Gupta, Parag Doshi, R. Reghuramalingam, Doug Harris The University of Texas at Dallas.
Lecture 9: Buffer Ovefflows and ROP EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014,
What is exactly Exploit writing?  Writing a piece of code which is capable of exploit the vulnerability in the target software.
A Tool for Pro-active Defense Against the Buffer Overrun Attack D. Bruschi, E. Rosti, R. Banfi Presented By: Warshavsky Alex.
Protecting C Programs from Attacks via Invalid Pointer Dereferences Suan Hsi Yong, Susan Horwitz University of Wisconsin – Madison.
Buffer overflow and stack smashing attacks Principles of application software security.
Introduction Why are virtual machines interesting?
On the Effectiveness of Address-Space Randomization Hovav Shacham, Matthew Page, Ben Pfaff, Eu-Jin Goh, Nagendra Modadugu, Dan Boneh.
Buffer Overflows Taught by Scott Coté.-. _ _.-. / \.-. ((___)).-. / \ /.ooM \ / \.-. [ x x ].-. / \ /.ooM \ -/ \ /-----\-----/---\--\ /--/---\-----/-----\ / \-
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2013.
Slides by Kent Seamons and Tim van der Horst Last Updated: Nov 11, 2011.
VM: Chapter 7 Buffer Overflows. csci5233 computer security & integrity (VM: Ch. 7) 2 Outline Impact of buffer overflows What is a buffer overflow? Types.
Beyond Stack Smashing: Recent Advances In Exploiting Buffer Overruns Jonathan Pincus and Brandon Baker Microsoft Researchers IEEE Security and.
Buffer Overflows: Attacks and Defenses for the Vulnerability of the Decade Crispin Cowan SANS 2000.
Software Security. Bugs Most software has bugs Some bugs cause security vulnerabilities Incorrect processing of security related data Incorrect processing.
Chapter 10 Buffer Overflow 1. A very common attack mechanism o First used by the Morris Worm in 1988 Still of major concern o Legacy of buggy code in.
Introduction to Operating Systems Concepts
Mitigation against Buffer Overflow Attacks
Sabrina Wilkes-Morris CSCE 548 Student Presentation
Continuous, Low Overhead, Run-Time Validation of Program Executions
Introduction to Operating Systems
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Defending against Stack Smashing attacks
Software Security Lesson Introduction
Format String.
CSE 471 Autumn 1998 Virtual memory
Understanding and Preventing Buffer Overflow Attacks in Unix
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
Presentation transcript:

A Survey on Runtime Smashed Stack Detection 坂井研究室 M 豊島隆志

Background Vulnerability becomes Serious Social Problems –ex) Morris Worm on UNIX in 1988 Code Red on Windows in 2001 Nimda on Windows in 2001 Root DNS Attack in 2002 –CERT/CC Advisories Dominant Attacks are caused by Buffer Overflow

Buffer Overflow Attack Stack Smashing Attack –Common mode of buffer overflow attack for hijacking system control Hijack Process  Inject the attack code All applications are ready for injection  Force the process to execute the injected code Stack buffer overflow vulnerability allow malicious input to overwrite the return address and to snatch the execution flow Text Area (program) Data Area Stack Area Malicious Code

Stack Smashing Attack (1) Program Structure of C like languages int main (int argc, char **argv) { … calc_something(x, y); … show_something(); … return 0; } void calc (int n) { … } void calc_something (int x, int y) { … calc(x); … }

Stack Smashing Attack (2) Flow Control Data int main (int argc, char **argv) { … calc_something(x, y); … return 0; } void calc (int n) { … } void calc_something (int x, int y) { … calc(x); … } First In Last Out Buffer main: line n calc_something: line m

Stack Smashing Attack (3) Local Variables –Allocated in FILO buffer unified with flow control data void calc (int n) { int a, b; char buffer[1024]; … foo(); bar(); } return address char buffer[1024]; int b; int a; Local Variables of calc() Stack Frame of calc()

Stack Smashing Attack (4) Injections and Hijacks return address char buffer[1024]; int b; int a; malicious code overwritten by buffer overflow as buffer[1024], …, buffer[1027] 0x Malicious Code 0x046424

Approaches (1) Software Approaches –Novel secure program languages or perfect programs without bugs –Compiler approaches without fixing each source program Static Analysis –A First Step Towards Automated Detection of Buffer Overrun Vulnerabilities “pointer” can not be analyzed perfectly Runtime Detection –LibSafe (LibVerify) – wrapper library –StackGuard –StackShield –ProPolice

Approaches (2) Hardware Approaches –Non-Exec Pages NonExecutable User Stack –vs return-into-libc attack –signal handling NonExecutable Data Pages –modified dynamic loader –modified just-in-time (JIT) compiler –Secure Return Address Stack (SRAS) Architecture Support for Defending Against Buffer Overflow Attacks A Processor Architecture Defense against Buffer Overflow Attacks –Secure Cache A Cache Architecture to Prevent Malicious Code Executions

Secure Return Address Stack (1) Concept –Return-Address-Stack (RAS) implemented at fetch or issue stage on modern processors –Pentium, Alpha, SPARC, POWER… monitor the instructions which mean “call” and “return” –call: push current program counter to the RAS –return: pop an address from the RAS for improvement of execution path prediction –but RAS is not perfectly matched with the real call stack speculative update with branch prediction RAS table overflow –Detect mismatches between RAS and Stack information raise exception

Secure Return Address Stack (2) Improvement –Implement another RAS at commit stage avoid speculative update –Table optimization overflow handling –swap to/from main memory with hardware or OS support enough size for the majority –64 entry in the case of SPEC2000

Secure Return Address Stack (3) Non-FILO Control Flow Operation Problems –setjmp/longjmp Functions –C++ Exceptions –Multi Threading –Tail Recursion –(handmade eccentric assembly language programs!) these are often historical and critical :-) Problem & Solution –these codes access and modify the call stack directly cause mismatches between RAS and Stack information –we can not treat these codes transparently with SRAS approach special instruction sras_push and sras_pop are required for stack operation

Secure Cache (1) Concept –Duplicate Cache-lines as read-only Replica-lines –Detect return address mismatches between Cache-lines and Replica-lines return address Cache LineReplica Line return address malicious data mismatch

Secure Cache (2) Advantages –Efficient spaces without swap –Transparent support for Non-FILO Control Flow Operations Disadvantage –Detection is not perfect Lose replica information on cache line replacement

Commercial Implements NXBit / Execute Disable Bit –AMD - Opteron / Athlon64 –Intel - Itanium / Pentium4 –Transmeta - Efficeon SmartMIPS ASE –Secure Memory Spaces –Interpreted Language Acceleration –Cryptography Acceleration SecureCore (ARM) –Memory Protection Unit –Jazelle Technology –Cryptography Acceleration TrustZone (ARM) –programs marked as trusted run with high level privilege and can access data in secure zone

Conclusion Stack Smashing Attacks is important security problem Hardware approaches achieve more transparent way –without modifications of applications Realization of true transparent detection is difficult –Non-FILO Control Flow Operation Problems setjmp/longjmp Functions C++ Exceptions Multi Threading Tail Recursion –But … cool idea might realize sufficiently transparent detection