在burp中修改session为伪造后的新session并发送,可以看到flag。 flag:catctf{Catch_the_c4t_HaHa}
将/proc/self/maps 中内容存储在 test.txt 中,用来执行脚本: import reimport requestsmaps = open('攻防世界-catcat-new/test.txt') # 打开名为 'test.txt' 的文件并赋值给变量 mapsb = maps.read() # 读取文件内容并赋值给变量 blst = b.split('\\n') # 根据换行符 '\n' 将文件内容拆分为列表...
app.config['SECRET_KEY'] = str(uuid.uuid4()).replace("-","") +"*abcdefgh"ifos.path.isfile("/flag"): flag = cat("/flag") os.remove("/flag")@app.route('/', methods=['GET']) def index(): detailtxt = os.listdir('./details/') cats_list = []foriindetailtxt: cats_lis...
这里刻意的*abcdefgh是在提示我们secret key的格式ifos.path.isfile("/flag"):flag=cat("/flag")os.remove("/flag")#这里读取flag后删掉了flag,防止之前任意文件读取出非预期解@app.route('/',methods=['GET'])defindex():detailtxt=os.listdir('./details/')cats_list=[]foriindetailtxt:cats_list....
最后使用伪造的session来修改cookie并访问/admin。获得flag:catctf{Catch_the_c4t_HaHa} 三、补充知识 /proc/self/environ /proc/self/environ文件包含了当前进程的环境变量 /proc/self/fd 这是一个目录,该目录下的文件包含着当前进程打开的文件的内容和路径。这个fd比较重要,因为在Linux系统中,如果一个程序用 ope...