rop is s ll dangerous breaking modern defenses
play

ROP is S(ll Dangerous: Breaking Modern Defenses David - PowerPoint PPT Presentation

ROP is S(ll Dangerous: Breaking Modern Defenses David Wagner Nicholas Carlini Return Oriented Programming Basic ROP Mo(va(ons DEP Data


  1. ROP ¡is ¡S(ll ¡Dangerous: ¡Breaking ¡ Modern ¡Defenses ¡ David ¡Wagner ¡ Nicholas ¡Carlini ¡

  2. Return ¡Oriented ¡Programming ¡ • Basic ¡ROP ¡ – Mo(va(ons ¡ • DEP ¡– ¡Data ¡Execu(on ¡Preven(on ¡ – Goal ¡ • Cause ¡malicious ¡computa(on ¡without ¡injec(ng ¡code ¡ – How ¡it ¡works ¡ • Need ¡control ¡of ¡execu(on ¡flow ¡ • Gadgets ¡ – One ¡or ¡more ¡machine ¡instruc(ons ¡that ¡already ¡exist ¡in ¡text ¡of ¡ binary ¡

  3. ROP ¡Specifics ¡ • Call ¡ – Pushes ¡address ¡of ¡ next ¡machine ¡ instruc(on ¡onto ¡stack ¡ – Copies ¡into ¡PC ¡ address ¡of ¡branch ¡ target ¡ • Ret ¡ – Pops ¡word ¡from ¡top ¡ of ¡stack ¡to ¡PC ¡

  4. Defenses ¡Arise ¡ • 2 ¡broad ¡categories ¡ – Compile ¡(me ¡defenses ¡ • Recompile ¡binary ¡to ¡remove ¡gadgets ¡or ¡enforce ¡CFI ¡ – Run(me ¡defenses ¡ • Focus ¡of ¡this ¡paper ¡ • Kernel ¡code ¡checks ¡for ¡ROP ¡while ¡program ¡execu(ng ¡ • kBouncer ¡& ¡ROPecker ¡ • Hardware ¡Help ¡ – Intel’s ¡Last ¡Branch ¡Record ¡ • Records ¡16 ¡most ¡recent ¡indirect ¡branches ¡ • kBouncer ¡and ¡ROPecker ¡rely ¡on ¡this ¡

  5. Weaknesses ¡in ¡Today’s ¡Defenses ¡ • Call-­‑Preceded ¡ROP ¡ – Defenses ¡assume ¡ROP ¡will ¡consist ¡of ¡returns ¡to ¡ non-­‑call-­‑preceded ¡instruc(ons ¡ • Evasion ¡ – Chain ¡together ¡gadgets ¡in ¡a ¡way ¡that ¡they ¡do ¡not ¡ fit ¡defense’s ¡defini(on ¡of ¡malicious ¡ • History ¡Flushing ¡ – Chain ¡together ¡gadgets ¡in ¡a ¡way ¡that ¡malicious ¡ sequences ¡are ¡not ¡visible ¡to ¡defense ¡

  6. kBouncer ¡ • Uses ¡LBR ¡to ¡trace ¡recent ¡execu(on ¡and ¡detect ¡ROP ¡ • Inspec(on ¡runs ¡whenever ¡process ¡issues ¡system ¡call ¡ – 2 ¡checks ¡ • All ¡Ret ¡instruc(ons ¡in ¡LBR ¡previously ¡returned ¡to ¡call-­‑preceded ¡ addresses ¡ • No ¡more ¡than ¡7 ¡most ¡recent ¡indirect ¡branches ¡can ¡be ¡“gadget-­‑ like” ¡ – Exists ¡flow ¡of ¡execu(on ¡from ¡1 st ¡instruc(on ¡in ¡sequence ¡to ¡any ¡other ¡ indirect ¡branch ¡in ¡under ¡20 ¡instruc(ons ¡ • Problema(c ¡Assump(ons ¡ – Syscall ¡interface ¡ • Prepare ¡syscall ¡args ¡w/ ¡history ¡hiding ¡a_ack ¡and ¡issue ¡ syscall ¡w/ ¡evasion ¡a_ack ¡

  7. ROPecker ¡ • Runs ¡more ¡frequently ¡and ¡inspects ¡more ¡ thoroughly ¡compared ¡to ¡kBouncer ¡ – executable ¡set ¡ – Looks ¡into ¡future ¡as ¡well ¡as ¡past ¡ • Kill ¡process ¡if ¡11 ¡or ¡more ¡gadget-­‑like ¡sequences ¡of ¡ instruc(ons ¡are ¡executed ¡during ¡emula(on ¡ • Implica(ons ¡

  8. Fully ¡Call-­‑Preceded ¡A_acks ¡ • All ¡gadgets ¡start ¡with ¡an ¡instruc(on ¡ immediately ¡following ¡a ¡call ¡instruc(on ¡ • Insert ¡long ¡call-­‑preceded ¡gadget ¡every ¡few ¡ instruc(ons ¡to ¡evade ¡defenses ¡ • Experiment ¡with ¡10 ¡70KB ¡or ¡larger ¡binaries ¡ – Possible ¡exploit ¡strategy ¡for ¡all ¡10 ¡

  9. Real ¡World ¡Exploits ¡ • kBouncer ¡ – Mplayer ¡Lite ¡r33063 ¡ – Adobe ¡Reader ¡9.3.4 ¡ – Adobe ¡Flash ¡11.3.300 ¡ – Internet ¡Explorer ¡8 ¡ • ROPecker ¡ – hteditor ¡ – Both ¡pure ¡evasion ¡and ¡history ¡hiding ¡methods ¡ worked ¡

  10. Related ¡Work ¡ • ASLR ¡ – Make ¡more ¡difficult ¡to ¡inject ¡shellcode, ¡conduct ¡ROP ¡ a_acks ¡ • CFI ¡ – Restrict ¡branches ¡to ¡follow ¡control ¡flow ¡graph ¡ • Other ¡run(me ¡defenses ¡ – ROPGuard ¡ • Shadow ¡stack ¡ • Recompila(on-­‑based ¡defenses ¡ – Remove ¡gadgets ¡from ¡binaries, ¡encrypt ¡return ¡addresses ¡ – Return-­‑less ¡kernel ¡ • Table ¡of ¡valid ¡return ¡sites ¡

  11. Conclusion ¡ • Misconcep(ons ¡ – ROP ¡a_acks ¡only ¡consist ¡of ¡short ¡gadgets ¡ – ROP ¡a_acks ¡cannot ¡be ¡effec(vely ¡mounted ¡in ¡call-­‑ preceded ¡manner ¡ • Future ¡Goals ¡ – Iden(fy ¡characteris(cs ¡that ¡are ¡fundamental/ essen(al ¡to ¡ROP ¡ – Make ¡it ¡impossible ¡to ¡hide ¡malicious ¡execu(on ¡ from ¡kernel ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend