Instead of Motivation Three Decades of Runtime Attacks

Instead of Motivation Three Decades of Runtime Attacks

instead of Motivation Three Decades of Runtime Attacks return-into- Return-oriented Morris Worm libc programming Continuing Arms 1988 Solar Designer Shacham Race 1997 CCS 2007 … Borrowed Code Code Chunk Injection Exploitation AlephOne Krahmer 1996 2005 Recent Attacks Attacks on Tor Browser [2013] Stagefright [Drake, BlackHat 2015] FBI Admits It Controlled Tor Servers These issues in Stagefright code critically Behind Mass Malware Attack. expose 95% of Android devices, an estimated 950 million devices MMS Adversary Cisco Router Exploit [2016] The Million Dollar Dissident [2016] Million CISCO ASA Firewalls potentially Government targeted human rights vulnerable to attacks defender with a chain of zero-day exploits to infect his iPhone with spyware. Adversary Relevance and Impact High Impact of Attacks • Web browsers repeatedly exploited in pwn2own contests • Zero-day issues exploited in Stuxnet/Duqu [Microsoft, BH 2012] • iOS jailbreak Industry Efforts on Defenses • Microsoft EMETCan includes either a ROP be detection bypassed, engine or may not • Microsoft Controlbe Flow sufficiently Guard (CFG) effectivein Windows 10 • Google‘s compiler extension VTV (Virtual Table Verification) [Davi et al, Blackhat2014], [Liebchen et al CCS2015], • Intel’s Hardware[Schuster, Extension et CET al S&P2015] (Control-flow Enforcement Technology) Hot Topic of Research • A large body of recent literature on attacks and defenses Runtime Attacks & Defenses: Continuing Arms Race Defenses Still seeking practicalAttacks and CFI, ROPGuard, BinCFI, ROPecker, secure solutions kBouncer, CCFIR, vTint, vfGuard, SafeDispatch, MoCFI, ROP wo Returns, RockJIT, TVip, Out-of-Control, StackArmor, CPI/CPS, Stitching the Oxymoron, XnR, Gadgets, SROP, JIT- Isomeron, ROP, BlindROP, O-CFI, COOP, StackDefiler, Readactor, "Missing the HAFIX, point(er)" ... The whole story ….. Runtime Attacks Code-Injection Attack Code-Reuse Attack Basic Blocks (BBL) A Entry: instruction target of a branch A (e.g., first instruction of a function) Exit: Any branch B (e.g., indirect or direct jump/call, return) B corrupt code C D pointer C D E F E F X DEPX inject malicious corrupt code pointer code Adversary Data flow Data Execution Prevention Program flow Return-oriented Programing (ROP): Prominent Code-Reuse Attack ROP shown to be Turing-complete ROP: Basic Ideas/Steps Use small instruction sequences instead of whole functions Instruction sequences have length 2 to 5 All sequences end with a return instruction, or an indirect jump/call Instruction sequences chained together as gadgets Gadget perform particular task, e.g., load, store, xor, or branch Attacks launched by combining gadgets Generalization of return-to-libc Threat Model: Code-reuse Attacks Application RX ? Code 1 Writable Executable Code? Code? ? 2 ⊕ ? ? Opaque Memory Layout RW Data ? Data? Data ? 3 Disclose readable Memory RX ? ? Code? Data? 4 Manipulate writable Memory RW? 5 Computing Engine Data? Main Defenses against Code Reuse 1. Code Randomization 2. Control-Flow Integrity (CFI) Randomization vs. CFI Randomization Control-flow Integrity Low Performance Overhead Formal Security (Explicit Control Flow Scales well to complex Checks) Software (OS, browser) Information Disclosure Tradeoff: hard to prevent Performance & Security Challenging to integrate High entropy required in complex software, coverage EPISODE I Code Randomization Make gadgets locations unpredictable Fine-Grained ASLR Application Run 1 Application Run 2 Library (e.g., libc) Library (e.g., libc) Instruction RET Instruction Sequence 3 RET Sequence 1 Instruction RET Instruction Sequence 1 RET Sequence 2 Instruction RET Instruction Sequence 2 RET Sequence 3 Instruction reordering/substitution within a BBL ORP [Pappas et al., IEEE S&P 2012] Randomizing each instruction‘s location: ILR [Hiser et al., IEEE S&P 2012] Permutation of BBLs: STIR [Wartell et al., CCS 2012] & XIFER [with Davi et al., AsiaCCS 2013] Randomization: Memory Leakage Problem Direct memory disclosure • Pointer leakage on code pages • e.g., direct call and jump instruction Indirect memory disclosure • Pointer leakage on data pages such as stack or heap • e.g., return addresses, function pointers, pointers in vTables JIT-ROP: Bypassing Randomization via Direct Memory Disclosure Just-In-Time Code Reuse: On the Effectiveness of Fine-Grained Address Space Layout Randomization IEEE Security and Privacy 2013, and Blackhat 2013 Kevin Z. Snow, Lucas Davi, Alexandra Dmitrienko, Christopher Liebchen, Fabian Monrose, Ahmad-Reza Sadeghi Just-In-Time ROP: Direct Memory Disclosure 1 Undermines fine-grained ASLR Shows memory disclosures are far more 2 damaging than believed 3 Can be instantiated with real-world exploit Readactor: Towards Resilience to Memory Disclosure Readactor: Practical Code Randomization Resilient to Memory Disclosure IEEE Security and Privacy 2015 Stephen Crane, Christopher Liebchen, Andrei Homescu, Lucas Davi, Per Larsen, Ahmad-Reza Sadeghi, Stefan Brunthaler, Michael Franz CodeCode Randomization: Randomization: AttackAttack & & Defense Defense Techniques Techniques Attack Timeline Static Attack RX Application Morris Worm / (Fine-grained) Return to libc [Solar Function_A Randomization Designer Bugtraq’97] ?Execute? - Function_B? Just-In-Time ROP [Snow et ? al. IEEE S&P’13] Direct code <instructions>only <instructions>Trampoline? Target disclosure call Function_A Isomeron (Attack) [Davi et poppopMemory ebx?ebx ? Execute-only pop ebx ? ?? al. NDSS’15] poppop? ecx?ecx ? Memory (XoM) ret?ret ? TrampolineXoM Trampoline Indirect code RW Reuse Attacks disclosure Pointers Register Code-pointer Return Address randomization hiding Code Randomization: Attack & Defense Techniques RX Application Attack Timeline JIT Code JIT Code Attacks Counterfeit Object-oriented Same Protection Programming (COOP) XoM? ? ? as for AOT Code ? ? [Schuster et al. IEEE S&P’15] TrampolineXoM Crash-Resistant Oriented Brute-force X-Virtual Table Programming [Gawlik et al. Attacks on vFunc2 Tramp NDSS’16] Entropy Booby Traps BoobyXoM Trap Terminate Process vFunc1 Tramp RW Pointers Function Pointer Trampoline Function Virtual Table ? Reuse for Reuse Attacks Ptrvirt.X Function1-virt table Attack Surface Single Function Trampolines & virt. Function2 Large enough? Pointers Booby Traps EPISODE II Control-Flow Integrity (CFI) Restricting indirect targets to a pre-defined control-flow graph Original CFI Label Checking [Abadi et al., CCS 2005 & TISSEC 2009] BBL A label_A ENTRY asm_ins, … EXIT ATwo Questions CFI CHECK: 1. Benign and correct execution?EXIT(A) -> label_B ? C 2. BRuntimeBBL enforcement? B label_B ENTRY asm_ins, … EXIT CFI: CFG Analysis and Coverage Problem CFG Analysis • Conservative “points-to” analysis • e.g., over-approximate to avoid breaking the program CFG Coverage • Precision of CFG analysis determines security of CFI policy • e.g., more precise more secure Which Instructions to Protect? • Purpose: Return to calling function Returns • CFI Relevance: Return address located on stack Indirect • Purpose: switch tables, dispatch to library functions • CFI Relevance: Target address taken from either Jumps processor register or memory Indirect • Purpose: call through function pointer, virtual table calls • CFI Relevance: Target address taken from either processor Calls register or memory Label Granularity: Trade-Offs (1/2) Many CFI checks are required if unique labels are assigned per node CFI Check Exit(B) == Label_1 [Label_3, Label_4, Label_5] A Basic Block B Label_2 Label Label_3 C D Label_4 E F Label_5 Label_6 Label Granularity: Trade-Offs (2/2) Optimization step: Merge labels to allow single CFI check However, this allows for unintended control-flow paths CFI Check Exit(B) == Label_3 A Label_1 Basic Block B Label_2 Label Label_3 C D Label_3Label_4 Exit(C) == Label_3 E F Label_5Label_3 Label_6 Label Problem for Returns Static CFI label checking Shadow stack allows for leads to coarse-grained fine-grained return protection for returns address protection but incurs higher overhead Forward- CALL RET Edge CFI Backup State Check Label_1 Label_2 Shadow Stack A‘ A B B‘ Backup storage for CALL return addresses R Return Addr … … RET Backward -Edge CFI Exit(R) == [Label_1, Label_2] Return Addr A’ Forward- vs. Backward-Edge Some CFI schemes consider only forward-edge CFI Google’s VTV and IFCC [Tice et al., USENIX Sec 2015] SAFEDISPATCH [Jang et al., NDSS 2014] And many more: TVIP, VTint, vfguard Assumption: Backward-edge CFI through stack protection Problems of stack protections: Stack Canaries: memory disclosure of canary ASLR (base address randomization of stack): memory disclosure of base address Variable reordering (memory disclosure) Losing Control: On the Effectiveness of Control-Flow Integrity under Stack Attacks ACM CCS 2015 Christopher Liebchen, Marco Negro, Per Larsen, Lucas Davi, Ahmad-Reza Sadeghi, Stephen Crane, Mohaned Qunaibit, Michael Franz, Mauro Conti StackDefiler • Goal: • Bypass fine-grained Control-Flow Integrity • IFCC & VTV (CFI implementations by Google for GCC and LLVM) • Approach: • Due to optimization by compiler critical CFI pointer is spilled on the stack • StackDefiler discloses the stack address and overwrites the spilled CFI pointer • At restoring of spilled registers a malicious CFI pointer is used for future CFI checks • No stack-based vulnerability needed Bypassing (Coarse-grained) CFI COOP IEEE S&P 2015 USENIX Security 2014 Felix Schuster, Thomas Tendyck, Lucas Davi, Daniel Lehmann, Christopher Liebchen, Lucas Davi, Ahmad-Reza Sadeghi, Fabian Monrose Ahmad-Reza

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    62 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us