C++ Keylogger

A keylogger is a useful tool, you know that that’s why you are here. If the keylogger has the functionalities like running in the background by going in stealth mode, avoid antivirus detection, and can send an email, then it is the most dangerous tool for the victims PC. You can get his/her confidential data like credit card info, username, libariesEmail address, and passwords.

After sharing a tutorial on how to create a python keylogger, I decided to build another one using C++ for Windows OS. This C++ keylogger will run on any windows machine without any other libraries, unlike the python based keylogger where python must be installed on the victims Pc.

In this tutorial, you will learn how to make a powerful c++ keylogger. If you know how to program then the code will be very easy to understand, don’t worry if you don’t know anything about programming still you can make your own C++ keylogger using this tutorial.


After successful compilation, the C++ keylogger can perform the following functions:

  • It will run in stealth mode.
  • It can bypass the antivirus.
  • It will store every keystroke in a text file.

Let’s learn, how to make a  C++ Keylogger:

In order to modify and compile the source, you will need a C++ IDE(integrated development environment), for this tutorial I will use Dev c++ because it is free, lightweight, and easy to use, feel free to use any other C++ IDE.

Download Dev c++ from here.

Install Dev c++ on your system, the installation process is very simple. Launch it after the installation the interface should look the image below. Go to the File option at the top you will see New from here choose Source file, or click on the middle of the IDE and press Ctrl+n.

c++ keylogger

Here is the source code for the C++ Keylogger:

Copy all of the C++ keylogger Source code, and past it on the Dev C++ ide. To compile it go to the Execute option and choose Compile or press F9 function key, it will ask you for a location to save your keylogger .Choose your location and save it to start the compilation process.

C++ keylogger

After successful compilation, you will see your keylogger in executable form in the folder you used to save during compiling the C++ keylogger source code.

C++ keyloggerNow test your keylogger start the application, you nothing because it is coded to run in the stealth mode in the background. Open a browser and type something, and  go to the C++ keylogger folder you will see a text file called Record wich have the information you typed.

C++ keyloggerC++ Keylogger

It will keep running in the background unless you stop it. To close the C++ keylogger go to Task manager by pressing  Ctrl+alt+Del. Select the keylogger and choose Endtask.

C++ KeyloggerAlso read: How to hack  Android Phones.