PHP头条
热点:

PHP中伪造HTTP_REFERER代码


 

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

 

www.phpzy.comtrue/phprm/23562.htmlTechArticlePHP中伪造HTTP_REFERER代码 error_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 $ referer = http://www.php100...

相关文章

    暂无相关文章

PHP之友评论

今天推荐