|
对PHP中伪造HTTP_REFERER代码感兴趣的小伙伴,下面一起跟随脚本之家 jb51.cc的小编两巴掌来看看吧!
/**
* PHP中伪造HTTP_REFERER代码
*
* @param
* @arrange 512-笔记网: jb51.cc
**/
//用fsockopen采集时,伪造referer的代码,
error_reporting( E_ERROR | E_WARNING | E_PARSE );
set_time_limit(0);
$server = 'www.phperz.com'; // IP address
$host = 'www.phperz.com'; // Domain name
$target = '/test.php?x=1'; // Specific program
$referer = 'http://www.phperz.com; // Referer
$port = 80;
$re = fsockopen($server,$port,$errno,$errstr,30);
if (!$re){
echo "<h1>无法连接远程服务器</h1><h3>$errstr ($errno)</h3/>n";
}
else {
$strhead = "GET $target HTTP/1.1rn";
$strhead .= "Host: $hostrn";
//$strhead .= "Cookie: PHPSESSIONIDSQTBQSDA=DFCAPKLBBFICDAFMHNKIGKEGrn";
$strhead .= "Referer: $refererrn";
$strhead .= "Connection: Closernrn";
fwrite($re,$strhead);
while (!feof($re)){
echo fgets($re,128);
}
fclose($re);
}
/*** 来自脚本之家 jb51.cc(jb51.cc) ***/ (编辑:安卓应用网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|