AmirMaharjan00007/python-security-toolkit
GitHub: AmirMaharjan00007/python-security-toolkit
这是一个模块化的开源Python安全工具集,用于自动化执行日志分析、密码审计和威胁检测等日常网络安全任务。
Stars: 0 | Forks: 0
# 🛡️ 作为您第一道防线的轻量级 Python 脚本。
一个模块化的开源 Python 安全工具集,用于从您的终端分析日志、审计凭证、检测威胁和生成报告。没有臃肿的框架,只有您可以阅读、修改和信任的简洁脚本。
## 🔧 包含的工具
| 脚本 | 描述 |
|---|---|
| `log_analyzer.py` | 解析身份验证日志,并标记出多次登录失败尝试的 IP 地址 |
| `password_checker.py` | 根据常见规则和模式评估密码强度 |
| `file_integrity.py` | 对文件进行哈希处理,并检测随时间发生的未授权更改 |
| `ip_reputation.py` | 对照威胁情报源查询 IP 地址信誉 |
| `phishing_detector.py` | 分析 URL 中的钓鱼指标和可疑模式 |
| `port_scanner.py` | 扫描主机上的开放端口并识别正在运行的服务 |
| `report_generator.py` | 将其他工具的发现聚合到统一的安全报告中 |
## 🚀 开始使用
### 前置条件
- Python 3.8 或更高版本
- pip
### 安装
```
# 克隆 repository
git clone https://github.com/yourusername/sentinel-py.git
cd sentinel-py
# (可选)创建 virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 安装 dependencies
pip install -r requirements.txt
```
### 日志分析器
```
python log_analyzer.py
# 编辑脚本中的 LOG_FILE_PATH 以指向您的 auth log
# 默认:/var/log/auth.log(在 Linux 上需要 sudo)
```
### 密码强度检查器
```
python password_checker.py
# 交互式输入密码;获得评分反馈
```
### 文件完整性检查器
```
python file_integrity.py --init /path/to/directory # Create baseline hashes
python file_integrity.py --check /path/to/directory # Detect changes
```
### IP 信誉追踪器
```
python ip_reputation.py --ip 192.168.1.10
python ip_reputation.py --file ips.txt # Batch lookup
```
### 钓鱼 URL 检测器
```
python phishing_detector.py --url "http://example.com"
python phishing_detector.py --file urls.txt
```
### 端口扫描器
```
python port_scanner.py --host 192.168.1.1
python port_scanner.py --host 192.168.1.1 --ports 1-1024
```
### 安全报告生成器
```
python report_generator.py --output report.txt
# 读取其他工具的输出文件并编译统一报告
```
## 📁 项目结构
```
sentinel-py/
├── log_analyzer.py
├── password_checker.py
├── file_integrity.py
├── ip_reputation.py
├── phishing_detector.py
├── port_scanner.py
├── report_generator.py
├── requirements.txt
├── samples/
│ ├── sample_auth.log
│ └── sample_urls.txt
├── reports/ # Generated reports saved here (gitignored)
├── README.md
├── LICENSE
└── .gitignore
```
## ⚙️ 配置
每个脚本文件的顶部都有一个配置块。直接编辑常量即可:
```
# 来自 log_analyzer.py 的示例
LOG_FILE_PATH = "/var/log/auth.log" # Path to your log file
FAILED_THRESHOLD = 5 # Flag IPs with more than this many attempts
OUTPUT_REPORT = "reports/security_report.txt"
```
## 🤝 贡献
欢迎贡献!要添加新工具或改进现有工具:
1. Fork 仓库
2. 创建一个新分支:`git checkout -b feature/your-tool-name`
3. 编写带有顶部配置块、清晰且有文档的 Python 代码
4. 将使用说明添加到本 README 文件
5. 提交一个 Pull Request
请尽可能保持脚本自包含且依赖轻量。
## ⚠️ 免责声明
这些工具仅用于**教育目的和授权的安全测试**。请勿在您不拥有或未获明确许可测试的系统上使用它们。作者不对误用负责。
## 📄 许可证
本项目根据 MIT 许可证授权 — 详情请参阅 [LICENSE](LICENSE)。
## ⭐ 如果觉得有用,请为此仓库点个星!
最后更新于 2026 年 5 月
Amir Maharjan
标签:BurpSuite集成, 逆向工具