baidut / GoHosts

【抱歉已经不能用了,由于新浪云欠费。。。没空修复了,抱歉!】Google hosts 最新可用hosts资源,一键式更新hosts工具!

Home Page:http://baidut.github.io/GoHosts/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[hosts.php]Checking your browser..

baidut opened this issue · comments

<title></title><pre><html><body><h2>Checking your browser..<h2><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("f2d344573530cd6ae987ecbee1c0759e");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";location.href="http://hosts.52zz.gq/download/?ckattempt=1";</script></body></html></pre>

问题原因:
网站防止爬虫抓取,甄别出伪装的浏览器。如CURLOPT_USERAGENT中存在spider字符串,则会返回403 Forbidden-nginx
CURL伪造CURLOPT_USERAGENT:curl_setopt($ch, CURLOPT_USERAGENT, "spider");
由于资源已经停止更新,所以不再采用该方法