How to Make ASLR Win the Clone Wars: Runtime Re-Randomization
Kangjie Lu, Stefan Nürnberger, Michael Backes, and Wenke Lee
Georgia Tech, CISPA, Saarland University, MPI-SWS, DFKI
RuntimeASLR 1
How to Make ASLR Win the Clone Wars: Runtime Re-Randomization - - PowerPoint PPT Presentation
How to Make ASLR Win the Clone Wars: Runtime Re-Randomization Kangjie Lu , Stefan Nrnberger, Michael Backes, and Wenke Lee Georgia Tech, CISPA, Saarland University, MPI-SWS, DFKI RuntimeASLR 1 What did we do? We re-randomize the memory
Kangjie Lu, Stefan Nürnberger, Michael Backes, and Wenke Lee
Georgia Tech, CISPA, Saarland University, MPI-SWS, DFKI
RuntimeASLR 1
RuntimeASLR 2
Parent Child fork() code data code data
RuntimeASLR 3
RuntimeASLR 4
code data Run 1 code data Run 2 code data Run 3
RuntimeASLR 5
code data Run 1 code data Run 2 code data Run 3
RuntimeASLR 6
RuntimeASLR 7
Master code data Worker code data Worker code data Worker code data Worker processes (with same layout) fork() fork() fork() HTTP/HTTPS HTTP/HTTPS HTTP/HTTPS 1) The daemon process pre-forks multiple worker processes that handle users requests Daemon process
RuntimeASLR 8
code data Worker code data Worker code data Worker code data Worker processes (with same layout) fork() fork() fork() HTTP/HTTPS HTTP/HTTPS HTTP/HTTPS 1) The daemon process pre-forks multiple worker processes that handle users requests 2) The daemon will re-fork a new worker process if it crashes, to be robust Master Daemon process
RuntimeASLR 9
code data Worker code data Worker code data Worker code data Worker processes (with same layout) fork() fork() fork() HTTP/HTTPS HTTP/HTTPS HTTP/HTTPS 1) The daemon process pre-forks multiple worker processes that handle users requests 2) The daemon will re-fork a new worker process if it crashes, to be robust Master Daemon process
RuntimeASLR 10
RuntimeASLR 11
return address 12 34 56 78 9a bc ed f0 buffer Stack in remote server
RuntimeASLR 12
return address 12 34 56 78 9a bc ed f0 AAAAAAA 00 34 56 78 9a bc ed f0 buffer Stack in remote server Attack payload Crash, try another one
RuntimeASLR 13
return address 12 34 56 78 9a bc ed f0 AAAAAAA 00 34 56 78 9a bc ed f0 AAAAAAA 01 34 56 78 9a bc ed f0 buffer Stack in remote server Attack payload Crash, try another one Crash, try another one
RuntimeASLR 14
… return address 12 34 56 78 9a bc ed f0 AAAAAAA 00 34 56 78 9a bc ed f0 AAAAAAA 01 34 56 78 9a bc ed f0 AAAAAAA 12 34 56 78 9a bc ed f0 buffer … Stack in remote server Attack payload Crash, try another one Crash, try another one Bingo, continue to guess next byte
RuntimeASLR 15
… return address 12 34 56 78 9a bc ed f0 AAAAAAA 00 34 56 78 9a bc ed f0 AAAAAAA 01 34 56 78 9a bc ed f0 AAAAAAA 12 34 56 78 9a bc ed f0 buffer … Stack in remote server Attack payload Crash, try another one Crash, try another one Bingo, continue to guess next byte … … AAAAAAA 12 00 56 78 9a bc ed f0 …
RuntimeASLR 16
… return address 12 34 56 78 9a bc ed f0 AAAAAAA 00 34 56 78 9a bc ed f0 AAAAAAA 01 34 56 78 9a bc ed f0 AAAAAAA 12 34 56 78 9a bc ed f0 buffer … Stack in remote server Attack payload Crash, try another one Crash, try another one Bingo, continue to guess next byte … … AAAAAAA 12 00 56 78 9a bc ed f0 … … … AAAAAAA 12 34 56 78 9a bc ed f0 Finally, get all bytes
RuntimeASLR 17
… return address 12 34 56 78 9a bc ed f0 AAAAAAA 00 34 56 78 9a bc ed f0 AAAAAAA 01 34 56 78 9a bc ed f0 AAAAAAA 12 34 56 78 9a bc ed f0 buffer … Stack in remote server Attack payload Crash, try another one Crash, try another one Bingo, continue to guess next byte … … AAAAAAA 12 00 56 78 9a bc ed f0 … … … AAAAAAA 12 34 56 78 9a bc ed f0 Finally, get all bytes
RuntimeASLR 18
RuntimeASLR 19
RuntimeASLR 20
RuntimeASLR 21
Source pointers Pointer tracking policy All tracked pointers
RuntimeASLR 22
Source pointers Pointer tracking policy All tracked pointers
RuntimeASLR 23
Source pointers Pointer tracking policy All tracked pointers
RuntimeASLR 24
Source pointers Pointer tracking policy All tracked pointers
RuntimeASLR 25
instruction
Execution Process status Process status snapshot Memory and registers snapshot Instruction behaviors compare
RuntimeASLR 26
RuntimeASLR
rdi Multi-runs with ASLR-enabled … Run 1 Run 2 Run n
RuntimeASLR 28
b 264
RuntimeASLR 29
b 264
RuntimeASLR 30
RuntimeASLR 31
Source pointers Pointer tracking policy All tracked pointers
RuntimeASLR 32
Policy generator (pintool) Pointer tracker (pintool)
Randomizer (shared lib)
RuntimeASLR 33
RuntimeASLR 34
Without RuntimeASLR With RuntimeASLR
RuntimeASLR 35
RuntimeASLR 36
RuntimeASLR 37
RuntimeASLR 38
RuntimeASLR 39
RuntimeASLR 40
RuntimeASLR 41
RuntimeASLR 42
RuntimeASLR 43
RuntimeASLR 44