Security Protection and Checking in Embedded System Integration Against Buffer Overflow Attacks Zili Shao, Chun Xue, Qingfeng Zhuge, Edwin H.-M. Sha International.

Slides:



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

Smashing the Stack for Fun and Profit
Exploring Security Vulnerabilities by Exploiting Buffer Overflow using the MIPS ISA Andrew T. Phillips Jack S. E. Tan Department of Computer Science University.
David Brumley Carnegie Mellon University Credit: Some slides from Ed Schwartz.
Apr. 12, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 6: Branching and Procedures in MIPS* Jeremy R. Johnson Wed. Apr. 12, 2000.
Functions Functions and Parameters. History A function call needs to save the registers in use The called function will use the registers The registers.
Review: Software Security David Brumley Carnegie Mellon University.
Intro to Exploitation Stack Overflows James McFadyen UTD Computer Security Group 10/20/2011.
Stack-Based Buffer Overflows Attacker – Can take over a system remotely across a network. local malicious users – To elevate their privileges and gain.
Design of a Framework for Testing Security Mechanisms for Program-Based Attacks Ben “Security” Breech and Lori Pollock University of Delaware.
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.
Windows XP SP2 Stack Protection Jimmy Hermansson Johan Tibell.
Computer Security Buffer Overflow lab Eu-Jin Goh.
Assembly תרגול 8 פונקציות והתקפת buffer.. Procedures (Functions) A procedure call involves passing both data and control from one part of the code to.
Netprog: Buffer Overflow1 Buffer Overflow Exploits Taken shamelessly from: netprog/overflow.ppt.
Efficient Instruction Set Randomization Using Software Dynamic Translation Michael Crane Wei Hu.
CMSC 414 Computer and Network Security Lecture 20 Jonathan Katz.
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.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Buffer overflows.
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2011.
Assembly, Stacks, and Registers Kevin C. Su 9/26/2011.
Fall 2008CS 334: Computer SecuritySlide #1 Smashing The Stack A detailed look at buffer overflows as described in Smashing the Stack for Fun and Profit.
Exploiting Buffer Overflows on AIX/PowerPC HP-UX/PA-RISC Solaris/SPARC.
Buffer Overflows Lesson 14. Example of poor programming/errors Buffer Overflows result of poor programming practice use of functions such as gets and.
Mitigation of Buffer Overflow Attacks
Automatic Diagnosis and Response to Memory Corruption Vulnerabilities Presenter: Jianyong Dai Jun Xu, Peng Ning, Chongkyung Kil, Yan Zhai, Chris Bookhot.
University of Washington Today Happy Monday! HW2 due, how is Lab 3 going? Today we’ll go over:  Address space layout  Input buffers on the stack  Overflowing.
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 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,
Stack-based buffer overflows Yves Younan DistriNet, Department of Computer Science Katholieke Universiteit Leuven Belgium
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.
Part I The Basic Idea software sequence of instructions in memory logically divided in functions that call each other – function ‘IE’ calls function.
JMU GenCyber Boot Camp Summer, Introduction to Penetration Testing Elevating privileges – Getting code run in a privileged context Exploiting misconfigurations.
Introduction Program File Authorization Security Theorem Active Code Authorization Authorization Logic Implementation considerations Conclusion.
Buffer overflow and stack smashing attacks Principles of application software security.
CS 155 Section 1 PP1 Eu-Jin Goh. Setting up Environment Demo.
Buffer Overflow Attack- proofing of Code Binaries Ramya Reguramalingam Gopal Gupta Gopal Gupta Department of Computer Science University of Texas at Dallas.
Reminder Bomb lab is due tomorrow! Attack lab is released tomorrow!!
Information Security - 2. A Stack Frame. Pushed to stack on function CALL The return address is copied to the CPU Instruction Pointer when the function.
Group 9. Exploiting Software The exploitation of software is one of the main ways that a users computer can be broken into. It involves exploiting the.
Slides by Kent Seamons and Tim van der Horst Last Updated: Nov 11, 2011.
About Exploits Writing ABOUT EXPLOITS WRITING Gerardo Richarte 
Chapter 10 Chapter 10 Implementing Subprograms. Implementing Subprograms  The subprogram call and return operations are together called subprogram linkage.
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2014.
Automatic Diagnosis and Response to Memory Corruption Vulnerabilities Authors: Jun Xu, Peng Ning, Chongkyung Kil, Yan Zhai, Chris Bookholt Cyber Defense.
Mitigation against Buffer Overflow Attacks
Buffer Overflow Buffer overflows are possible because C doesn’t check array boundaries Buffer overflows are dangerous because buffers for user input are.
The Hardware/Software Interface CSE351 Winter 2013
Recitation: Attack Lab
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Advanced Buffer Overflow: Pointer subterfuge
Defending against Stack Smashing attacks
Software Security Lesson Introduction
Understanding Program Address Space
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2015.
CNT4704: Analysis of Computer Communication Network Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Fall 2011.
Problem: ! bell ! help ! ! 1 ! 2 ! ! Bal help ! ! ! !
Problem: ! bell ! help ! ! 1 ! 2 ! ! Bal help ! ! ! !
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2016.
Understanding and Preventing Buffer Overflow Attacks in Unix
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2013.
Return-to-libc Attacks
Presentation transcript:

Security Protection and Checking in Embedded System Integration Against Buffer Overflow Attacks Zili Shao, Chun Xue, Qingfeng Zhuge, Edwin H.-M. Sha International Conference on Information Technology : Coding and Computing Presenter : Guang-Bao Lin

Outline What’s the problem? Abstract Review: Stack Buffer overflow Related Work Hardware/Software Defender  Boundary Check  Secure Function Call Compare the two methods Conclusion Outline

What’s the problem? With more embedded systems networked, Security becomes an important research problem.  “buffer overflow attack” takes over 50% of today’s widely exploited vulnerabilities. How to solve the problem?  The author proposed HSDefender technique to defend system against buffer overflow attacks. What’s the problem?

Abstract ith more embedded systems networked, it becomes an important research problem to effectively defend embedded systems against buffer overflow attacks and efficiently check if systems have been protected. In this paper, we propose the HSDefender (hardware/software Defender) technique that considers the protection and checking together to solve this problem. Our basic idea is to design a secure instruction set and require third-party software developers to use secure instructions to call functions. Then the security checking can be easily performed by system integrators even without the knowledge of the source code. e first classify buffer overflow attacks into two categories, stack smashing attacks and function pointer attacks, and then provide two corresponding defending strategies. We analyze the HSDefender technique in respect of hardware cost, security, and performance, and experiment with it on the SimpleScalar/ARM simulator using benchmarks from MiBench. The results show that HSDefender can defend a system against more types of buffer overflow attacks with less overhead compared with the previous work. W W Abstract

Review: Stack A stack will be created including argument, return address, and buffer space char *func(char *msg) { int var1; char buf[80]; strcpy(buf, msg); return msg; } Int main( int argv,char **argc) { char *p; p = func(argc[1]); exit(0); } main( )’s arguments start( )/main( ) 12 bytes return address saved %ebp p func( )’s arguments return address saved %ebp var1 buf main( ) main( )/func( ) func( ) 4 bytes 80 bytes lower address higher address Introduce buffer overflow attack

Buffer overflow (1) If the filler is bigger than the buffer size… main( )’s arguments start( )/main( ) 12 bytes return address saved %ebp p func( )’s arguments return address saved %ebp var1 buf main( ) main( )/func( ) func( ) 4 bytes 80 bytes lower address higher address char *func(char *msg) { int var1; char buf[80]; strcpy(buf, msg); return msg; } Int main( int argv,char **argc) { char *p; p = func(argc[1]); exit(0); } char argc[255]; for (i=0;i<255;i++) argc[i] = ‘A’ ; // 0x41h Introduce buffer overflow attack

