晚上打开碎碎念,浏览器等了好久才开始载入页面。当时我以为是服务商的带宽问题,也没多想慢就慢吧,总比打不开强。
打开后,问题就来了,我看到在右下角弹出了一个600px的广告框,说的是某国内厂商的空调。
打开firebug进行调试,发现页面被改写成了框架结构,网站首页和广告部分用框架分离了。
松了口气,从代码的特征看,这不是挂马,而是浙江电信的广告推送干的好事。
之前抓马的时候也遇到过推送广告干扰日志的事情,但因为推送的频率不固定,往往很难收集到样本,今天居然给我遇上了,趁机分析一下。
浙江电信此次的推送广告工作方式很简单。
第一步:确保用户使用他们的dns服务器:
1 2 3 4 5 | 202.101.172.46 202.101.172.47 202.101.172.48 202.101.172.35 当然,还有更多。 |
第二步:通过dns,将地址改写为你要访问的网站地址,例如访问本站就这样改写:
1 | http://115.238.20.86/hangzmidea/index.html?url=http://www.alexblair.org |
当然,由于js的原因,用户在地址栏上看到的还是http://www.alexblair.org
这样就造成了广告是由网站提供的,而不是电信强制推送的假象(真TMD邪恶,典型的强奸了别人还赖对方主动。)
第三步:广告必定要有统计。电信这次很聪明,不再单独使用cnzz或者yahoo这些公共统计商的服务了,而是采用北京IZP的广告发布管理系统配合cnzz来进行统计。统计代码也从js改为了image格式,这样就排除了浏览器差异化。
1 2 3 4 5 | <!-- izptongji --> <img src="http://d.izptec.com/t/count/count.com.php?website=100088&image=countlogo1.gif" alt="IZPSTAT 统计" style="border:0" /> <!-- izptongji --> <script src="http://s24.cnzz.com/stat.php?id=1799301&web_id=1799301&show=pic1" language="JavaScript" charset="gb2312"></script> |
如果说本次广告推送仅仅是丢出一个弹框,那也太小看电信了。
接下来,如果用户点击了广告,那么就会跳转到:http://115.238.20.86/hangzmidea/clicked.htm这个页面,然后由这个页面转跳到目标客户的网页。
别小瞧了这个0.1秒的小页面。关键就在这里!
我们先看页面内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | < !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- izptongji --> <img src="http://d.izptec.com/t/count/count.com.php?website=100088&image=countlogo1.gif" alt="IZPSTAT 统计" style="border:0" /> <!-- izptongji --> <!-- phpstat.net --> <script language="JavaScript" type="text/javascript"> var _PCSWebSite="100088"; var _PCSImage="countlogo1.gif";</script> <script language="JavaScript" type="text/javascript" src="http://d.izptec.com/t/count/count.js" ></script> <!-- /phpstat.net --> <script language=javascript> window.location="http://www.zjmdkt.com.cn/Shownews.asp?ID=248"; </script> <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>clicked</title></meta></head><body></body></html> |
大家可以注意到这点:
1 2 3 | <!-- izptongji --> <img src="http://d.izptec.com/t/count/count.com.php?website=100088&image=countlogo1.gif" alt="IZPSTAT 统计" style="border:0" /> <!-- izptongji --> |
点击和弹窗的统计是同一个,也就是说,电信将最终用户转化数和广告曝光率混在一起统计了。果然流氓!
最后,公布一下本次拦截跳转程序的源代码:比较长,大家将就着看~
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 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | <html> <head> <title>PV</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> <!-- body { margin: 0px; padding: 0px; overflow: hidden; } --> </style> <script language="javascript"> function QueryString(fieldName) { var urlString = document.location.search; if(urlString != null) { var typeQu = fieldName+"="; var urlEnd = urlString.indexOf(typeQu); if(urlEnd != -1) { var paramsUrl = urlString.substring(urlEnd+typeQu.length); var isEnd = paramsUrl.indexOf('&'); if(isEnd != -1) { return paramsUrl.substring(0, isEnd); } else { return paramsUrl; } } else return null; } else return null; } var url = QueryString("url"); </script> </meta></head> <body onload='implement();setTimeout("hideDiv()",120000)'> <iframe id="fulliframe" LANG="utf-8" name="fulliframe" src="" width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0"></iframe> <!-- START ** LOADING --> <script language="JavaScript" type="text/javascript"> frames['fulliframe'].location = url; </script> <!-- END ** LOADING --> <!-- START POP UP NEW WINDOW --> <script language="JavaScript" type="text/javascript"> var msgWinTop,msgWinLeft,msgWinWidth,msgWinHeight,mainWinHeight,mainWinWidth; var oTimer; var isFF = (navigator.userAgent.indexOf("Firefox")>0); var DEFAULT_MSGTITLE = "提示"; var DEFAULT_MSGICON = ""; var DEFAULT_MSGCONTENT = "ad_con1.html"; var DEFAULT_MSGTIME =3000; var browserName = navigator.appName; var tipTime; var control=false; var cnc=true; var cnc1=true; var dW; // dest window object var dWDoc; // dest window document object function resizeMainWin() { if (browserName == "Microsoft Internet Explorer") { msgWinHeight = parseInt(dWDoc.getElementById("msgWin").offsetHeight,10); msgWinWidth = parseInt(dWDoc.getElementById("msgWin").offsetWidth,10); mainWinWidth = dWDoc.body.clientWidth; mainWinHeight = dWDoc.body.clientHeight; dWDoc.getElementById("msgWin").style.top = mainWinHeight - msgWinHeight + parseInt(dWDoc.body.scrollTop,10); dWDoc.getElementById("msgWin").style.left = mainWinWidth - msgWinWidth + parseInt(dWDoc.body.scrollLeft,10); } if(browserName=="Netscape") { // alert("Netscape"); } } function moveUpMsgWin() { try { if (parseInt(dWDoc.getElementById("msgWin").style.top,10) < = (mainWinHeight - msgWinHeight + parseInt(dWDoc.body.scrollTop,10))) { window.clearInterval(oTimer); oTimer = window.setTimeout("holdOnMsgWin()", tipTime); control=true; if (!cnc) { delMove(); cnc=true; } } msgWinTop = parseInt(dWDoc.getElementById("msgWin").style.top,10); dWDoc.getElementById("msgWin").style.top = msgWinTop - 2; //inframe=setInterval("intervalframe()",10); intervalframe(); } catch (e) { /// do nothing } } function moveDownMsgWin() { try { if(parseInt(dWDoc.getElementById("msgWin").style.top,10) >= (mainWinHeight + parseInt(dWDoc.body.scrollTop,10))) { closeMsgWin(); dWDoc.getElementById("msgWin").removeNode(true); } msgWinTop = parseInt(dWDoc.getElementById("msgWin").style.top,10); dWDoc.getElementById("msgWin").style.top = msgWinTop + 2; control=false; } catch (e) { /// do nothing } } function intervalframe() { GetObj("msgWin").onmouseover=new Function("delMove()"); GetObj("msgWin").onmouseout=new Function("holdOnMsgWin()"); } function holdOnMsgWin() { //oTimer = window.setInterval("moveDownMsgWin()",1); } function closeMsgWin() { try { if(oTimer) { window.clearInterval(oTimer); dWDoc.body.removeChild(dWDoc.getElementById('msgWin')); } } catch(e) { /// do nothing } } function popUp(dstWin, msgTitle, msgTime) { try { var objWin = eval(dstWin); if (isFF) { if (objWin.document.body==null) { oTimer = window.setTimeout("popUp("" + dstWin + "", "" + msgTitle + "", " + msgTime + ")", 5); return; } } else { if (objWin.document.readyState!="complete") { oTimer = window.setTimeout("popUp("" + dstWin + "", "" + msgTitle + "", " + msgTime + ")", 5); return; } } if(oTimer) { window.clearTimeout(oTimer); } dstWin = eval(dstWin); if (dstWin==null) { return; } dW = dstWin.window; dWDoc = dW.document; dWDoc.body.onresize = resizeMainWin; if (msgTitle=="") { tipTime = (msgTime==null)?DEFAULT_MSGTIME:msgTime; } var mw = dWDoc.createElement("div"); mw.id = "msgWin"; mw.style.position = "absolute"; //mw.style.visibility = "hidden"; mw.style.zIndex = "100"; mw.style.top = "0px"; mw.style.left = "0px"; mw.style.width = "260"; mw.style.height = "80px"; mw.style.filter="alpha(opacity=100)"; var ostr="<div id='sd' style='z-index:1000;margin-left:243px;margin-top:1px;position:absolute;width:17px;height:17px;'>"; ostr+="<a href='javascript: hideDiv()' title='关闭' onclick="javascript:openone()"><img src='close.gif' onmouseover=javascript:{this.src='close.gif';} onmouseout=javascript:{this.src='close.gif';} width='16px' height='16px' border='0px'/></a>"; ostr+="</div>"; ostr += "<table border=0 cellpadding=0 cellspacing=0 width='262px' height='192px'>"; ostr += "<tr>"; ostr += "<td width='262px' height='192px' align=center>"; ostr += "<iframe src="+DEFAULT_MSGCONTENT+" frameborder=0 scrolling=no width='262px' height='192px'></iframe>"; ostr += "</td>"; ostr += "</tr>"; ostr += "</table>"; mw.innerHTML = ostr; dWDoc.body.appendChild(mw); if (browserName == "Microsoft Internet Explorer") { msgWinTop = parseInt(mw.style.top,10); msgWinLeft = parseInt(mw.style.left,10); msgWinHeight = parseInt(mw.offsetHeight,10); msgWinWidth = parseInt(mw.offsetWidth,10); mainWinWidth = dWDoc.body.clientWidth; mainWinHeight = dWDoc.body.clientHeight; mw.style.top = parseInt(dWDoc.body.scrollTop,10) + mainWinHeight + 10;// msgWinHeight mw.style.left = parseInt(dWDoc.body.scrollLeft,10) + mainWinWidth - msgWinWidth-20; mw.style.visibility="visible"; beginMove(); } if (browserName=="Netscape") { msgWinTop = parseInt(mw.style.top,10); msgWinLeft = parseInt(mw.style.left,10); msgWinHeight = parseInt(mw.offsetHeight,10)+100; msgWinWidth = parseInt(mw.offsetWidth,10); mainWinWidth = window.innerWidth; mainWinHeight =window.innerHeight; mw.style.top = document.documentElement.scrollTop + window.innerHeight-document.getElementById("msgWin").offsetHeight+"px";// msgWinHeight mw.style.left = window.innerWidth -document.getElementById("msgWin").offsetWidth-20+"px"; mw.style.visibility="visible"; beginMove(); } } catch(e) { /// do nothing } } function GetObj(objName) { if(document.getElementById) { return eval('document.getElementById("' + objName + '")'); } else if(document.layers) { return eval("document.layers['" + objName +"']"); } else { return eval('document.all.' + objName); } } function hideDiv() { closemsgWin(); } function openone() { window.open('clicked.htm','colortext2'); } function delMove() { if(control) { clearInterval(oTimer); window.clearTimeout(oTimer); } cnc=false; } function closemsgWin() { document.getElementById("msgWin").style.visibility="hidden"; document.getElementById("msgWin").removeNode(true); } var alpha_show = null; var step = 10; var cur_type = 100; function hide(the_layer) { clearTimeout(alpha_show); cur_type-=step; if(cur_type<0) { cur_type = 0; the_layer.filters.alpha.opacity = cur_type; alpha_show = null; the_layer.removeNode(true); } else { the_layer.filters.alpha.opacity = cur_type; alpha_show = setTimeout("hide("+the_layer.id+")",100) } } function beginMove() { if (!control) { oTimer=window.setInterval("moveUpMsgWin()",1); } } var bubbles = 0; function implement() { if (bubbles==0) { popUp("window", "", 3000); bubbles = 1; } } </script> <!-- izptongji --> <img src="http://d.izptec.com/t/count/count.com.php?website=100088&image=countlogo1.gif" alt="IZPSTAT 统计" style="border:0" /> <!-- izptongji --> <script src="http://s24.cnzz.com/stat.php?id=1799301&web_id=1799301&show=pic1" language="JavaScript" charset="gb2312"></script> <!-- END POP UP NEW WINDOW --> </body> </html> |
7条评论
恩,这个问题我也碰到过,唉~无奈啊
其实,自己遇到并不怕。
就是电信的广告实在美工太差,挂在网站上,把自己的网站弄的山寨位十足。万一对方是第一次来这里,留下不好的印象就不好了
话说我前两天上卡饭也是…… 突然右下角多了个奇怪的广告…( ̄▽ ̄;) 加入过滤…刷新一下就清净了(笑) 很可能是电信干的好事
额…… 怎么看这头像跟细菌病毒一样…………(;´°д°`)
哈哈,这个是随机变化的~~
xiaoxiaomeng:
要更改自己头像看这里把:
http://www.alexblair.org/user-alexblair-post-900.html
我还以为那些细菌头像是A大的特别嗜好呢o(^-^ )