How yugdabgar21/keylogdetector works
Project Type and Purpose
• This is a Python-based CLI security tool (“Offline Keylogger Detection Tool for Windows”) that scans a user-specified folder for keylogger-related artifacts: suspicious file names, file contents, and running processes. It’s not a multi-service system but a single-entry script (main.py) orchestrating several scan components.
File Structure Analysis
• Top Level:
• .github/… – repository meta-data (issue templates, CI/CD, docs)
• main.py – the single Python script containing the scanner logic
• README.md, LICENSE, CONTRIBUTING.md, etc. – documentation
a. CLI Interface
b. File Signature Scanner
c. Heuristic Content Scanner
d. Process Checker
e. Report Generator
README Insights
• Dependencies: psutil (process enumeration), tqdm (progress bar), Python ≥3.7
• Inputs: target folder path, signatures.txt file path
• Output: timestamped CLI report with OK/warning flags
Main Components
a. User CLI (main.py)
b. File System (scanned directory)
c. Signatures File (signatures.txt)
d. File Signature Scanner (filename matching)
e. Heuristic Content Scanner (keyword search in files)
f. Process Checker (psutil-based)
g. Report Generator & CLI Output
h. External Libraries: psutil, tqdm
Component Interactions and Data Flow
1. User launches main.py → CLI prompts for inputs
2. CLI passes folder path to File Signature Scanner & Heuristic Scanner
3. File Signature Scanner reads filenames → matches against signature list
4. Heuristic Scanner opens each file → scans content for keywords
5. CLI invokes Process Checker → uses psutil to enumerate running processes → flags known suspects
6. All findings funnel into Report Generator → formats and prints the scan report with timestamps and counts
Architectural Patterns & Principles
• Single-responsibility: each conceptual scanner (filename, content, process) handles one type of detection
• Dependency injection: signature keywords read once and shared by scanners
• Tool-oriented: minimal layers, linear data flow, no persistent storage