1 Automatic Real-time Counterattack System against Remote Buffer Overflow Attack 許富皓 先進防禦實驗室 資訊工程學系 國立中央大學.

Slides:



Advertisements
Similar presentations
Smashing the Stack for Fun and Profit
Advertisements

Communications of the ACM (CACM), Vol. 32, No. 6, June 1989
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.
Foundations of Network and Computer Security J J ohn Black Lecture #30 Nov 26 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
Stack-Based Buffer Overflows Attacker – Can take over a system remotely across a network. local malicious users – To elevate their privileges and gain.
The Attack and Defense of Computers Dr. 許 富 皓 Attacking Program Bugs.
SCP: A System Call Protector against Buffer Overflow Attacks 先進防禦實驗室 國立中央大學 資訊工程系.
資安產學個案研討 許 富 皓 資 訊 工 程 學 系 國 立 中 央 大 學. SQL Injection [SK]SK.
電腦攻擊與防禦 The Attack and Defense of Computers Dr. 許 富 皓.
資訊工程概論 許 富 皓 資訊工程系 國立中央大學
1 一樣的程式 ( 城市 ), 不一樣的結局 許富皓 資訊工程學系 中央大學. 2 How Fast Could Your Computer Be Comprised? Based on the observation of an unpatched version of Windows 2000.
Lecture 16 Buffer Overflow
Address Obfuscation: An Efficient Approach to Combat a Broad Range of Memory Error Exploits Sandeep Bhatkar, Daniel C. DuVarney, and R. Sekar Stony Brook.
Address Space Layout Permutation
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2011.
Port Scanning 0x470~0x480 Presenter SangDuk Seo 1.
Exploiting Buffer Overflows on AIX/PowerPC HP-UX/PA-RISC Solaris/SPARC.
More Network Security Threats Worm = a stand-alone program that can replicate itself and spread Worms can also contain manipulation routines to perform.
ANCS 2006 Scalable Network-based Buffer Overflow Attack Detection Fu-Hau Hsu Department of Computer Science and Information Engineering National Central.
BLENDED ATTACKS EXPLOITS, VULNERABILITIES AND BUFFER-OVERFLOW TECHNIQUES IN COMPUTER VIRUSES By: Eric Chien and Peter Szor Presented by: Jesus Morales.
Introduction: Exploiting Linux. Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend,
Mitigation of Buffer Overflow Attacks
Brian E. Brzezicki. This tutorial just illustrates the underlying concepts of buffer overflows by way of an extremely simple stack overflow  Most buffer.
CS 4010 Hacking Samba Server Vulnerabilities. Recon Telnet headers claim the following: –Red Hat Linux release 9 (Shrike) –Kernel smp on an i686.
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 10 “Buffer Overflow”.
CNIT 127: Exploit Development Ch 4: Introduction to Format String Bugs.
Buffer Overflow CS461/ECE422 Spring Reading Material Based on Chapter 11 of the text.
Introduction to Honeypot, measurement, and vulnerability exploits
Overflows & Exploits. In the beginning 11/02/1988 Robert Morris, Jr., a graduate student in Computer Science at Cornell, wrote an experimental, self-replicating,
Buffer Overflow Attack Proofing of Code Binary Gopal Gupta, Parag Doshi, R. Reghuramalingam, Doug Harris The University of Texas at Dallas.
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.
Shellcode Development -Femi Oloyede -Pallavi Murudkar.
Introduction to Information Security ROP – Recitation 5.
On the Effectiveness of Address-Space Randomization Hovav Shacham, Matthew Page, Ben Pfaff, Eu-Jin Goh, Nagendra Modadugu, Dan Boneh.
A Survey on Runtime Smashed Stack Detection 坂井研究室 M 豊島隆志.
Buffer Overflows Taught by Scott Coté.-. _ _.-. / \.-. ((___)).-. / \ /.ooM \ / \.-. [ x x ].-. / \ /.ooM \ -/ \ /-----\-----/---\--\ /--/---\-----/-----\ / \-
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.
VM: Chapter 7 Buffer Overflows. csci5233 computer security & integrity (VM: Ch. 7) 2 Outline Impact of buffer overflows What is a buffer overflow? Types.
Analyzing C/C++ Vulnerabilities -- Mike Gerschefske.
Beyond Stack Smashing: Recent Advances In Exploiting Buffer Overruns Jonathan Pincus and Brandon Baker Microsoft Researchers IEEE Security and.
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2014.
@Yuan Xue Worm Attack Yuan Xue Fall 2012.
Shellcode COSC 480 Presentation Alison Buben.
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.
Buffer Overflow Walk-Through
Protecting Memory What is there to protect in memory?
The Hardware/Software Interface CSE351 Winter 2013
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
Introduction to Information Security
CSC 495/583 Topics of Software Security Stack Overflows (2)
Buffer Overflow Walk-Through
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Software Security Lesson Introduction
Format String.
Smashing the Stack for Fun and Profit
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2015.
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.
FIGURE Illustration of Stack Buffer Overflow
Format String Vulnerability
Return-to-libc Attacks
Presentation transcript:

