navanil-das/SSH_Bruteforce_Detector
GitHub: navanil-das/SSH_Bruteforce_Detector
一个基于 Python 的轻量级网络安全工具,通过解析身份验证日志来检测 SSH 暴力破解攻击并提供实时监控功能。
Stars: 4 | Forks: 0
# 🔐 SSH 暴力破解检测器
一个基于 Python 的网络安全工具,通过分析身份验证日志来检测 **SSH 暴力破解攻击**。
该工具解析 SSH 登录日志,根据重复的失败登录尝试检测可疑 IP 地址,并生成安全报告。它还可以**实时**监控日志,充当一个简单的**入侵检测系统 (IDS)**。
## 🚀 功能
* 📄 解析 SSH 身份验证日志
* 🚨 检测暴力破解登录尝试
* 🌍 识别可疑 IP 地址
* 📊 按尝试次数对攻击者进行排名
* 👀 实时日志监控(微型 IDS)
## 🏗 架构
```
┌───────────────────┐
│ SSH Log File │
└─────────┬─────────┘
│
▼
┌───────────────────┐
│ log_parser.py │
│ Extract events │
└─────────┬─────────┘
│
▼
┌───────────────────┐
│ attack_detector.py│
│ Detect attackers │
└─────────┬─────────┘
│
▼
┌───────────────────┐
│report_generator.py│
│ Security report │
└─────────┬─────────┘
│
▼
User Output
Optional Real-Time Monitoring Mode
----------------------------------
┌───────────────────┐
│ monitor.py │
│ Watches log file│
└─────────┬─────────┘
│
▼
SSH Log File
│
▼
log_parser.py
│
▼
attack_detector.py
│
▼
report_generator.py
│
▼
Live Alerts
```
## 🗂 项目结构
```
ssh-bruteforce-detector
│
├── logs
│ └── sample_auth.log # Example SSH log file used for testing
│
├── src
│ ├── analyzer.py # Main CLI tool that runs analysis
│ ├── log_parser.py # Extracts events (timestamp, IP) from logs
│ ├── attack_detector.py # Detects brute-force attacks based on thresholds
│ ├── report_generator.py # Generates formatted security reports
│ ├── monitor.py # Real-time log monitoring (mini IDS)
│ └── utils.py # Helper functions shared across modules
│
├── tests
│ └── test_parser.py # Unit tests for log parsing functionality
│
├── requirements.txt # Python dependencies
├── README.md # Project documentation
├── LICENSE # Open-source license
└── .gitignore # Ignore cache files, environment files, etc
```
## ⚙️ 安装
克隆仓库:
```
git clone https://github.com/navanil-das/ssh-bruteforce-detector.git
cd ssh-bruteforce-detector
```
## ▶️ 使用方法
运行日志分析:
```
py src/analyzer.py logs/sample_auth.log
```
运行实时监控:
```
py src/analyzer.py logs/sample_auth.log --monitor
```
## 📈 示例输出
```
SSH Brute Force Detection Report
--------------------------------
Top Attackers
1. 192.168.1.10 → 7 failed attempts
2. 192.168.1.45 → 3 failed attempts
```
## 🛡 使用的网络安全概念
* 日志分析
* 入侵检测
* 安全监控
* 自动化脚本
## 📚 未来改进
* 🔒 自动 IP 封禁(类似 Fail2Ban)
* 📊 攻击时间线可视化
* 📧 检测到攻击时发送邮件警报
* ⚡ 更快的日志监控
## 👨💻 作者
**Navanil Das**
- GitHub: [https://github.com/navanil-das](https://github.com/navanil-das)
- LinkedIn: [https://linkedin.com/in/navanil-das](https://www.linkedin.com/in/navanil-das-83ba41296/)
标签:IP 封禁, Python, SSH, WSL, 免杀技术, 入侵检测系统, 威胁分析, 子域名枚举, 安全数据湖, 对称加密, 攻防检测, 文档结构分析, 无后门, 暴力破解检测, 系统安全, 红队行动, 网络安全, 自动化侦查工具, 自动化审计, 身份验证日志, 逆向工具, 隐私保护