Skip to content

Educational, a simple Python-base keylogger that captures keystrokes and sends them to a Telegram bot in real time.

Notifications You must be signed in to change notification settings

ch4rum/Keylogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

🐍 Telegram Keylogger

A cross-platform (Windows/Linux) keylogger written in Python, which detects keystrokes (including correct capitalization) and sends the logs to a Telegram bot periodically.

Warning

This project is for educational purposes only. Malicious use of this code is illegal Use it at your own risk and only on systems that you control or have permission to monitor.

🚀 Features

  • Real-time keystroke logging.
  • Shift and Caps Lock case detection.
  • Automatic sending of logs via Telegram.
  • Compatible with Windows and Linux.
  • Clean, structured and extensible code.

⚙️ Configuración

Follow these exact steps to create your Telegram bot and connect it with the keylogger.

Step 1: Create Your Telegram Bot

  • Open the Telegram app.
  • Search for @BotFather and start a chat.
  • Send the command: /newbot
  • BotFather will ask you for:
    • A name -> any name you want (e.g. KeyLog Bot)
    • A username -> must end in bot (e.g. logger_bot)
  • After successfyl creation, you'll get your token like:
123456789:AbCdEFGhiJklmNoPQRstuvWXyZ

Step 2: Start Your Bot

  • In Telegram, search for your newly created bot (@logger_bot).
  • Click start or type any message like Hello World!.

This is necessary so Telegram can register your chat for updates.

Step 3: Your Chat ID

  • OpeN your favorite browser and go to:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates

It's important to replace <YOUR_BOT_TOKEN> with the actual token from BotFather. Alternatively, you can use the terminal

curl -Ss "https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates" | jq
  • In the response, find a block like:
"chat": {
    "id": 123456789,
    "first_name": "Çԋ4Яµm",
    "username": "Çԋ4Яµm",
    "type": "private"
}
  • Copy the number inside id -> this is your CHAT_ID

How to use

Open your main.py file and edit the following lines with your actual bot credentials:

BOT_TOKEN = "Your_Telegram_Bot_Token"
CHAT_ID = "Your_Chat_Id"
  • Replace "Your_Telegram_Bot_Token" with the token you received from BotFather.

  • Replace "Your_Chat_Id" with the chat ID you obtained using the getUpdates method.

📦 Requirements

To run this code, you need to install some dependencies in your Python environment. To do this, you can use pip or pacman(on Arch Linux).

  • Python 3.7+
  • Dependencies:
    • pynput
    • requests
    • python-xlib (Linux only)

Note

python-xlib is required only on Linux systems for pynput to function properly. Do not install it on Windows.

  • Clone the repository and install the dependencies.
git clone https://github.com/ch4rum/Keylogger.git
cd Keylogger/Python
  • Then install dependencies:
# In windows & some linux
pip install pynput requests python-xlib

# I nArch & some derivate
sudo pacman -S --noconfirm python-pynput python-requests python-xlib

📧 Contributions

Feel free to fork this repository and propose improvements or additional features though pull requests.

SVG

About

Educational, a simple Python-base keylogger that captures keystrokes and sends them to a Telegram bot in real time.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages