1. 代码审计

      1. <?php
      2. error_reporting(0);
      3. highlight_file(__FILE__);
      4. $url=$_POST['url'];
      5. $x=parse_url($url);
      6. if($x['scheme']==='http'||$x['scheme']==='https'){
      7. $host=$x['host'];
      8. if((strlen($host)<=3))
      9. //继续对ip/域名长度限制
      10. {
      11. $ch=curl_init($url);
      12. curl_setopt($ch, CURLOPT_HEADER, 0);
      13. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      14. $result=curl_exec($ch);
      15. curl_close($ch);
      16. echo ($result);
      17. }
      18. else{
      19. die('hacker');
      20. }
      21. }
      22. else{
      23. die('hacker');
      24. }
      25. ?>
    2. 还是上一题的用特殊方法进行绕过

      #POST方法
      url=http://0/flag.php