返回列表 回复 发帖

使用socket代替fopen直接读取的PHP函数

作者: BigJim
可以伪装成本站来源和XP SP2的客户端,从而躲过一些站点的检查
  1. function get($url)
  2. {
  3. $url = eregi_replace(';^http://';, ';';, $url);
  4. $temp = explode(';/';, $url);
  5. $host = array_shift($temp);
  6. $path = ';/';.implode(';/';, $temp);
  7. $temp = explode(';:';, $host);
  8. $host = $temp[0];
  9. $port = isset($temp[1]) ? $temp[1] : 80;
  10. $fp = @fsockopen($host, $port, &$errno, &$errstr, 30);
  11. if ($fp)
  12. {
  13. @fputs($fp, "GET $path HTTP/1.1\r\n");
  14. @fputs($fp, "Host: $host\r\n");
  15. @fputs($fp, "Accept: */*\r\n");
  16. @fputs($fp, "Referer: http://$host/\r\n");
  17. @fputs($fp, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\r\n");
  18. @fputs($fp, "Connection: Close\r\n\r\n");
  19. }
  20. $Content = ';';;
  21. while ($str = @fread($fp, 4096))
  22. $Content .= $str;
  23. @fclose($fp);
  24. return $Content;
  25. }
复制代码
哈哈哈!!!!你的IP是不是?我都知道了!!!
返回列表