1 Automatic Real-time Counterattack System against Remote Buffer Overflow Attack 許富皓 先進防禦實驗室 資訊工程學系 國立中央大學

2 Some Recently News Titles DownadupDownadup worm infects more than 3.5 million - Published: DownadupDownadup virus exposes millions of PCs to hijack – CNN 16th Jan Microsoft announces $ Conficker worm bounty - Network WorldNetwork World

3 Introduction of Arcs Automatic real-time counterattack system – Counterattack worms spreading through remote buffer overflow attacks – Unpatched compromised attack hosts Arcs host Attacking host Buffer Overflow Attack Fight back Modification & Generation

4 Introduction of Arcs Why use code injection-based remote buffer overflow attack? – Flexibility Target selection malicious activities – Simplicity Shellcode programming – Portability Repeated deviation addresses NOP sled

5 Explanation of BOAs (1) b return address add_g address of G’s frame point C[0] H’s stack frame G(int a) { H(3); add_g: } H( int b) { char c[100]; int i; while((c[i++]=getch())!=EOF) { } } C[99] Input String: xyz ZYXZYX G’s stack frame 0xabc 0xaba 0xabb

6 Explanation of BOAs (2) b return address add_g address of G’s frame point C[0] H’s stack frame addrress oxabc G(int a) { H(3); add_g: } H( int b) { char c[100]; int i; while((c[i++]=getch())!=EOF) { } } C[99] Injected Code 0xabc Attack String: xxInjected Codexy0xabc Length=108 bytes 0xaba 0xabb xxxx x y

7 Injected Code: The attacked programs usually have root privilege; therefore, the injected code is executed with root privilege. The injected code is already in machine instruction form; therefore, a CPU can directly execute it. – However the above fact also means that the injected code must match the CPU type of the attacked host. Usually the injected code will fork a shell; hence, after an attack, an attacker could have a root shell.

8 Injected Code of Remote BOAs In order to be able to interact with the newly forked root shell, the injected code usually need to execute the following two steps: – Open a socket. – Redirect standard input and output of the newly forked root shell to the socket.

9 Example of Injected Code for X86 Architecture : Shell Code char shellcode[] = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0 \x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\ x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh";

10 Two Factors for A Successful Buffer Overflow-style Attack(1) A successful buffer overflow-style attack should be able to overflow the right place (e.g. the place to hold a return address with the correct value (e.g. the address of injected code entry point)).

11 Two Factors for A Successful Buffer Overflow-style Attack(2) buffer where the overflow start injected code return address offset between the beginning of the overflowed buffer and the overflow target. address of injected code entry point. The offset and the entry point address are non-predicable. They can not decided by just looking the source code or local binary code.

12 Non-predicable Offset For performance concerns, most compilers don’t allocate memory for local variables in the order they appear in the source code, sometimes some space may be inserted between them. (Source Code doesn’t help) Different compiler/OS uses different allocation strategy. (Local binaries don’t help) Address obfuscation insert random number of space between local variables and return address. (Super good luck may help)

13 Non-predicable Entry Point Address 0xbfffffff system data environment variables argument strings env pointers argv pointers argc webserver –a –b security command line arguments and environment variables Function main()’s stack frame

14 Strategies Used by Attackers to Increase Their Success Chance Repeat address patterns. Insert NOP (0x90) operations before the entry point of injected code.

