How riteshkumar1205/ethical-keylogger-lab works
Main Components
a. Consent & Configuration Loader
• Reads environment variables (SENDER_EMAIL, EMAIL_PASSWORD, RECEIVER_EMAIL)
• Presents the user-consent prompt
b. Input Monitors
• Keystroke Logger (pynput)
• Clipboard Monitor (clipboard)
• Screenshot Capturer (mss or scrot)
• Active Window Tracker (xdotool via subprocess or python wrapper)
c. Data Collector
• System Info Collector (username, IP addresses, timestamp)
• Batch Aggregator / Scheduler (handles intervals, batch sizes)
d. Security & Integrity
• AES Encryption Module (cryptography.Fernet)
• SHA256 Hashing for log integrity
e. Storage & Reporting
• Local Log Store (file system path, sample Output.pdf)
• Email Reporter (SMTP client via requests or smtplib)
f. Audit Logger
• Maintains its local audit trail for compliance
Relationships & Data Flows
• Startup: Configuration Loader → Consent Prompt
• Upon “Consent Granted”:
– Input Monitors → Data Collector → Security & Integrity
– Encrypted Output → either Local Store or Email Reporter
• Email Reporter → External SMTP Server → Receiver’s Inbox
• Audit Logger subscribes to all high-level events (consent, batch send, errors)
Architectural Patterns
– Modular Monolith: separate Python classes/modules for each concern
– Pipeline/Publisher‐Subscriber: monitors publish events → collector subscribes
– Single Responsibility: each component does one job (monitoring, encrypting, sending)
Key Technologies & Libraries
– Python 3.x
– pynput (keystrokes), clipboard, mss/scrot (screenshots)
– cryptography.Fernet (AES)
– hashlib (SHA256)
– smtplib or requests (email)
– xdotool (active window title)
– pytest or unittest (test_logger.py)