' ----------------------------------------------------------------------------------- ' ' SircamRemover : a Public Domain Sircam Virus Remover utility ' ' by : "marcolfa & E. Gatto black anti-viri group" - Italy / it.comp.sicurezza.virus ' ' no copyrights ' ' Official release 1.3.1 for WNT - W2000 - WXP ' ' This Tool Modify Registry and file system, so be carefull! ' ' ' ' In order to remove Sircam you can also use this free tools I know: ' ' from marcolfa (the same author of this tool): ' ' http://users.iol.it/marrob/Sircam_sucks.vbs ' ' ' ' other aviable tools in alphabetic order ' ' from AVP (TM) ' ' http://www.avp.it/utility/nosircam.com ' ' ' ' from Central Command (TM) (needs e-mail registration): ' ' http://www.centralcommand.com/toolsregister.html ' ' ' ' from Macafee (TM) (Avert) ' ' http://download.nai.com/products/media/mcafeeb2b/zip/scrmove2.zip ' ' ' ' from Symantec (TM): ' ' http://www.symantec.com/avcenter/venc/data/w32.sircam.worm@mm.removal.tool.html ' ' ' ' from Sophos Anti-Virus (TM): ' ' http://www.sophos.com/support/faqs/sircam.html ' ' ----------------------------------------------------------------------------------- ' testo = "Questo tool determina se il Sircam è installato sul tuo PC e cancella i files del virus. " testo = testo & "Gli autori non si assumo alcuna responsabilità " testo = testo & "riguardo a possibili danni causati da uso proprio o improprio di questo script" MsgBox (testo) Msgbox "ATTENZIONE! Eseguire solo con permessi di ROOT! (Così possiamo fare più danni ;-))",16 scelta = MsgBox ("Se non sei ROOT clicca su ANNULLA, altrimenti clicca su OK per continuare", 17, "ATTENZIONE") If scelta = 2 Then Wscript.quit main Sub main() On Error Resume Next Set marcolfa = CreateObject("Scripting.FileSystemObject") Ks = "HKEY_LOCAL_MACHINE\Software\" Ku = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\" Kr = "HKEY_CLASSES_ROOT\exefile\shell\open\command\" k = "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]" reg = "REGEDIT4" & vbCrLf & k & vbCrLf & chr(34) & "PendingFileRenameOperations" & chr(34) & "=hex(7):" ' andiamo a vedere dove sono i vari folder winfolder = marcolfa.GetSpecialFolder(0) sysfolder = marcolfa.GetSpecialFolder(1) tmpfolder = marcolfa.GetSpecialFolder(2) ' ind indica se si è operato già qualche intervento ind = 0 ' ... mani all'autoexec.bat e rimuoviamo la chiamata al Sircam call editFile ("c:\", "autoexec.bat", "@win \recycler\SirC32.exe", ind) rem attenzione al fatto che se le chiamate autoexec sono > 1 (ind > 2) rem allora la rundll32 deve essere sostituita dal CD di Win If marcolfa.FileExists(sysfolder & "\run32.exe") Then Testo = "Il file " & sysfolder & "\dllcache\rundll32.exe potrebbe essere danneggiato." Testo = Testo & "Per questo verrà rimosso. Devi ripristinarlo dal CD di Windows (la trovi dentro ai files *.cab) " & Chr (13) Testo = Testo & "The file " & sysfolder & "\dllcache\rundll32.exe may be damaged and will be removed. " Testo = Testo & "You have to download it from original Windows' CD (inside *.cab files)" MsgBox (Testo) call deleteFile (sysfolder & "\dllcache\rundll32.exe", reg, ind) If ind > 2 Then ' in questo caso devo sostituire la rundll32.exe con l'originale da CD call deleteFile (sysfolder & "\run32.exe", ind) call deleteFile (sysfolder & "\rundll32.exe", ind) testo = "Non è possibile riparare la libreria " & winfolder & "\rundll32.exe" & Chr (13) testo = testo & "poichè il Pc è stato infettato più di una volta" & Chr (13) testo = testo & "Devi ripristinarla dal CD di Windows (la trovi dentro ai files *.cab) " & Chr (13) testo = testo & "Is not possible repair " & winfolder & "\rundll32.exe" & Chr (13) testo = testo & "because the fact Sircam was installed more than one time" & Chr (13) testo = testo & "You have to download it from original Windows' CD (inside *.cab files)" MsgBox (testo) Else ' in questo caso invece posso sostituire la rundll32 corrotta con la run32.exe substituteFile sysfolder & "\run32.exe", sysfolder & "\rundll32.exe", reg, ind End If End If ' andiamo a vedere dove è eventualmente imboscato il file ' Microsoft Internet Office.exe chiave = Ku & "Explorer\Shell Folders\Startup" valore = Rg(chiave) msoffice = valore & "\Microsoft Internet Office.exe" ' Verifichiamo la presenza dei principali files del virus call deleteFile (winfolder & "\Scmx32.exe", reg, ind) call deleteFile (Root() & "recycler\sirc32.exe", reg, ind) call deleteFile (sysfolder & "\Scam32.exe", reg, ind) call deleteFile (Root() & "recycler\sircam.sys", reg, ind) call deleteFile (tmpfolder & "\sirc32.exe", reg, ind) call deleteFile (winfolder & "\Temp\sirc32.exe", reg, ind) call deleteFile (winfolder & "\sirc.reg", reg, ind) call deleteFile (msoffice, reg, ind) ' controlliamo la chiamata dalla Runservices chiave = Ks & "Microsoft\Windows\CurrentVersion\Runservices\Driver32" valore = sysfolder &"\SCam32.exe" lettura = Rg(chiave) If (valore = lettura) Then ind = ind + 1 Rd chiave call report (chiave, "", "deleted", "", ind) End If ' continua l'analisi del registro chiave = Ks & "SirCam\" chiave1 = Ks & "SirCam\FC0" eseguito = Rg(chiave1) If (eseguito <> "") Then Rd chiave ind = ind + 1 call report (chiave, "", "deleted", "", ind) End If ' continuiamo l'analisi del registro sulla chiave di alterazione degli exe chiave = "HKEY_CLASSES_ROOT\exefile\shell\open\command\" impostazione = """%1"" %*" lettura = Rg(chiave) If (lettura <> impostazione) Then Rw chiave , impostazione ind = ind + 1 call report(chiave, lettura , "replaced", impostazione, ind) End If ' Conclusioni If ind > 0 Then gatto = "Il Tuo computer contiene elementi del virus W32.Sircam !!" & Chr (13) If (eseguito <> "") Then gatto = gatto & "Il virus è già stato eseguito "& eseguito & " volte!" & Chr (13) End If gatto = gatto & "Ora cercherò di fare pulizia dei files del virus." msgbox (gatto) call modifyReg (reg) Testo = "Riavviare Windows per terminare la disinfezione." Testo = Testo & "Dopo il riavvio eseguire un controllo con un antivirus aggiornato." Testo = Testo & "Si consiglia inoltre di svuotare tutte le directory di files temporanei" msgbox (Testo) msgbox ("Consulta il file " & Root() & "nuccia.vir per i dettagli delle operazioni eseguite") testo = "Auguri ... e sostieni l'UNICEF" & Chr (13) testo = testo & "Luck ... and support UNICEF" MsgBox (testo) Else MsgBox ("Non ho individuato elementi di installazione del Virus Sircam!") End If End Sub ' ------------------------------ zona librerie ---------------------------------------------- Function Esa(ByVal file) ' Converte file in forma esadecimale e aggiunge in fondo uno 00 On Error Resume Next For i=1 To len(file) esa = esa & Hex(Asc(Mid(file, i, 1))) & "," Next esa = esa & "00," End Function Sub deleteFile(ByVal file, ByRef reg, ByRef ind) ' Cancella il file On Error Resume Next Set marcolfa = CreateObject("Scripting.FileSystemObject") If marcolfa.FileExists(file) Then reg = reg & Esa("\??\" & file) & "00," ind = ind + 1 call report (file, "", "deleted" , "", ind) End IF End Sub Sub substituteFile(ByVal file1, ByVal file2, ByRef reg, ByRef ind) ' Sposta file1 nella posizione file2 sovrascrivendo On Error Resume Next Set marcolfa = CreateObject("Scripting.FileSystemObject") If marcolfa.FileExists(file1) Then reg = reg & esa("\??\" & file1) & esa("!\??\" & file2) ind = ind + 1 call report (file2, "", "substituited", file1, ind) End If End Sub Sub moveFile(ByVal file1, ByVal file2, ByRef reg, ByRef ind) ' Sposta file1 nella posizione file2 ma senza sovrascrivere ' Non genera un report perchè in questo script non serve ' E' stato aggiunto solo per completezza e per eventuali riutilizzi futuri On Error Resume Next Set marcolfa = CreateObject("Scripting.FileSystemObject") If marcolfa.FileExists(file1) Then reg = reg & esa("\??\" & file1) & esa("\??\" & file2) ind = ind + 1 End If End Sub Sub modifyReg (ByVal reg) ' Eseguiamo le modifiche al registro On Error Resume Next Set marcolfa = CreateObject("Scripting.FileSystemObject") If (NOT marcolfa.FolderExists(Root() & "Thorin")) Then marcolfa.createFolder(Root() & "Thorin") End If Set antisirc=marcolfa.CreateTextFile(Root() & "Thorin\reg.reg",True) reg = reg & "00" antisirc.Write reg antisirc.close Set W=CreateObject("WScript.Shell") W.Run ("regedit /s " & Root() & "Thorin\reg.reg") rw "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\reg", "deltree /y " & Root() & "Thorin" End Sub Function Rg(v) rem legge un valore nel file di registro Dim R On Error Resume Next Set R = CreateObject("WScript.Shell") Rg = R.RegRead(v) End Function Sub Rw(k, v) rem scrive nel file di registro Dim R On Error Resume Next Set R = CreateObject("WScript.Shell") R.RegWrite k, v End Sub Sub Rd(v) rem cancella dal registro Dim R On Error Resume Next Set R = CreateObject("WScript.Shell") R.RegDelete(v) End Sub Sub editFile (folder, file, stri, ind) On Error Resume Next Set marcolfa = CreateObject("Scripting.FileSystemObject") If marcolfa.FileExists(folder & file) Then Set vecchio = marcolfa.GetFile (folder & file) nuovonome = marcolfa.GetBaseName(folder & file) & ".vir" vecchio.Copy (folder & nuovonome) marcolfa.DeleteFile (folder & file) Set lella = marcolfa.OpenTextFile(folder & nuovonome , 1, False) Set vipera = marcolfa.OpenTextFile(folder & file, 2, True) Do While lella.AtEndOfStream <> True lettura = lella.ReadLine If lettura <> stri Then vipera.Writeline (lettura) else If ind = 0 Then ind = ind +1 call report (folder & file, "" , " saved as: " , folder & nuovonome, ind) End If ind = ind +1 call report (folder & file, " instruction : " & stri , " deleted" , "", ind) End If Loop lella.close vipera.close If ind = 0 Then marcolfa.DeleteFile (folder & nuovonome) End If End Sub Sub report (posizione, voce, azione, sostituto, ind) On Error Resume Next Set marcolfa = CreateObject("Scripting.FileSystemObject") if ind = 1 then marcolfa.DeleteFile (Root() & "nuccia.vir") set nuccia = marcolfa.OpenTextFile(Root() & "nuccia.vir", 8, True) If ind = 1 Then nuccia.Write "[My name is Marcolfa. I love burper but I hate Sircam]" nuccia.Write VbCrLf & "Your system is infected : This is what i did:" nuccia.Write VbCrLf & VbCrLf End If If sostituto <> "" Then add = " by " Else add ="" End If nuccia.Write VbCrLf & "[action: " & ind & "]" nuccia.Write VbCrLf & posizione & voce & ": was " & azione & add & sostituto nuccia.Write VbCrLf End Sub Function Root() ' Cerchiamo su quale unita' si trova il S.O. On Error Resume Next Set marcolfa = CreateObject("Scripting.FileSystemObject") Set fold = marcolfa.GetSpecialFolder(0) Do Until fold.IsRootFolder Set fold = fold.ParentFolder Loop Root = fold End Function