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

rop is s ll dangerous breaking modern defenses
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

ROP ¡is ¡S(ll ¡Dangerous: ¡Breaking ¡ Modern ¡Defenses ¡

David ¡Wagner ¡ Nicholas ¡Carlini ¡

slide-2
SLIDE 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 ¡

slide-3
SLIDE 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 ¡

  • f ¡stack ¡to ¡PC ¡
slide-4
SLIDE 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 ¡
slide-5
SLIDE 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 ¡

slide-6
SLIDE 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 ¡1st ¡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 ¡

slide-7
SLIDE 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 ¡
slide-8
SLIDE 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 ¡

slide-9
SLIDE 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 ¡

slide-10
SLIDE 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 ¡
slide-11
SLIDE 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 ¡