[BJDCTF2020]Mark loves cat
进入题目是一个博客首页
点了半天没找到可以利用的点,用dirsearch扫一下
扫到.git目录,用Githack把源码down下来
看一下关键代码
//flag.php
<?php
$flag = file_get_contents('/flag');
//index.php
<?php
include 'flag.php';
$yds = "dog";
$is = "cat";
$handsome = 'yds';
foreach($_POST as $x => $y){
$$x = $y;
}
foreach($_GET as $x => $y){
$$x = $$y;
}
foreach($_GET as $x => $y){
if($_GET['flag'] === $x