Kushh111/network-vulnerability-scanner
GitHub: Kushh111/network-vulnerability-scanner
自动化网络安全评估工具,通过集成多种扫描引擎对目标进行端口枚举、SSL/TLS 分析、Web 技术指纹识别和 CVE 漏洞检测,并生成可交付的专业 PDF 报告。
Stars: 1 | Forks: 0
# 自动化安全评估工具 (ASAT)




一款基于 Python 的自动化网络安全评估工具,可对网络服务、SSL/TLS 配置和 Web 应用程序进行全面漏洞扫描,并将所有发现整理成专业的 PDF 报告。
## 功能
| 模块 | 描述 |
|--------|-------------|
| 网络扫描 | 通过 Nmap 进行端口枚举、服务检测和版本识别 |
| SSL/TLS 分析 | 协议版本、密码套件、证书验证(通过 SSLScan) |
| Web 应用扫描 | 安全头信息、技术指纹识别、信息泄露检测(通过 WhatWeb) |
| 漏洞检测 | 10,000+ 个 CVE 模板(严重、高危、中危级别)通过 Nuclei |
| PDF 报告生成 | 执行摘要、详细发现、修复建议 |
## 使用的工具
- **[Nmap](https://nmap.org/)** — 网络端口扫描和服务检测
- **[Nuclei](https://github.com/projectdiscovery/nuclei)** — 使用 10,000+ 个社区模板进行 CVE 漏洞扫描
- **[SSLScan](https://github.com/rbsec/sslscan)** — SSL/TLS 配置分析
- **[WhatWeb](https://github.com/urbanadventurer/WhatWeb)** — Web 技术指纹识别
- **[python-nmap](https://pypi.org/project/python-nmap/)** — Nmap 的 Python 封装
- **[Scapy](https://scapy.net/)** — 网络枚举和数据包构造
- **[ReportLab](https://www.reportlab.com/)** — PDF 生成
## 工作流程
```
flowchart TD
A([Target input]) --> B[Resolve target\nHostname → IP]
B --> C[Scan orchestrator\nscanner.py]
C --> D[Network scan\nNmap — ports & services]
C --> E[SSL/TLS scan\nSSLScan — ciphers]
C --> F[Web app scan\nWhatWeb — headers]
C --> G[CVE scan\nNuclei — 10000+ templates]
D --> H[(JSON results\nscan_results/scan_target.json)]
E --> H
F --> H
G --> H
H --> I[PDF generator\nreport_generator.py]
I --> J([PDF report\nExecutive summary + findings])
style A fill:#888780,color:#F1EFE8
style B fill:#185FA5,color:#E6F1FB
style C fill:#534AB7,color:#EEEDFE
style D fill:#0F6E56,color:#E1F5EE
style E fill:#0F6E56,color:#E1F5EE
style F fill:#0F6E56,color:#E1F5EE
style G fill:#0F6E56,color:#E1F5EE
style H fill:#854F0B,color:#FAEEDA
style I fill:#534AB7,color:#EEEDFE
style J fill:#3B6D11,color:#EAF3DE
```
## 项目结构
```
automated-security-assessment-tool/
├── scripts/
│ ├── scanner.py # Main scan engine
│ └── report_generator.py # PDF report generator
├── scan_results/ # JSON output and generated PDFs (auto-created)
├── vuln-scan.sh # One-command wrapper script
├── requirements.txt
└── README.md
```
## 前置条件
安装前,请确保您的系统上已具备以下条件:
- **Python 3.8+** — 使用 `python3 --version` 验证
- **Go 1.21+** — Nuclei 需要此版本。从 [go.dev/dl](https://go.dev/dl/) 或通过以下方式安装:
sudo apt install golang -y
- **sudo / root 权限** — Nmap SYN 扫描需要此权限
## 安装
### 1. 克隆仓库
```
git clone https://github.com/Kushh111/automated-security-assessment-tool
cd automated-security-assessment-tool
```
### 2. 安装 Python 依赖
```
pip install -r requirements.txt
```
### 3. 安装系统工具
```
# Nmap
sudo apt install nmap -y
# SSLScan
sudo apt install sslscan -y
# WhatWeb
sudo apt install whatweb -y
# Nuclei (requires Go)
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
# Add Go binaries to PATH if not already set
export PATH=$PATH:$(go env GOPATH)/bin
```
### 4. 创建输出目录
```
mkdir -p scan_results
```
## 使用方法
### 选项 A — 一键式包装脚本(推荐)
```
# Full scan + auto PDF generation
bash vuln-scan.sh example.com
# Specify scan type
bash vuln-scan.sh 192.168.1.1 network
# Custom output directory and report name
bash vuln-scan.sh target.com full ./reports "My Security Firm"
```
### 选项 B — 单独运行脚本
```
# Step 1: Run the scan (sudo recommended for full Nmap accuracy)
sudo python3 scripts/scanner.py example.com
# Step 2: Generate the PDF report
python3 scripts/report_generator.py scan_results/scan_example_com.json
```
### 扫描类型
```
# Network only — open ports and services
sudo python3 scripts/scanner.py target.com -t network
# SSL/TLS only
python3 scripts/scanner.py target.com -t ssl
# Web application only — headers and fingerprinting
python3 scripts/scanner.py target.com -t web
# CVE vulnerability scan only (Nuclei)
python3 scripts/scanner.py target.com -t vuln
# Full scan — all modules (default)
sudo python3 scripts/scanner.py target.com -t full
```
### PDF 报告选项
```
# Default output (same location as JSON)
python3 scripts/report_generator.py scan_results/scan_target_com.json
# Custom output path
python3 scripts/report_generator.py scan_results/scan_target_com.json -o /path/to/report.pdf
# Custom name in report header
python3 scripts/report_generator.py scan_results/scan_target_com.json -c "Your Security Firm"
```
## 输出
### JSON 结果
原始发现结果保存至 `scan_results/scan_.json`,包括:
- 扫描元数据(目标、时间戳、扫描类型)
- 开放端口及服务和版本详情
- SSL/TLS 原始输出和问题列表
- 检测到的 Web 技术和头部信息
- 完整漏洞列表,包含严重程度、描述和修复建议
### PDF 报告内容
- **执行摘要** — 按严重程度分类的发现数量风险矩阵
- **网络服务** — 开放端口、协议、服务版本
- **SSL/TLS 评估** — 协议支持、弱密码套件、证书状态
- **Web 技术** — 检测到的框架、CMS、服务器信息
- **漏洞发现** — CVE ID、严重程度标签、描述、修复步骤
- **建议** — 可操作的安全改进措施
- **免责声明** — 范围、限制、法律声明
## 示例工作流程
```
# 1. Clone and set up
git clone https://github.com/Kushh111/automated-security-assessment-tool
cd automated-security-assessment-tool
pip install -r requirements.txt
mkdir -p scan_results
# 2. Run a full scan
bash vuln-scan.sh target.com full ./reports "My Security Firm"
# 3. Review output
cat reports/scan_target_com.json # Raw findings
xdg-open reports/scan_target_com.pdf # Open PDF report (Linux)
```
## 重要说明
- 扫描是**未经身份验证的** — 结果仅反映外部暴露情况
- Nuclei 模板在**首次运行时会自动更新**
- 完整扫描通常需要 **5–15 分钟**,具体取决于目标
- 在扫描任何系统之前,务必获取**书面授权**
- 在根据发现采取行动之前,应**手动验证**自动扫描结果
## 故障排除
**`nuclei: command not found`**
Nuclei 会安装到您的 Go 二进制路径。请确保该路径在您的 PATH 中:
```
export PATH=$PATH:$(go env GOPATH)/bin
```
将此行添加到您的 `~/.bashrc` 或 `~/.zshrc` 中以使其永久生效。
**Nmap 在没有 sudo 的情况下返回有限结果**
SYN 扫描需要 root 权限。请使用 `sudo` 运行 `scanner.py` 以获得准确的端口检测结果。
**SSLScan 在非 HTTPS 目标上失败**
这是预期行为 — SSLScan 仅适用于启用 SSL/TLS 的服务(通常为端口 443)。仅支持 HTTP 的目标将不显示 SSL 发现结果。
**安装 Nuclei 时提示 `go: command not found`**
Go 未安装。请先安装它:
```
sudo apt install golang -y
```
## 作者
**Kunal Ambulkar**
B.Sc. 网络安全 — 萨维特里拜尔·普勒浦那大学,浦那
[GitHub](https://github.com/Kushh111) · [LinkedIn](https://www.linkedin.com/in/kunal-ambulkar-838018352/)
## 许可证
本项目基于 MIT 许可证授权。
```
MIT License
Copyright (c) 2025 Kunal Ambulkar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
标签:C2日志可视化, CTI, Google, Nmap, Nuclei, PDF报告生成, Python安全工具, Qt框架, Scapy, SSLScan, SSL/TLS检测, Web安全, Web应用扫描, WhatWeb, 代码生成, 安全测试, 实时处理, 密码管理, 指纹识别, 插件系统, 攻击性安全, 数据泄露防护, 数据统计, 日志审计, 服务识别, 渗透测试工具, 端口扫描, 网络安全, 网络探测, 网络评估, 蓝队分析, 虚拟驱动器, 逆向工具, 防御绕过, 隐私保护