ACTF2020_新生赛 BackupFile


[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"

文章作者: 0xdadream
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 0xdadream !
评论
  目录