15 Buffer Overflow Attack String Classic code injection buffer overflow attacking string format

16 Buffer Overflow Attack String Characteristics – Injected code (shellcode) NOP sled used – 0x90 (NOP) – One byte non-privileged instructions – Repeated Deviation address Repeat every 4 bytes Point to stack or heap: – Code injection

17 Modification of Buffer Overflow Attack String Modification – Injected code replacement – Preserve Effectiveness padding deviation addresses rest part of the attack string 項目\種類反擊字串 填充段同原攻擊字串 更改位址值同原攻擊字串 注入程式碼替換成反擊程式碼 注入程式碼 長度 反擊程式碼必須小於原注入程 式碼 總字串長度同原攻擊字串 Fight back injected code Fight Back String

18 Implementation Arcs Design – Arcs Core – Arcser detected add event Polling fetch event network data stream Fight Back String

19 Demonstration Effectiveness demonstration – Target: normal Linux host 屬性內容描述 漏洞程式 描述 corehttpd[v0.5.3alpha]: httpd remote buffer overflow NOP sled268 bytes continue 0x90 注入程式 碼 Portbind shellcode at port 7979 after NOP sled Running vulnerable Corehttpd service at port 8080 launch an attack though the exploit Portbind shell at port 7979 Normal Linux

20 Demonstration Effectiveness Demonstration – Target: Arcs host Attacking host Arcs host Running vulnerable Corehttpd service at port 8080 Running vulnerable Corehttpd service at port 8080 Attack generated by the exploit Fight back Portbind shell at port 屬性內容描述 漏洞程式 描述 corehttpd[v0.5.3alpha]: httpd remote buffer overflow NOP sled268 bytes continue 0x90 注入程式 碼 Portbind shellcode at port 7979 after NOP sled Portbind shell at port 7979 ?

21 Discussion Arcs against Internet Worm – Uniform random target selection worm model – Arcs Decrease the number of vulnerable hosts in the Internet – portable Arcs Decrease the number of malicious hosts in the Internet Infected host Immune host Arcs host vulnerable host Portable Arcs host vulnerable hostInfected host Arcs host Infected host Portable Arcs host

22 Discussion Arcs based solution against Internet Worm I t = N – (V t ∪ M t ∪ S t )

23 Discussion Arcs against Internet Worm NNumber of total targets VtVt Number of uninfected Vulnerable hosts at t th time tick PsPs The probability of a successful attack for each attack Number of attacks generated by an infected host in a time tick S0S0 Initial number of Arcs hosts ItIt Number of Immune hosts at t th time tick MtMt Number of infected malicious hosts at t th time tick PtPt The probability of a host being attacked at least once at t th time tick

24 Discussion Portable Arcs against Internet Worm NNumber of total targets VtVt Number of uninfected Vulnerable hosts at t th time tick PsPs The probability of a successful attack for each attack Number of attacks generated by an infected host in a time tick StSt Number of Arcs hosts at t th time tick MtMt Number of infected malicious hosts at t th time tick PtPt The probability of a host being attacked at least once at t th time tick

25 Discussion Against Internet Worm ArcsPortable Arcs Number of Host Number of Time tick Number of Host

26 Discussion Against Internet Worm ArcsPortable Arcs Number of Host Number of Time tick Number of Host

27 Discussion Against Internet Worm ArcsPortable Arcs Number of Host Number of Time tick Number of Host

28 Discussion Limitations – Detection NON-repeated deviation address – Modification Multiple NOP sleds Extremely small injected code

29 Discussion Counterattack risk – Legal or illegal – Arcs attacks Arcs

30 Discussion Deployment strategies – As Honeypot – As important server protection – Both of above. – Depending on managers’ requirements Future work – Arcs-based worm auto cleaning system

31 Related work Worm – White Worm – Watertight compartment – Vaccination – Detection and monitoring

32 Conclusion Automatic buffer overflow attacking string modification – Injected code replacement – Effectiveness preserved Arcs – Automatic real-time counterattack system – Flexible deployment – Remote buffer overflow attack deterrence Arcs-based applications – Cleaning worm – Detecting and identifying Botnet

33 Q&A