checksec

运行
直接输入就行

ida
名为vulnerable_function的函数,存在溢出

给输入分配的栈空间为0x88

利用思路
ret2libc
代码
'''
@Author : 白银
@Date : 2023-04-21 14:10:32
@LastEditors : 白银
@LastEditTime : 2023-04-21 14:36:09
@FilePath : /pwn/level3.py
@Description : https://buuoj.cn/challenges#jarvisoj_level3
@Attention :
@Copyright (c) 2023 by 白银 captain-jparrow@qq.com, All Rights Reserved.
'''
from pwn import *
from libcfind import *
set_arch = 2 # set_arch中,int,0→amd64,1→arm64,2→i386
pwnfile = './level3' # pwnfile, str,二进制文件
if_remote = 1 # if_remote,int,1→远程,别的数字→本地
# 打本地,if_remote改别的数字就可以,最后两个参数随便改
# set_arch = 0
if set_arch == 0:
context(log_level='debug', arch='amd64', os='linux')
elif set_arch == 1:
context(log_level=

文章描述了一个针对名为vulnerable_function的函数的栈溢出漏洞,利用ret2libc方法来构造exploit。通过ida分析,确定了栈空间大小和利用思路。使用python的pwn库进行远程或本地连接,寻找libc的write和system符号地址,最终获取shell并读取flag。
最低0.47元/天 解锁文章
630

被折叠的 条评论
为什么被折叠?



