当前位置:Gxlcms > PHP教程 > PHP中伪造HTTP_REFERER代码_PHP教程

PHP中伪造HTTP_REFERER代码_PHP教程

时间:2021-07-01 10:21:17 帮助过:7人阅读

  1. error_reporting( E_ERROR | E_WARNING | E_PARSE );
  2. set_time_limit(0);
  3. $server = www.2cto.com; // IP address
  4. $host = www.2cto.com; // Domain name
  5. $target = /test.php?x=1; // Specific program
  6. $referer = http://www.php100.net/down/redirect.php?x=downurl&id=39&urlid=65; // Referer
  7. $port = 80;
  8. $re = fsockopen($server, $port, $errno, $errstr, 30);
  9. if (!$re){
  10. echo "<h1>无法连接远程服务器h1><h3>$errstr ($errno)h3/> ";
  11. }
  12. else {
  13. $strhead = "GET $target HTTP/1.1 ";
  14. $strhead .= "Host: $host ";
  15. //$strhead .= "Cookie: PHPSESSIONIDSQTBQSDA=DFCAPKLBBFICDAFMHNKIGKEG ";
  16. $strhead .= "Referer: $referer ";
  17. $strhead .= "Connection: Close ";
  18. fwrite($re, $strhead);
  19. while (!feof($re)){
  20. echo fgets($re, 128);
  21. }
  22. fclose($re);
  23. }

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/486043.htmlTechArticleerror_reporting(E_ERROR|E_WARNING|E_PARSE); set_time_limit(0); $ server = www.2cto.com ;//IPaddress $ host = www.2cto.com ;//Domainname $ target = /test.php?x=1 ;//Specificprogram...

人气教程排行