A simple Python-based security tool that analyzes SSH authentication logs, identifies failed login attempts, and detects potential brute-force attacks.
This project demonstrates practical log analysis, Python scripting, and defensive (blue-team) security skills — ideal for students building experience in cybersecurity.
- 🔍 Extracts failed SSH login attempts
- 📌 Identifies attacker IP addresses
- 📊 Counts failed attempts per IP
⚠️ Flags suspicious IPs based on a threshold- 📁 Generates JSON reports for further analysis
- 🖥️ Works with Linux
auth.logor a sample test log
.
├── detector.py # Main Python script
├── sample_auth.log # Sample log file for testing
├── report.json # Generated JSON report
└── screenshots/ # (Optional) store screenshot images
=== Top attacking IPs (by failed attempts) ===
198.51.100.7 -> 6 failed attempts
203.0.113.5 -> 3 failed attempts
192.168.0.10 -> 2 failed attempts
=== Suspicious IPs (>= threshold) ===
198.51.100.7 -> 6 failed attempts [SUSPICIOUS]
git clone https://github.com/JosefGh/ssh-log-intrusion-detector.git
cd ssh-log-intrusion-detectorWindows:
python .\detector.pyLinux / macOS:
python3 detector.pypython detector.pypython detector.py -f /var/log/auth.logpython detector.py -t 20python detector.py -o results.json{
"total_unique_ips": 3,
"failed_attempts_per_ip": {
"198.51.100.7": 6,
"203.0.113.5": 3,
"192.168.0.10": 2
},
"suspicious_ips": {
"198.51.100.7": 6
}
}This tool was tested against real SSH authentication logs on a Kali Linux system running under WSL2:
- OpenSSH server running on Kali (WSL2)
- Real failed login attempts generated from SSH clients
/var/log/auth.logenabled and parsed directly withpython3 detector.py -f /var/log/auth.log
This simulates a realistic blue-team scenario where an analyst investigates brute-force activity against an SSH server.
- Fundamentals of log analysis
- Detecting brute-force behavior in logs
- Building CLI tools with Python
- Using argparse, regex, and collections.Counter
- Thinking like a defender (blue team)
- 🌍 GeoIP lookup
- 📈 Visual dashboard
- 📨 Email alerts
- 🧵 Log rotation support
- 🐳 Docker containerization
MIT License