Keylogger Implementation with Python

Goal

The goal of this project is to understand keylogging techniques and how attackers capture user input. Students will learn how to use Pynput to record keystrokes, implement a timed report mechanism, and securely send logs via email.

Task

Students will:
1️⃣ Set up a Python environment and install required modules (pynput, smtplib).
2️⃣ Write a keylogger script that records keystrokes using pynput.keyboard.
3️⃣ Implement a timed report mechanism that emails the logs at a set interval.
4️⃣ Securely handle email credentials and avoid exposing sensitive information.
5️⃣ Test the keylogger in a controlled environment (not on unauthorized systems).
6️⃣ Explore countermeasures to detect and prevent keylogging attacks.

Learning Outcomes

By completing this project, students will:

✅ Understand how keyloggers work and their ethical implications.
✅ Learn how to capture keystrokes using the Pynput library.
✅ Implement automated email reporting using SMTP.
✅ Understand the risks of malware, data breaches, and unauthorized keylogging.
✅ Learn how to defend against keyloggers and improve cybersecurity awareness.