This is 赵峰 | 赵峰之城 | 赵峰的博客 !

伪造referer 破防盗链 或伪造访问量

HTTP-REFERER这个变量已经越来越不可靠了,完全就是可以伪造出来的东东。

以下是伪造方法:

ASP:

dim http
set http=server.createobject("MSXML2.XMLHTTP") '//MSXML2.serverXMLHTTP也可以
Http.open "GET",url,false
Http.setRequestHeader "Referer","http://www.dc9.cn/"
Http.send()

PHP(前提是装了curl):

$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "http://www.dc9.cn/xxx.asp");
curl_setopt ($ch, CURLOPT_REFERER, "http://www.dc9.cn/");
curl_exec ($ch);
curl_close ($ch);

PHP(不装curl用sock)

» 阅读全文

Records:912