CyberLearn
← Back to beginner
Beginner

Keylogger

Capture keyboard events with timestamps

Log in to track progress
1–2hPython

What you'll learn

  • Event handling
  • File I/O
  • Ethical considerations
██╗  ██╗███████╗██╗   ██╗██╗      ██████╗  ██████╗  ██████╗ ███████╗██████╗
██║ ██╔╝██╔════╝╚██╗ ██╔╝██║     ██╔═══██╗██╔════╝ ██╔════╝ ██╔════╝██╔══██╗
█████╔╝ █████╗   ╚████╔╝ ██║     ██║   ██║██║  ███╗██║  ███╗█████╗  ██████╔╝
██╔═██╗ ██╔══╝    ╚██╔╝  ██║     ██║   ██║██║   ██║██║   ██║██╔══╝  ██╔══██╗
██║  ██╗███████╗   ██║   ███████╗╚██████╔╝╚██████╔╝╚██████╔╝███████╗██║  ██║
╚═╝  ╚═╝╚══════╝   ╚═╝   ╚══════╝ ╚═════╝  ╚═════╝  ╚═════╝ ╚══════╝╚═╝  ╚═╝

Cybersecurity Projects Python License: AGPLv3 Educational

Educational keylogger for security research demonstrating input capture, window tracking, and C2 delivery techniques.

<p align="center"> <a href="https://youtu.be/gTd8cNlMD1k"> <img src="https://img.shields.io/badge/Watch_on-YouTube-FF0000?logo=youtube&logoColor=white" alt="Watch on YouTube"> </a> </p> <p align="center"> <a href="https://youtu.be/gTd8cNlMD1k"> <img src="https://img.youtube.com/vi/gTd8cNlMD1k/maxresdefault.jpg" alt="Video Thumbnail" width="800"> </a> </p>

Learn Docs are in the learn modules.

What It Does

  • Real-time keyboard event capture with microsecond-precision timestamps
  • Active window tracking across Windows, macOS, and Linux
  • Log rotation with configurable size limits (default 5MB)
  • F9 toggle control to pause and resume capture at runtime
  • Remote delivery simulation via webhooks for C2 research
  • Thread-safe operations with proper resource locking and cleanup

Quick Start

git clone https://github.com/CarterPerez-dev/Cybersecurity-Projects.git
cd Cybersecurity-Projects/PROJECTS/beginner/keylogger
uv sync
python keylogger.py

Press F9 to toggle capture on/off. Press Ctrl+C to stop.

Disclaimer: For authorized security research and education only. Unauthorized use of keyloggers is illegal. Always obtain explicit written consent before monitoring any system you do not own.

[!TIP] This project uses just as a command runner. Type just to see all available commands.

Install: curl -sSf https://just.systems/install.sh | bash -s -- --to ~/.local/bin

Learn

This project includes step-by-step learning materials covering security theory, architecture, and implementation.

ModuleTopic
00 - OverviewPrerequisites and quick start
01 - ConceptsSecurity theory and real-world breaches
02 - ArchitectureSystem design and data flow
03 - ImplementationCode walkthrough
04 - ChallengesExtension ideas and exercises

License

AGPL 3.0