攻防世界(CTF)~web-fileinclude
题目介绍
这题主要使用php伪协议来解
php://filter 是一个可以在 PHP 中进行数据过滤和流处理的协议。
题目主页告诉我们了一个目录和flag就在flag.php里面
先打开源码看一下有没有什么信息

发现一段php代码,我们来审计一下
<?php
if( !ini_get('display_errors') ) {
ini_set('display_errors', 'On');
}
error_reporting(E_ALL);
$lan = $_COOKIE['language'];
if(!$lan)
{
@setcookie("language","english");
@include("english.php");
}
else
{
@include($lan.".php");
}
$x=file_get_contents('index.php');
echo $x;
?>
第五行
$lan = $_COOKIE['language'];

浙公网安备 33010602011771号