Warning! Python Remote Keylogger (this is really too easy!)
How to Create a Keylogger with Python
Introduction and Warning
- The video serves as a warning against downloading random software from the internet, emphasizing potential risks.
- The presenter introduces a Python script designed to log keystrokes on a Windows 11 computer and send them to an online server.
Setting Up the Server
- A Linode server is set up for logging keystrokes; the presenter mentions using SSH to connect and starting an Express service listening on port 8080.
- The presenter checks antivirus settings on Windows 11, confirming that real-time protection is enabled while demonstrating how the keylogger operates despite this.
Demonstrating Keylogging Functionality
- After running the compiled Python script (named Win64file), it appears inactive but runs in the background, capturing keystrokes.
- Typing in Notepad shows that information is logged every 10 seconds, which can be viewed both in console output and through a web interface.
Code Explanation and Educational Purpose
- The keylogger's functionality is demonstrated as it captures typed text even with antivirus protections active; this highlights potential vulnerabilities in security software.
- The presenter clarifies that this demonstration is for educational purposes only, using their own equipment and having permission for all actions taken.
Accessing Source Code and Setup Instructions
- Viewers are directed to GitHub for access to the keylogger code, which includes comments explaining its functionality.
- A setup.py file simplifies installation by automating software downloads necessary for running the keylogger.
Creating a New Server Instance
- The process of creating a new Linode server instance is shown step-by-step, including selecting Ubuntu as the operating system and configuring server details.
How to Set Up a Python Script for Server Use
Installing Required Software
- The process begins with installing necessary software, where users must accept prompts during installation. A Python script is provided to automate downloading and installing the required software, followed by rebooting the server.
- Users need to modify the keylogger Python script by changing the IP address and port number to match their new server settings. An interval can also be specified for how often data is sent to the server.
Compiling the Python Script
- To run the script on Windows, it needs to be compiled using a tool like PyInstaller. The speaker mentions that they used Microsoft's C/C++ compiler for this purpose.
- Recompiling PyInstaller with Microsoft’s compiler helps bypass Windows Defender, which may flag standard PyInstaller outputs as malicious. Alternative compilers are also mentioned in a linked video.
Completing Installation and Running the Server
- During installation, users should opt for default options and confirm various prompts until completion. This includes saying yes to updates while avoiding unnecessary kernel upgrades.
- After rebooting, users can SSH back into their server and start it by executing
nodeserver.JS, confirming that the application is listening on port 8080.
Using Linode for Hosting