sachinviknesh/Vulnerability-Scanner
GitHub: sachinviknesh/Vulnerability-Scanner
一款基于 Python 的综合漏洞扫描工具,通过端口扫描、服务识别和漏洞检测为授权安全测试提供自动化评估与报告生成。
Stars: 0 | Forks: 0
# 漏洞扫描器
一款基于 Python 的综合漏洞扫描工具,旨在检测 Web 应用程序和网络中常见的安全漏洞。该项目提供了有关渗透测试和漏洞评估技术的深入见解。
## 🎯 功能
- **端口扫描**:多线程端口扫描器,用于检测开放端口和运行服务
- **版本检测**:识别过时的软件版本和已知漏洞
- **服务指纹识别**:确定正在运行的服务及其配置
- **漏洞检测**:检查常见的错误配置和薄弱的安全设置
- **报告生成**:生成 JSON 和 HTML 格式的详细漏洞报告
- **CLI 界面**:易于使用的命令行界面,并带有详细的日志记录
## 🏗️ 项目结构
```
Vulnerability-Scanner/
├── src/
│ ├── __init__.py
│ ├── scanner.py # Main scanner orchestrator
│ ├── port_scanner.py # Port scanning module
│ ├── version_detector.py # Software version detection
│ ├── vulnerability_db.py # Vulnerability database
│ └── report_generator.py # Report generation
├── utils/
│ ├── __init__.py
│ ├── logger.py # Logging utilities
│ ├── config.py # Configuration management
│ └── helpers.py # Helper functions
├── templates/
│ └── report.html # HTML report template
├── examples/
│ └── sample_scan.py # Example usage
├── tests/
│ └── test_scanner.py # Unit tests
├── reports/ # Output directory
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore rules
├── main.py # Entry point
└── README.md # This file
```
## 📋 前置条件
- Python 3.7+
- pip (Python 包管理器)
- nmap(用于高级扫描)
- sudo/管理员权限(用于某些扫描操作)
## 🚀 安装说明
1. **克隆仓库**
git clone https://github.com/sachinviknesh/Vulnerability-Scanner.git
cd Vulnerability-Scanner
2. **创建虚拟环境**
python -m venv venv
source venv/bin/activate # 在 Windows 上:venv\Scripts\activate
3. **安装依赖**
pip install -r requirements.txt
4. **安装 nmap(如果尚未安装)**
# Ubuntu/Debian
sudo apt-get install nmap
# macOS
brew install nmap
# Windows
# 从 https://nmap.org/download.html 下载
## 💻 使用说明
### 基础端口扫描
```
python main.py -t 192.168.1.1 --ports 1-1000
```
### 全面漏洞扫描
```
python main.py -t example.com --full-scan --report html
```
### 使用自定义设置进行扫描
```
python main.py -t 192.168.1.100 -p 22,80,443,3306,5432 -v
```
### 命令行选项
```
-t, --target Target IP or hostname (required)
-p, --ports Ports to scan (default: common ports)
-s, --speed Scan speed (1-5, default: 3)
-v, --verbose Enable verbose logging
--full-scan Run full vulnerability assessment
--report Report format (json/html/both, default: json)
--timeout Connection timeout in seconds (default: 5)
-o, --output Output file path
```
## 🔍 扫描目标
### 端口与服务检测
- 开放端口和运行服务
- 服务版本识别
- Banner 抓取
### 版本检测
- 过时的软件版本
- 已识别服务的已知 CVE
- 薄弱的 SSL/TLS 配置
### 漏洞评估
- 默认凭据
- 薄弱的配置
- 不安全的协议(HTTP、Telnet、FTP)
- 缺失的安全标头
### 报告生成
- 详细的漏洞发现
- 风险严重级别(严重、高、中、低、信息)
- 修复建议
- 执行摘要
## 📊 报告示例
报告以 JSON 和 HTML 格式生成,包含:
- 目标信息
- 扫描时间戳
- 发现的漏洞
- 严重性分类
- 修复步骤
- 执行摘要
## ⚙️ 配置
编辑 `utils/config.py` 以自定义:
- 默认扫描端口
- 超时值
- 漏洞数据库路径
- 报告模板
- 日志级别
## 🧪 测试
运行测试套件:
```
pytest tests/ -v
```
运行特定测试:
```
pytest tests/test_scanner.py::test_port_scan -v
```
## 📚 学习成果
该项目可帮助您了解:
- 网络扫描技术
- 服务枚举
- 漏洞数据库(CVE、CWE)
- 安全评估方法论
- Python 网络库
- 渗透测试基础
- 报告生成与沟通
## ⚠️ 法律与道德声明
**重要提示**:此工具仅用于教育目的和授权的安全测试。
- **仅扫描您拥有或获得明确测试许可的系统**
- 未经授权的端口扫描和渗透测试是非法的
- 在进行安全评估之前,务必获得书面授权
- 尊重隐私并遵守适用的法律法规
## 🛠️ 故障排除
### 未找到 nmap
- 安装 nmap:`apt-get install nmap` (Linux) 或 `brew install nmap` (macOS)
### 权限被拒绝
- 某些扫描需要提升的权限:`sudo python main.py ...`
### 扫描缓慢
- 降低超时值:`--timeout 2`
- 提高扫描速度:`--speed 5`
### 连接被拒绝
- 检查目标是否可达:`ping `
- 验证防火墙规则
## 📖 其他资源
- [Nmap 文档](https://nmap.org/doc/)
- [OWASP Top 10](https://owasp.org/Top10/)
- [CVE 数据库](https://cve.mitre.org/)
- [CVSS 评分](https://www.first.org/cvss/)
## 📄 许可证
该项目是开源的,并基于 MIT 许可证提供。
## 👤 作者
**Sachin Viknesh**
## 📞 支持
如遇问题、疑问或建议,请在 GitHub 上提交 issue。
**祝您扫描愉快!请恪守道德!🔐**
标签:CTI, Python, 加密, 反取证, 安全规则引擎, 安全评估, 实时处理, 密码管理, 插件系统, 数据统计, 无后门, 服务器安全, 漏洞扫描器, 端口扫描, 逆向工具