MairaRehmat/system-vulnerability-checklist
GitHub: MairaRehmat/system-vulnerability-checklist
一款蓝队风格的 Python CLI 系统安全审计工具,对照检查清单评估密码策略、补丁管理和不安全实践,生成按风险分级的漏洞报告。
Stars: 1 | Forks: 0
# 系统漏洞检查清单
一款蓝队风格的 Python 审计工具,用于建立系统基线,
对照常见漏洞类别的检查清单运行检查,并生成
一份**按风险分级的威胁报告** — 构建为网络安全项目 4
(“已审计系统:蓝队防御框架”)。
## 检查内容
| 步骤 | 领域 | 检查项 |
|------|------|--------|
| 1 | **身份认证前门** | 密码强度 (NIST 800-63B),MFA 方法强度(标记传统的 SMS/语音 OTP) |
| 2 | **软件衰退与补丁管理** | 待处理的 OS/软件包更新,补丁缓存的陈旧度,防病毒定义 |
| 3 | **不安全实践与暴露面** | 主机防火墙状态,SSH 加固(root 登录 / 密码认证),异常的监听端口,无密码 sudo 规则 |
| 输出 | **威胁报告** | 按风险分级的发现(严重 → 信息)+ 去重的修复路线图,可导出为 JSON |
该工具遵循 **输入 → 处理 → 输出** 的蓝图:
1. **输入** — 建立基线(已安装的内容、正在监听的内容、已配置的内容)。
2. **处理** — 将基线与检查清单进行交叉比对。
3. **输出** — 包含修复路线图的按风险分级的漏洞列表。
## 项目结构
```
system-vulnerability-checklist/
├── main.py # CLI entry point
├── checklist/
│ ├── password_check.py # Step 1: passwords & MFA
│ ├── patch_check.py # Step 2: patch management
│ ├── user_practices.py # Step 3: firewall/SSH/ports/sudo
│ └── report.py # Output: risk-ranked reporting
├── sample_data/
│ └── sample_credentials.txt # Demo file for the password checker
├── tests/
│ ├── test_password_check.py
│ └── test_report.py
├── reports/ # Generated JSON reports land here
├── requirements.txt
└── README.md
```
## 环境要求
- Python 3.10+
- 运行无需第三方软件包(仅使用标准库)
- 如果你想运行测试套件,则需要 `pytest`
## 安装
```
git clone https://github.com//system-vulnerability-checklist.git
cd system-vulnerability-checklist
pip install -r requirements.txt # only needed for running tests
```
## 用法
运行完整的检查清单(补丁 + 实践检查将始终运行;如果你提供了凭据文件,则会运行密码检查):
```
python main.py full --passwords sample_data/sample_credentials.txt
```
将报告保存为 JSON 文件到 `reports/` 目录下:
```
python main.py full --passwords sample_data/sample_credentials.txt --save
```
运行单一的检查清单步骤:
```
python main.py passwords --passwords sample_data/sample_credentials.txt
python main.py patches
python main.py practices
```
### 输出示例
```
========================================================
SYSTEM VULNERABILITY CHECKLIST — THREAT REPORT
========================================================
System : my-laptop
Platform : Linux-6.8.0-x86_64-with-glibc2.35
Generated: 2026-07-15T18:20:00+00:00
Overall Risk: CRITICAL
--------------------------------------------------------
[CRITICAL] password_strength
- Password appears on a common/breached password list.
[HIGH ] listening_ports
- Unexpected open port(s): [8080]. Verify each is an approved, needed service.
...
--------------------------------------------------------
REMEDIATION ROADMAP (risk-ranked)
1. [CRITICAL] password_strength: Enforce NIST 800-63B length-based password policy...
2. [HIGH] listening_ports: Investigate and close/firewall any unapproved listening service.
========================================================
```
## 关于密码检查器的重要说明
该工具**绝不会读取机器上的真实账户凭据。** 它审计的是由*你*提供的纯文本 `identifier:password` 文件 — 例如密码策略测试文件或从密码管理器导出的文件 — 因此它可以在无需提升权限的情况下安全运行。请勿将真实凭据提交到 `sample_data/` 中;示例文件仅供演示使用。
## 运行测试
```
pytest
```
## 退出代码
如果总体风险为 `CRITICAL`(便于在 CI 流水线 / cron 作业中对状态回退进行警报),`main.py` 将以退出代码 `2` 退出;否则退出代码为 `0`。
## 许可证
MIT — 详见 [LICENSE](LICENSE)。
标签:Python, SQL, 安全合规, 安全规则引擎, 插件系统, 文档结构分析, 无后门, 系统审计, 网络代理, 逆向工具