Post: [TUT] Learn Visual Basic now! (FTP, SMTP, Keylogger, Builder & More!)
10-25-2010, 01:00 AM #1
Securing_Bravo
~ The Graphics Room ~
(adsbygoogle = window.adsbygoogle || []).push({});
Learn Visual Basic now!
Tutorial by: Securing_Bravo
This is copied and pasted so don't cry it's the internet <3

Hello everyone. This is my new tutorial about Visual Basic. I made it for everyone who wanna know more about Visual Basic and how does it works. So lets start...

We gonna learn about:

1."Hello, world" - beginning
2. Make SMTP client
3. Upload files on FTP
4. Advance Builder
5. Basic keylogger

"Hello, world" - beginning


STEP 1:

Open Visual Basic:

Click File > Click then New Project > Choose Windows Application > Choose name > Click Ok

From the Toolbox drag:

Button1 - This will show message

Now lets move to source code part, double click Button1 and write:

    MsgBox("Hello, world")



How does this works?

This just show Message Box on our screen with text Hello, world:
    MsgBox("Hello, world")



Make SMTP client


STEP 1:

Open Visual Basic:

Click File > Click then New Project > Choose Windows Application > Choose name > Click Ok

From the Toolbox drag:

Button1 - Send mail
Textbox1 - Username
Textbox2 - Password

Example:
You must login or register to view this content.

Now lets start with coding part, on top of code write:

    Imports System.Net.Mail


After that double click Button1 and write following source code:

    Dim Mail As New MailMessage
Mail.Subject = "This is subject"
Mail.To.Add(TextBox1.Text)
Mail.From = New MailAddress(TextBox1.Text)
Mail.Body = "This is message body/ or text"
Dim SMTP As New SmtpClient("smtp.gmail.com")
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
SMTP.Port = 587
SMTP.Send(Mail)


How does this works?

This is our import, its important to be there:
    Imports System.Net.Mail


This is declaration of our message:
    Dim Mail As New MailMessage


This is subject of our mail:
      Mail.Subject = "This is subject"


This is mail address, it send from it:
    Mail.To.Add(TextBox1.Text)


This show who sented it, its important to address be right and valid:
    Mail.From = New MailAddress(TextBox1.Text)


This is body or message of our mail:
    Mail.Body = "This is message body/ or text"


This is again declaration, but this time for SMTP server, and this smtp.gmail.com is SMTP address of google:
    Dim SMTP As New SmtpClient("smtp.gmail.com")


This enable to set SMTP:
    SMTP.EnableSsl = True


Here you set your GMail username and password, you write them in textboxes and its important to contain @gmail.com and to be valid:
    SMTP.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)


This is google's port:
    SMTP.Port = 587


This function say to our client to send mail:
    SMTP.Send(Mail)


[size=large][align=center]
Upload files on FTP[/align][/size]


STEP 1:

Open Visual Basic:

Click File > Click then New Project > Choose Windows Application > Choose name > Click Ok

From Toolbox drag:

Textbox1 - FTP Username
Textbox2 - FTP Password
Button1 - Send Filre/Upload
Label1 - Text: Username:
Label2 - Text: Password:

Now lets start with coding:

Double click Button1 and write following code:

     Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("ftp://ftp.drivehq.com/test.txt"), System.Net.FtpWebRequest)
request.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
request.Method = System.Net.WebRequestMethods.Ftp.UploadFile

Dim File() As Byte = System.IO.File.ReadAllBytes("C:\Temp\test.txt")


Dim strZ As System.IO.Stream = request.GetRequestStream()
strZ.Write(File, 0, File.Length)
strZ.Close()
strZ.Dispose()


Example:

You must login or register to view this content.

How does this works?

This is just declaration, you make here request to connect to their server and start process:
       Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("ftp://ftp.drivehq.com/test.txt"), System.Net.FtpWebRequest)


Here you are still connecting. You write your username and password in textbox's so it can connect, make sure its valid account and in this example we will use drivehq as FTP:
    request.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)


Here you start with uploading file:
         request.Method = System.Net.WebRequestMethods.Ftp.UploadFile


This is now again declaration but now you make it for file temp called test.txt:
    Dim File() As Byte = System.IO.File.ReadAllBytes("C:\Temp\test.txt")


This 3 lines are finaly proces, it ending and uploaded file, after that it close connection:

    Dim strZ As System.IO.Stream = request.GetRequestStream()
strZ.Write(File, 0, File.Length)
strZ.Close()
strZ.Dispose()


[size=large][align=center]
Advance Builder[/align][/size]


STEP 1:

