2010
Ak ste čítali legendárny Smashing The Stack For Fun And Profit popisujúci Buffer Overflow techniky by Aleph One, isto Vás zaujme aj aktuálne PDF – Smashing the stack in 2010 z dielne Andrea Cugliari – Linuxová časť a Mariano Graziano – Windows z Júla tohto roku. Report Vás prevedie teoretickými vedomosťami a krátkymi praktickými zručnosťami. BO azda nepotrebuje vysvetlenie, no predsa – pretečenie vyrovnávacej pamäte alebo preplnenie vyrovnávacej pamäte (angl. buffer overflow, alebo aj buffer overrun) je chyba v programe, ktorá vedie k zápisu mimo vyhradeného priestoru v pamäti a k chybnému behu, prípadne aj k pádu programu. Pád programu je často prvým krokom k vytvoreniu PoC, resp. finálneho exploitu.
Smashing The Stack For Fun And Profit by Aleph One:
http://www.phrack.org/issues.html?issue=49&id=14&mode=txt
Smashing the stack in 2010 - Report for the Computer Security exam at the Politecnico di Torino:
http://mariano-graziano.llab.it/docs/report.pdf
Obsah:
ContentsI Introduction and Theoretical Background ………………………………………………. 51 Theoretical Background ………………………………………………………………….. 51.1 Processes and memory layout in x86 ………………………………………………… 51.2 Registers, Pointers and Assembler ……………………………………………………. 51.3 Stack layout in x86 …………………………………………………………………….. 81.4 Function call and termination …………………………………………………………. 91.5 Buffer Overflow issue …………………………………………………………………. 121.6 Shellcodes ……………………………………………………………………………… 13II Hands on Linux …………………………………………………………………………… 212 Setup Testbed environment ……………………………………………………………. 213 Linux buffer overflow ……………………………………………………………………. 223.1 How to change the flow of execution ………………………………………………. 223.2 How to spawn a Shell …………………………………………………………………. 273.3 Polite exit from a process: exit system call ………………………………………… 303.4 Write an exploit ………………………………………………………………………… 334 Protections against buffer overflow ……………………………………………………. 354.1 Programmers protections ……………………………………………………………… 354.2 System default protections …………………………………………………………… 364.2.1 Address Space Layout Randomization (ASLR) ……………………………………. 364.2.2 Stack Execute Invalidation (NX bit) ……………………………………………….. 394.3 Compiler and linker protections ……………………………………………………….. 414.3.1 StackShield (Optional) ………………………………………………………………. 414.3.2 StackGuard (Optional) ………………………………………………………………. 424.3.3 Stack Smashing Protector – ProPolice (Default installed) ………………………. 434.3.4 Run time checks ……………………………………………………………………… 434.4 Protections in a practical scenario …………………………………………………… 444.5 Combined Tricks in a future scenario ………………………………………………… 45III Hands on Windows ………………………………………………………………………. 475 Setup Testbed environment …………………………………………………………….. 476 Windows buffer overflow 101 …………………………………………………………… 486.1 How to change the flow execution ………………………………………………….. 486.2 How to spawn a shell ………………………………………………………………….. 526.3 ExitProcess system call ……………………………………………………………….. 566.4 Write an exploit ………………………………………………………………………… 597 Protections against buffer overflow ……………………………………………………. 607.1 Buer Security Check – /GS ……………………………………………………………. 617.2 /SafeSEH ……………………………………………………………………………….. 637.2.1 /GS & /SafeSEH possible tricks …………………………………………………. 637.3 Address Space Layout Randomization (ASLR) ……………………………………… 647.3.1 Address Space Layout Randomization (ASLR) possible tricks ………………….. 667.4 Data Execution Prevention (DEP) ……………………………………………………. 667.4.1 Data Execution Prevention (DEP) possible tricks ………………………………… 687.5 Runtime Checks ………………………………………………………………………… 687.6 Results …………………………………………………………………………………… 697.7 Today, tomorrow, the future …………………………………………………………. 707.8 Conclusions ……………………………………………………………………………… 71

















Žádný komentář.
Přidat komentář