Buffer overflow (2) If the filler is bigger than the buffer size… Buffer overflow occurs (higher space will be overwritten) main( )’s arguments start( )/main( ) 12 bytes return address saved %ebp p func( )’s arguments return address saved %ebp var1 buf main( ) main( )/func( ) func( ) 4 bytes 80 bytes lower address higher address char *func(char *msg) { int var1; char buf[80]; strcpy(buf, msg); return msg; } Int main( int argv,char **argc) { char *p; p = func(argc[1]); exit(0); } char argc[255]; for (i=0;i<255;i++) argc[i] = ‘A’ ;//0x41h 0x h Introduce buffer overflow attack

What does “buffer-overflow attack” do ? argument return addr buffer A wrong return address may cause a hacker’s shell been executed. Before overflow Overwrite 0x h buffer(overflow) Hacker’s Shell Code 0x h After overflow Execute hacker’s shell (with root’s authority) -_-|| Introduce buffer overflow attack

Related Work Adding checking instruction (this paper)  StackGuard Runtime boundary checking  Shortage: big performance overhead Analyzing C code by S/W tools  Shortage: incomplete and imprecise Related work

Problem of S/W solution Performance overhead is too much Too many old software have this problem and it’s impossible to solve them all in Software way Related work

Hardware/Software Defender Hardware modification Design a secure instruction set and require third-party software developers to use secure instructions to call functions. Two components  Stack smashing protection (return address) Method 1: Boundary Check Method 2: Secure Function Call  Function pointer protection (function pointer) Work of this paper

Component 1: Stack Smashing Protection Method 1: Boundary Check main( )’s arguments main( ) return address saved %ebp p func( )’s arguments return address saved %ebp var1 buf main( ) func( ) higher address target address frame pointer ta >= fp compare stack overflow exception ta < fp lower address (1) while a “write” operation is executed, an address check is parallel performed for the target’s addresses. (2) if the target’s address is equal to or bigger than the value of the frame pointer, the stack overflow exception is issued; otherwise, do nothing. Component 1---method 1

Component 1: Stack Smashing Protection Method 2: Secure Function Call Use new instruction “SCALL” and “SRET” to substitute “CALL” and “RET” Introduce them as follow… Component 1---method 2

Original instruction -- Call main( )’s arguments return address Stack Program Counter ….. CALL ….. func addr What does “Call” do?  (1) push the return address into the stack  (2) put the address of the function into Program Counter Component 1---method 2

Original instruction -- Ret main( )’s arguments stack Program Counter ….. RET ….. return address What does “Ret” do?  Pop the return address to the Program Counter Component 1---method 2

New instruction -- SCALL main( )’s arguments return address stack Program Counter ….. SCALL ….. func addr S = XOR (key, Ret) Component 1---method 2 Key stored in Register Return address What does “SCALL” do?  (1) push return address  (2) generate S  (3) push S into Stack  (4) put the address of the function into Program Counter S

New instruction -- SRET main( )’s arguments previous_pc stack Program Counter ….. SRET ….. return address S T = XOR ( Ret, Key) Component 1---method 2 What does “SRET” do?  (1) push S to reg1, and push return address to reg2  (2) Calculate T  (3) Compare T and S. If equal, move return address to PC SRetKey compare XOR T if T = S, move Ret to PC

Compare with method1 and method2 Method1 is better than method2:  No increased instruction, checking the boundary automatically  Lower gate count  Better protection Compare method 1 and method 2

Hardware Method 1: Boundary Check Method 2: Secure Function Call Both methods needs simple hardware If ta >= fp, Comp_out = 0 Move = 1 Move the return address to Program Counter If T!= S, Comp_out = 0 (Move not happen) Compare method 1 and method 2 1 1

Comparison and Analysis Both methods in component 1 need very simple hardware Hardware boundary check has less hardware cost Compare method 1 and method 2

Performance overhead of secure function call method hardware boundary check method is no performance overhead. Function Pointers are rarely used in embedded system. So here is secure function call method Compare method 1 and method 2 Performance Overhead is small

Conclusion The author proposed HSDefender to defend embedded system against buffer overflow attacks. The results shows that HSDefender can defend more types of buffer overflow attacks with much less performance overhead. Conclusion