SlideShare una empresa de Scribd logo
1 de 29
Generic exploitation of invalid memory writes Jonathan Brossard CEO – Toucan System jonathan@ toucan-system.com
Agenda ,[object Object],Determining the type of error Taxonomy of invalid memory access Memory permissions Introduction
Introduction Maybe you did some fuzzing and found some bugs ? Welcome in 2010 : exploitation is more difficult than finding trivial bugs. The goal of this talk is to detail (and automate !) the steps to successful exploitation of invalid memory writes.
Memory permissions This is  the  key to modern exploitation...
Memory permissions Under x86 : permissions are set at MMU (+ Kernel) level using three flags : R : read permission W : write permission X : execution permission 5 years back, everything was in fact +X !!
Memory permissions Where to get my shellcode executed in memory ?? Alternatively (when not using shellcode) : where to return in memory to execute something usefull (think ROP).
Memory permissions What is or not executable depends on : - your cpu (NX flag) + BIOS Config. - your kernel (PaX, PAE...) and more globally your toolchain. - the dynamic loader (shared libs).
DEMO Using readelf and /proc/pid/maps to check what permissions  should  be. Using paxtest to verify what is  actually  executable or not.
Taxonomy of invalid memory access What's the impact of this bug ? int main(int argc, char **argv){ printf(argv[1]) ; return 0; }
Exemple 1 Truth is : we  can't  know from C source : we have to check at instruction level to see if the c library was actually built with a write primitive...
Segfault at... mov  DWORD PTR [eax], edx eax  0x4000e030 ecx  0xbffff848 edx  0x0 ebx  0x40199ff4 => Invalid write.
(more complex) exemple: fld  QWORD PTR [eax+0x8] => Read ? Write ? Both ??
DEMO Triggering the bug in xpdf Determining the error type of complex bugs using valgrind
Summarizing At instruction level, an invalid memory access can be of three kinds : - invalid read - invalid write - invalid exec
Exploiting invalid exec Trivial if jump location is user controled. eg : call [eax] Exploitation strategy : Have eax pointing to our shellcode
Exploiting invalid exec (2/2) Fairly rare in userland Used to be a major problem in kernel land (invalid Null ptr dereference in exec mode from kernel land). First page not mappable without privs since kernel 2.6.23
Exploiting invalid reads Cannot hijack control flow directly :( Exploitation strategy: - Either use no memory corruption (eg : information leakage) - Or trigger a bug latter in the code (either invalid exec or invalid write) - … Or it is just plain non exploitable :(
Exploiting invalid writes This is the meat ! Exploitation strategy : - Either overwrite important data (eg : tast_struct->uid in kernel land) - Or try to hijack the control flow
The case of invalid writes : different levels of control X86 allows accessing either : - 8 bytes - 4 bytes (most instructions) - 2 bytes - 1 byte
The case of invalid writes : different levels of control - If both destination and value are fully user controled : overwrite .dtors, liked list in at_exit, function pointers... (ideal case such as missing format strings, easy !) - If only destination is user controled : attempt a pointer truncation on a given function pointer.
Problem is... Out of 3Gb of user land, how to find a suitable function pointer to overwrite or truncate ?
Exploitation strategy - Dump the content of every section of the binary - Parse the +W ones - Check for pointers to +X locations => exhaustive, reduced list of potential candidates. Then chose one based on actual binary constraints (will truncation point to a user controled location ?)
DEMO Triggering an invalid write in Opera Using livedump to chose potential candidates
Memory alignement Most Intel instructions only allow reads/writes on aligned boundaries. Typically : 4b aligned memory
(Common) Worst case scenario If only 0x00000000 can be written, in 4b aligned memory locations... => Then pointer truncation won't be possible on 4b aligned sections :-(
Naive exploitation strategy  - Trigger the bug - set a signal handler for signal 5 which re enables single stepping - set the « trap » cpu flag => Single step until exit and monitor unaligned reads/writes. => Slow, painfull, per thread :(
Elite exploitation strategy with livedump - Trigger the bug - set the « align » cpu flag - setup a signal handler for SIGBUS => every read/write to unaligned memory will be trapped and give potential truncation candidates
DEMO Using livedump to detect unaligned memory access
Questions ? Thank you for coming

Más contenido relacionado

Similar a [h2hc] Generic exploitation of invalid memory writes

Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]RootedCON
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory AnalysisMoabi.com
 
Valgrind debugger Tutorial
Valgrind debugger TutorialValgrind debugger Tutorial
Valgrind debugger TutorialAnurag Tomar
 
Csw2016 economou nissim-getting_physical
Csw2016 economou nissim-getting_physicalCsw2016 economou nissim-getting_physical
Csw2016 economou nissim-getting_physicalCanSecWest
 
[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit AutomationMoabi.com
 
[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory AnalysisMoabi.com
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory AnalysisMoabi.com
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Vincenzo Iozzo
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debuggingHao-Ran Liu
 
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012DefCamp
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in LinuxRaghu Udiyar
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentMohammed Farrag
 
Potapenko, vyukov forewarned is forearmed. a san and tsan
Potapenko, vyukov   forewarned is forearmed. a san and tsanPotapenko, vyukov   forewarned is forearmed. a san and tsan
Potapenko, vyukov forewarned is forearmed. a san and tsanDefconRussia
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersYury Chemerkin
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - RoutersLogicaltrust pl
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and DriversKernel TLV
 
5.6 Basic computer structure microprocessors
5.6 Basic computer structure   microprocessors5.6 Basic computer structure   microprocessors
5.6 Basic computer structure microprocessorslpapadop
 
How to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by IvanHow to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by IvanIvan Silva
 

Similar a [h2hc] Generic exploitation of invalid memory writes (20)

Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
 
Valgrind debugger Tutorial
Valgrind debugger TutorialValgrind debugger Tutorial
Valgrind debugger Tutorial
 
Csw2016 economou nissim-getting_physical
Csw2016 economou nissim-getting_physicalCsw2016 economou nissim-getting_physical
Csw2016 economou nissim-getting_physical
 
[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation
 
[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
 
Advanced Arm Exploitation
Advanced Arm ExploitationAdvanced Arm Exploitation
Advanced Arm Exploitation
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in Linux
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports Development
 
Potapenko, vyukov forewarned is forearmed. a san and tsan
Potapenko, vyukov   forewarned is forearmed. a san and tsanPotapenko, vyukov   forewarned is forearmed. a san and tsan
Potapenko, vyukov forewarned is forearmed. a san and tsan
 
Valgrind
ValgrindValgrind
Valgrind
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routers
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - Routers
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and Drivers
 
5.6 Basic computer structure microprocessors
5.6 Basic computer structure   microprocessors5.6 Basic computer structure   microprocessors
5.6 Basic computer structure microprocessors
 
How to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by IvanHow to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by Ivan
 

Más de Moabi.com

[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler CollectionMoabi.com
 
[Blackhat2015] FileCry attack against Internet Explorer
[Blackhat2015] FileCry attack against Internet Explorer[Blackhat2015] FileCry attack against Internet Explorer
[Blackhat2015] FileCry attack against Internet ExplorerMoabi.com
 
[Blackhat2015] FileCry attack against Java
[Blackhat2015] FileCry attack against Java[Blackhat2015] FileCry attack against Java
[Blackhat2015] FileCry attack against JavaMoabi.com
 
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES... #Whitepaper
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES... #Whitepaper[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES... #Whitepaper
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES... #WhitepaperMoabi.com
 
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES...
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES...[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES...
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES...Moabi.com
 
[2013 syscan360] Jonathan Brossard_katsuni理论介绍以及在沙盒和软件仿真方面的应用
[2013 syscan360] Jonathan Brossard_katsuni理论介绍以及在沙盒和软件仿真方面的应用[2013 syscan360] Jonathan Brossard_katsuni理论介绍以及在沙盒和软件仿真方面的应用
[2013 syscan360] Jonathan Brossard_katsuni理论介绍以及在沙盒和软件仿真方面的应用Moabi.com
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practicalMoabi.com
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slidesMoabi.com
 
Hardware backdooring is practical
Hardware backdooring is practicalHardware backdooring is practical
Hardware backdooring is practicalMoabi.com
 
[Hackito2012] Hardware backdooring is practical
[Hackito2012] Hardware backdooring is practical[Hackito2012] Hardware backdooring is practical
[Hackito2012] Hardware backdooring is practicalMoabi.com
 
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...Moabi.com
 
[Ruxcon] Breaking virtualization by switching the cpu to virtual 8086 mode
[Ruxcon] Breaking virtualization by switching the cpu to virtual 8086 mode[Ruxcon] Breaking virtualization by switching the cpu to virtual 8086 mode
[Ruxcon] Breaking virtualization by switching the cpu to virtual 8086 modeMoabi.com
 
[DEFCON] Bypassing preboot authentication passwords by instrumenting the BIOS...
[DEFCON] Bypassing preboot authentication passwords by instrumenting the BIOS...[DEFCON] Bypassing preboot authentication passwords by instrumenting the BIOS...
[DEFCON] Bypassing preboot authentication passwords by instrumenting the BIOS...Moabi.com
 
[DEFCON 16] Bypassing pre-boot authentication passwords by instrumenting the...
[DEFCON 16] Bypassing pre-boot authentication passwords  by instrumenting the...[DEFCON 16] Bypassing pre-boot authentication passwords  by instrumenting the...
[DEFCON 16] Bypassing pre-boot authentication passwords by instrumenting the...Moabi.com
 

Más de Moabi.com (14)

[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection
 
[Blackhat2015] FileCry attack against Internet Explorer
[Blackhat2015] FileCry attack against Internet Explorer[Blackhat2015] FileCry attack against Internet Explorer
[Blackhat2015] FileCry attack against Internet Explorer
 
[Blackhat2015] FileCry attack against Java
[Blackhat2015] FileCry attack against Java[Blackhat2015] FileCry attack against Java
[Blackhat2015] FileCry attack against Java
 
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES... #Whitepaper
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES... #Whitepaper[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES... #Whitepaper
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES... #Whitepaper
 
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES...
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES...[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES...
[Blackhat2015] SMB : SHARING MORE THAN JUST YOUR FILES...
 
[2013 syscan360] Jonathan Brossard_katsuni理论介绍以及在沙盒和软件仿真方面的应用
[2013 syscan360] Jonathan Brossard_katsuni理论介绍以及在沙盒和软件仿真方面的应用[2013 syscan360] Jonathan Brossard_katsuni理论介绍以及在沙盒和软件仿真方面的应用
[2013 syscan360] Jonathan Brossard_katsuni理论介绍以及在沙盒和软件仿真方面的应用
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slides
 
Hardware backdooring is practical
Hardware backdooring is practicalHardware backdooring is practical
Hardware backdooring is practical
 
[Hackito2012] Hardware backdooring is practical
[Hackito2012] Hardware backdooring is practical[Hackito2012] Hardware backdooring is practical
[Hackito2012] Hardware backdooring is practical
 
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
 
[Ruxcon] Breaking virtualization by switching the cpu to virtual 8086 mode
[Ruxcon] Breaking virtualization by switching the cpu to virtual 8086 mode[Ruxcon] Breaking virtualization by switching the cpu to virtual 8086 mode
[Ruxcon] Breaking virtualization by switching the cpu to virtual 8086 mode
 
[DEFCON] Bypassing preboot authentication passwords by instrumenting the BIOS...
[DEFCON] Bypassing preboot authentication passwords by instrumenting the BIOS...[DEFCON] Bypassing preboot authentication passwords by instrumenting the BIOS...
[DEFCON] Bypassing preboot authentication passwords by instrumenting the BIOS...
 
[DEFCON 16] Bypassing pre-boot authentication passwords by instrumenting the...
[DEFCON 16] Bypassing pre-boot authentication passwords  by instrumenting the...[DEFCON 16] Bypassing pre-boot authentication passwords  by instrumenting the...
[DEFCON 16] Bypassing pre-boot authentication passwords by instrumenting the...
 

[h2hc] Generic exploitation of invalid memory writes

  • 1. Generic exploitation of invalid memory writes Jonathan Brossard CEO – Toucan System jonathan@ toucan-system.com
  • 2.
  • 3. Introduction Maybe you did some fuzzing and found some bugs ? Welcome in 2010 : exploitation is more difficult than finding trivial bugs. The goal of this talk is to detail (and automate !) the steps to successful exploitation of invalid memory writes.
  • 4. Memory permissions This is the key to modern exploitation...
  • 5. Memory permissions Under x86 : permissions are set at MMU (+ Kernel) level using three flags : R : read permission W : write permission X : execution permission 5 years back, everything was in fact +X !!
  • 6. Memory permissions Where to get my shellcode executed in memory ?? Alternatively (when not using shellcode) : where to return in memory to execute something usefull (think ROP).
  • 7. Memory permissions What is or not executable depends on : - your cpu (NX flag) + BIOS Config. - your kernel (PaX, PAE...) and more globally your toolchain. - the dynamic loader (shared libs).
  • 8. DEMO Using readelf and /proc/pid/maps to check what permissions should be. Using paxtest to verify what is actually executable or not.
  • 9. Taxonomy of invalid memory access What's the impact of this bug ? int main(int argc, char **argv){ printf(argv[1]) ; return 0; }
  • 10. Exemple 1 Truth is : we can't know from C source : we have to check at instruction level to see if the c library was actually built with a write primitive...
  • 11. Segfault at... mov DWORD PTR [eax], edx eax 0x4000e030 ecx 0xbffff848 edx 0x0 ebx 0x40199ff4 => Invalid write.
  • 12. (more complex) exemple: fld QWORD PTR [eax+0x8] => Read ? Write ? Both ??
  • 13. DEMO Triggering the bug in xpdf Determining the error type of complex bugs using valgrind
  • 14. Summarizing At instruction level, an invalid memory access can be of three kinds : - invalid read - invalid write - invalid exec
  • 15. Exploiting invalid exec Trivial if jump location is user controled. eg : call [eax] Exploitation strategy : Have eax pointing to our shellcode
  • 16. Exploiting invalid exec (2/2) Fairly rare in userland Used to be a major problem in kernel land (invalid Null ptr dereference in exec mode from kernel land). First page not mappable without privs since kernel 2.6.23
  • 17. Exploiting invalid reads Cannot hijack control flow directly :( Exploitation strategy: - Either use no memory corruption (eg : information leakage) - Or trigger a bug latter in the code (either invalid exec or invalid write) - … Or it is just plain non exploitable :(
  • 18. Exploiting invalid writes This is the meat ! Exploitation strategy : - Either overwrite important data (eg : tast_struct->uid in kernel land) - Or try to hijack the control flow
  • 19. The case of invalid writes : different levels of control X86 allows accessing either : - 8 bytes - 4 bytes (most instructions) - 2 bytes - 1 byte
  • 20. The case of invalid writes : different levels of control - If both destination and value are fully user controled : overwrite .dtors, liked list in at_exit, function pointers... (ideal case such as missing format strings, easy !) - If only destination is user controled : attempt a pointer truncation on a given function pointer.
  • 21. Problem is... Out of 3Gb of user land, how to find a suitable function pointer to overwrite or truncate ?
  • 22. Exploitation strategy - Dump the content of every section of the binary - Parse the +W ones - Check for pointers to +X locations => exhaustive, reduced list of potential candidates. Then chose one based on actual binary constraints (will truncation point to a user controled location ?)
  • 23. DEMO Triggering an invalid write in Opera Using livedump to chose potential candidates
  • 24. Memory alignement Most Intel instructions only allow reads/writes on aligned boundaries. Typically : 4b aligned memory
  • 25. (Common) Worst case scenario If only 0x00000000 can be written, in 4b aligned memory locations... => Then pointer truncation won't be possible on 4b aligned sections :-(
  • 26. Naive exploitation strategy - Trigger the bug - set a signal handler for signal 5 which re enables single stepping - set the « trap » cpu flag => Single step until exit and monitor unaligned reads/writes. => Slow, painfull, per thread :(
  • 27. Elite exploitation strategy with livedump - Trigger the bug - set the « align » cpu flag - setup a signal handler for SIGBUS => every read/write to unaligned memory will be trapped and give potential truncation candidates
  • 28. DEMO Using livedump to detect unaligned memory access
  • 29. Questions ? Thank you for coming