Open Visual Basic .NET Click File > New Project > Windows Application > Name it Builder > Ok button

From the Toolbox bar drag:

CheckBox1 - Checking did we checked this, it will be showed in builded file.
TextBox1 - Some text
Button1 - Build button

On top of our code write:

    Imports System.IO


Under the Public Class Form1 write:

       Dim stub, text1 As String
Dim cb As Boolean
Const Filesplit = "@BooleanBuilder@"


Double Click Button1 and write:

    text1 = TextBox1.Text
'Open the Stub
FileOpen(1, Application.StartupPath & "\Stub.exe", OpenMode.Binary, OpenAccess.Read, OpenShare.Default)
stub = Space(LOF(1))

'Get the file
FileGet(1, stub)

'Close the file
FileClose(1)

If CheckBox1.Checked = True Then
cb = True
Else : cb = False
End If

'If the builded file have the same name, then replace with new builded one.
If File.Exists("Boolean.exe") Then
My.Computer.FileSystem.DeleteFile("Boolean.exe")
End If
'Open the file
FileOpen(1, Application.StartupPath & "\Boolean.exe.exe", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default)

'Put the informations
FilePut(1, stub & Filesplit & text1 & Filesplit & cb & Filesplit)

'Close the file
FileClose(1)

MsgBox("The boolean builder did the job, I guess this will help you!", MsgBoxStyle.Information, "Boolean Builder")


Explanation:
You must login or register to view this content.

[size=medium]How does this works?[/size]


This is our import:
    Imports System.IO


This is string for TextBox1 and Stub, which we use to tell program to add the Builder Textbox1.Text in Stub so it build it:
    Dim stub, text1 As String


This is Boolean of our builder:
    Dim cb As Boolean


This is file split which will split our builders informations with stub:
    Const Filesplit = "@BooleanBuilder@"


This open stub and then the process start's:

    FileOpen(1, Application.StartupPath & "\Stub.exe", OpenMode.Binary, OpenAccess.Read, OpenShare.Default)


This get the stub:
      FileGet(1, stub)


This close the stub:

     FileClose(1)


This check is it our checkbox checked and add it to our stub so we can see did we checked it:

      If CheckBox1.Checked = True Then
cb = True
Else : cb = False
End If


This check is it file already builded and if it is then it replace with new, builded one:
    If File.Exists("Boolean.exe") Then
My.Computer.FileSystem.DeleteFile("Boolean.exe")
End If


This build the file:
     FileOpen(1, Application.StartupPath & "\Boolean.exe.exe", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default)


This put the split's in the files:
    FilePut(1, stub & Filesplit & text1 & Filesplit & cb & Filesplit)


And finnaly this close the file:
     FileClose(1)


This show the user that, the file is builded via messagebox:
    MsgBox("The boolean builder did the job, I guess this will help you!", MsgBoxStyle.Information, "Boolean Builder")


STEP 2:

Open Visual Basic .NET Click File > New Project > Windows Application > Name it Stub Ok button

From the Toolbox bar drag:

Label1 - This is just some text with question "Did you checked me?"
Label2 - This is answer and put text for now "None" it will be changed when we build so dont worry
Textbox1 - This just added to explane you how to add text too.

Add this under Public Class Form1:

    Dim options(), text1, cb As String
Const Filesplit = "@BooleanBuilder@"


Now double click the Form1 and write code:


    FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)

text1 = Space(LOF(1))
cb = Space(LOF(1))

'FileGet
FileGet(1, text1) 'options(1) - Text
FileGet(1, cb) 'options(2) - Label

FileClose(1)

options = Split(text1, FileSplit)
FileClose(1)
TextBox1.Text = options(1)
If options(2) = False Then
Label2.Text = "No"
Else : Label2.Text = "Yes"
End If


Explanation:
You must login or register to view this content.

[size=medium]How does this works?[/size]

This is our stirng with options and text1 is text from the Builder:
    Dim options(), text1, cb As String


This one opens the file:
    FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)


This one gets the informations from Builder and set options() which we use in our stub:
     'FileGet
FileGet(1, text1) 'options(1) - Text
FileGet(1, cb) 'options(2) - Label


This close the file:
    FileClose(1)


This split the Textbox1:
     options = Split(text1, FileSplit)


This close the file:
    FileClose(1)


This says to textbox1 that the text is from options(1) which is marked as text1 string:
     TextBox1.Text = options(1)


This checks did we checked the cb from builder, this is connection of the builder and stub which must be 100% same:
    If options(2) = False Then
Label2.Text = "No"
Else : Label2.Text = "Yes"
End If


Download:
You must login or register to view this content.
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo