AutoPentestX–Linux自动化渗透测试和漏洞报告工具

admin 2026-02-02 00:39:58 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

文章总结: AutoPentestX是一款面向Linux的全自动化渗透测试工具包,单命令完成端口扫描、OS检测、漏洞识别、SQL注入测试、CVE查询及风险评分。集成Nmap、Nikto、SQLMap和Metasploit,提供安全模式避免破坏性操作,生成专业PDF报告并存储至SQLite数据库。适用于授权渗透测试和安全研究,强调法律合规与伦理使用。 综合评分: 88 文章分类: 渗透测试,安全工具,漏洞分析,安全运营


cover_image

AutoPentestX – Linux 自动化渗透测试和漏洞报告工具

原创

mourenzheng mourenzheng

网络安全民工

2026年1月31日 21:37 北京

AutoPentestX – 自动渗透测试工具包

终端克里

#

AutoPentestX 是一款面向 Linux 系统的全面、生产准备的自动化渗透测试工具包。它通过一个命令完成全自动化的安全评估,生成专业的 PDF 漏洞报告。

⚠️法律免责声明

仅限教育和授权测试

该工具设计用于:

  • 受控实验室环境中的教育目的
  • 经书面许可的授权渗透测试
  • 你拥有系统的安全性研究

未经授权访问计算机系统是非法的,可能导致刑事起诉。

使用此工具即表示您同意:

  • 只有你拥有或有明确书面授权的系统才能测试
  • 遵守所有适用的地方、州和联邦法律
  • 为你的行为承担全部责任

开发者对该工具造成的滥用或损害不承担任何责任。


🎯 核心目标

从单一目标IP或域出发,AutoPentestX将:

  1. ✅ 自动检测作系统
  2. ✅ 全面扫描所有端口
  3. ✅ 识别服务和版本
  4. ✅ 检测漏洞
  5. ✅ 执行网络安全扫描
  6. ✅ 测试SQL注入
  7. ✅ 查找CVE数据库
  8. ✅ 计算风险评分
  9. ✅ 尝试安全利用
  10. ✅ 生成专业的PDF报告

🚀 特色

全面扫描

  • 网络扫描

    :由Nmap驱动的TCP/UDP端口扫描

  • 作系统检测

    :自动作系统指纹识别

  • 服务枚举

    :详细的服务和版本检测

  • 漏洞检测

    :常见漏洞识别

网络安全测试

  • Nikto 集成

    :网页服务器漏洞扫描

  • SQLMap集成

    :自动SQL注入检测

  • 网络服务发现

    :自动HTTP/HTTPS服务识别

情报与分析

  • CVE 查询

    :自动化的 CVE 数据库查询

  • CVSS评分

    :行业标准漏洞评分

  • 风险评估

    :智能风险等级计算

  • 利用匹配

    :自动识别利用

安全开发

  • 安全模式

    :无损安全测试

  • Metasploit集成

    :利用模拟能力

  • RC脚本生成

    :用于手动测试的Metasploit资源脚本

  • 漏洞数据库

    :预配置的漏洞映射

专业报道

  • PDF 生成

    :全面的漏洞报告

  • 执行摘要

    :高层次发现概述

  • 技术细节

    :完整漏洞分析

  • 风险评分

    :危急/高/中/低分类

  • 建议

    :可作的安全指导

数据管理

  • SQLite 数据库

    :持久扫描结果存储

  • 详细记录

    :完整的活动跟踪

  • JSON 导出

    :机器可读输出

  • 历史数据

    :扫描历史与趋势


📁 项目结构

AutoPentestX/
├── main.py                      # Main application orchestrator
├── autopentestx.sh              # Single-command launcher script
├── install.sh                   # Automated installation script
├── requirements.txt             # Python dependencies
├── config.json                  # Configuration settings
├── README.md                    # This file
├── LICENSE                      # MIT License
├── DISCLAIMER.md                # Legal disclaimer
│
├── modules/                     # Core functionality modules
│   ├── __init__.py
│   ├── database.py              # SQLite database handler
│   ├── scanner.py               # Network scanning (Nmap)
│   ├── vuln_scanner.py          # Vulnerability scanning (Nikto/SQLMap)
│   ├── cve_lookup.py            # CVE database lookups
│   ├── risk_engine.py           # Risk assessment calculations
│   ├── exploit_engine.py        # Safe exploitation engine
│   └── pdf_report.py            # PDF report generator
│
├── reports/                     # Generated PDF reports
├── logs/                        # Scan logs
├── database/                    # SQLite database files
└── exploits/                    # Generated Metasploit RC scripts

🔧 安装

前提条件

  • 作系统:

    Kali Linux、Ubuntu 20.04+,或基于 Debian 的 Linux

  • Python

    :3.8或更高

  • 根访问

    :某些扫描作所必需

  • 互联网连接

    :用于 CVE 查找和软件包安装

自动化安装

# Clone the repositorygit clone https://github.com/yourusername/AutoPentestX.gitcd AutoPentestX# Make installation script executablechmod +x install.sh# Run installation./install.sh

安装脚本将:

  • 安装系统依赖(Nmap、Nikto、SQLMap)
  • 可选安装Metasploit Framework。
  • 创建 Python 虚拟环境
  • 安装 Python 包
  • 创建必要的目录
  • 设置正确的权限
  • 测试安装

手动安装

# Install system dependenciessudo apt-get update sudo apt-get install -y python3 python3-pip python3-venv nmap nikto sqlmap# Create virtual environmentpython3 -m venv venvsource venv/bin/activate# Install Python dependenciespip install -r requirements.txt# Create directoriesmkdir -p reports logs database exploits# Set permissionschmod +x main.py autopentestx.sh

💻 用途

快速入门

# Activate virtual environment (if not already activated)source venv/bin/activate# Basic scanpython3 main.py -t 192.168.1.100# Or use the wrapper script./autopentestx.sh 192.168.1.100

命令行选项

python3 main.py -t&nbsp;<target>&nbsp;[options] &nbsp;Required Arguments: &nbsp; -t, --target &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Target IP address or domain name &nbsp;Optional Arguments: &nbsp; -n, --tester-name &nbsp; &nbsp; Name of the penetration tester (default: AutoPentestX Team) &nbsp; --no-safe-mode &nbsp; &nbsp; &nbsp; &nbsp;Disable safe mode (NOT RECOMMENDED) &nbsp; --skip-web &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Skip web vulnerability scanning (Nikto/SQLMap) &nbsp; --skip-exploit &nbsp; &nbsp; &nbsp; &nbsp;Skip exploitation assessment &nbsp; --version &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Show version information &nbsp; -h, --help &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Show&nbsp;help&nbsp;message

使用示例

基础扫描

python3 main.py -t 192.168.1.100

使用自定义测试器名称扫描

python3 main.py -t example.com -n&nbsp;"John Doe"

快速扫描(跳过网页和漏洞)

python3 main.py -t 10.0.0.1 --skip-web --skip-exploit

全扫描,包含所有功能

./autopentestx.sh 192.168.1.100

📊 产出与报告

PDF报告

每次扫描后,目录中会生成一份全面的PDF报告:reports/

文件名格式AutoPentestX_Report_<target>_<timestamp>.pdf

报告内容

  • 带有扫描元数据的封面页
  • 执行摘要
  • 整体风险评估
  • 扫描细节(作系统、端口、服务)
  • 开放端口表
  • 已识别的漏洞
  • CVE详细信息及CVSS评分
  • 开发评估
  • 安全建议
  • 专业格式化

数据库

所有扫描数据都存储在SQLite数据库中:database/autopentestx.db

数据库表

  • scans– 扫描元数据和摘要
  • ports– 发现了开放端口
  • vulnerabilities– 识别出的漏洞
  • web_vulnerabilities– 网络特定发现
  • exploits– 利用尝试

日志文件

详细日志保存在目录中:logs/

  • 扫描活动
  • 工具输出
  • 错误信息
  • 时间戳

🔬 技术细节

扫描工作流程

User Input (Target)
&nbsp; &nbsp; ↓
OS Detection (Nmap)
&nbsp; &nbsp; ↓
Port Scanning (TCP/UDP)
&nbsp; &nbsp; ↓
Service Detection & Version Enumeration
&nbsp; &nbsp; ↓
Vulnerability Scanning (Nikto/SQLMap)
&nbsp; &nbsp; ↓
CVE Database Lookup
&nbsp; &nbsp; ↓
Risk Score Calculation
&nbsp; &nbsp; ↓
Exploit Matching & Simulation
&nbsp; &nbsp; ↓
PDF Report Generation
&nbsp; &nbsp; ↓
Database Storage

风险评分系统

基于CVSS的分类

  • 危急

    :CVSS 9.0-10.0

  • 最高

    :CVSS 7.0-8.9

  • 中等

    :CVSS 4.0-6.9

  • 低压

    :CVSS 0.1-3.9

  • 未知

    :无CVSS评分可用

风险因素

  • 基础CVSS评分
  • 可利用性(2倍权重)
  • 公开利用可用性(权重1.5倍)
  • 网络可访问性(权重1.3倍)
  • 服务敏感性

🛠️ 集成工具

| 工具 | 目的 | 积分 | | — | — | — | | Nmap | 端口扫描、作系统检测、服务枚举 | python-nmap图书馆 | | 尼克托 | 网络漏洞扫描 | 子进程执行 | | SQLMap | SQL注入检测 | 子进程执行 | | 变形削减 | 利用框架 | RC脚本生成 | | CVE环形保护委员会 | CVE 数据库 API | RESTful API 调用 | | SQLite | 数据持久性 | 内置Pythonsqlite3 | | 报告实验室 | PDF生成 | reportlab图书馆 |


🔐 Security Features

Safe Mode (Default)

  • Non-Destructive

    : No actual exploitation occurs

  • Simulation Only

    : Tests feasibility without execution

  • RC Script Generation

    : Creates Metasploit scripts for manual review

  • Audit Trail

    : All actions logged

Configurable Options

  • Skip specific scan types
  • Timeout configurations
  • Rate limiting
  • Safe mode toggle

Data Protection

  • Confidential report watermarks
  • Local-only data storage
  • No external data transmission (except CVE API)
  • Secure database storage

📝 Configuration

Edit to customize:config.json

{ &nbsp;"scan_settings": { &nbsp; &nbsp;"default_safe_mode":&nbsp;true, &nbsp; &nbsp;"timeout":&nbsp;300&nbsp; &nbsp;}, &nbsp;"vulnerability_scanning": { &nbsp; &nbsp;"nikto_enabled":&nbsp;true, &nbsp; &nbsp;"sqlmap_enabled":&nbsp;true&nbsp; &nbsp;}, &nbsp;"risk_scoring": { &nbsp; &nbsp;"cvss_thresholds": { &nbsp; &nbsp; &nbsp;"critical":&nbsp;9.0, &nbsp; &nbsp; &nbsp;"high":&nbsp;7.0, &nbsp; &nbsp; &nbsp;"medium":&nbsp;4.0, &nbsp; &nbsp; &nbsp;"low":&nbsp;0.1&nbsp; &nbsp; &nbsp;} &nbsp; } }

🐛 故障排除

常见问题

问题:“权限被拒”扫描时错误

#&nbsp;Solution: Run Nmap portions with sudo or adjust permissionssudo python3 main.py -t&nbsp;<target>

问题:找不到 Nikto 或 SQLMap

#&nbsp;Solution: Install missing toolssudo apt-get install nikto sqlmap

问题:导入错误

#&nbsp;Solution: Ensure virtual environment is activatedsource&nbsp;venv/bin/activate pip install -r requirements.txt

问题:PDF生成失败

#&nbsp;Solution: Install reportlab dependenciespip install --upgrade reportlab

🤝 贡献

欢迎大家的贡献!请遵循以下指南:

  1. 分支仓库
  2. 创建功能分支
  3. 做出你的改变
  4. 彻底测试
  5. 提交拉取请求

规范标准

  • PEP 8合规
  • 详尽评论
  • 错误处理
  • 安全最佳实践

📜 许可

本项目采用MIT许可证授权——详情请参见LICENSE文件。


👥 作者

  • AutoPentestX 团队

  • 初期开发

  • 网络安全研究人员与道德黑客


🙏 致谢

  • 攻势安全

    ——Kali Linux与渗透测试方法论

  • Rapid7

  • Metasploit 框架

  • Nmap 项目

  • 网络扫描能力

  • CIRCL

  • CVE 数据库 API

  • MITRE

  • CVE 数据库与分类

  • 安全社区

    ——持续研究与工具开发


📞 支持

关于问题、问题或贡献:

  • 在GitHub上开启一个问题
  • 请查阅现有文档
  • 审查已结案问题以寻求解决方案

🔄 版本历史

v1.0.0 (2025-11-30)

  • 初始发布
  • 完整的自动化渗透测试工作流程
  • PDF 报告生成
  • CVE数据库集成
  • 安全利用模式
  • SQLite 数据库存储
  • 全面的文档

🎓 教育资源

该工具旨在教育用途。推荐学习资源:

  • OWASP测试指南
  • 渗透测试执行标准
  • CEH认证
  • OSCP认证

⚡ 演出笔记

  • 扫描时间

    :根据目标大小,持续5-30分钟

  • 资源使用

    :中等 CPU/内存消耗

  • 网络影响

    :产生大量网络流量

  • 建议

    :在授权测试窗口内运行


🔮 未来改进

未来发布的计划功能:

  • 多目标扫描
  • 预定扫描
  • 网页仪表盘
  • 电子邮件通知
  • 与漏洞管理平台的集成
  • 增强型漏洞数据库
  • 基于机器学习的漏洞预测

记住:能力越大,责任越大。请合乎伦理和合法地使用此工具。


免责声明:

本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。

任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。

本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我

本文转载自:网络安全民工 mourenzheng mourenzheng《AutoPentestX – Linux 自动化渗透测试和漏洞报告工具》

评论:0   参与:  0