Skip to content

herbertjrjohnd-dev/ai2pentesttool

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Penligent.ai - AI2PentestTool

200+ Seamless Integrations with Leading Security & Pentesting Tools

Our AI pentesting platform, powered by Peligent.ai, delivers over 200+ tool integrations to streamline your entire security testing workflow. With built-in support for the most trusted AI pentest tools, you can run reconnaissance, vulnerability scanning, and exploitation directlyβ€”without leaving our unified console.

Whether you’re a security engineer, penetration tester, or red team operator, our AI pentesting automation allows you to launch, control, and manage industry-standard tools with ease.

AI2PentestTool

Use AI to install penetration testing tool suites in one click.

πŸš€ AI Penetration Testing Tool Auto Installer

An intelligent penetration testing tool automatic installation system based on true Agent paradigm, supporting AI intelligent installation, retry mechanisms, error recovery, and complete logging.

πŸ“‹ Project Introduction

This is a professional penetration testing tool automatic installer designed with AI Agent architecture that can intelligently analyze system environments, automatically generate installation plans, and perform intelligent recovery when encountering errors. The system runs entirely based on built-in configurations and works stably and reliably whether AI service support is available or not.

✨ Core Features

πŸ€– AI Intelligent Installation

  • Large Model Driven: Integrated with OpenAI GPT-4 to generate personalized installation plans
  • Intelligent Retry: Automatically retry 3 times with 2-second intervals when AI queries fail
  • Automatic Downgrade: Automatically use built-in predefined plans when AI service is unavailable
  • Error Analysis: AI analyzes installation errors and provides targeted solutions

πŸ›‘οΈ Robust Error Handling

  • Network Error Recovery: Automatic handling of SSL connection failures, DNS resolution errors, etc.
  • Multi-layer Backup Plans: AI plan β†’ Predefined plan β†’ Backup commands β†’ Manual guidance
  • User Interaction: Ask users whether to skip or retry when failures occur
  • Complete Recording: All operations and errors are recorded in log files

🎯 Flexible Installation Modes

  • Single Tool Installation: Install a specified single tool
  • Batch Installation: One-click installation of 15 core penetration testing tools
  • Custom Installation: Batch installation by reading tool list from file
  • Tool Management: View supported tools and installed tools

🌍 Cross-platform Support

  • macOS: Using Homebrew package manager
  • Linux: Using APT package manager (Ubuntu/Debian)
  • Windows: Providing download links and installation guidance

πŸ”§ Supported Tools (15 tools)

🌐 Network Scanning

  • nmap: Network discovery and security audit tool
  • masscan: Fast port scanner

πŸ” Information Gathering

  • dig: DNS query tool
  • whois: Domain information query tool
  • amass: Subdomain enumeration tool
  • theHarvester: Email and domain collection tool

🌐 Web Application Testing

  • gobuster: Directory/file brute-force tool
  • sqlmap: Automated SQL injection tool
  • dirsearch: Web path scanner
  • wfuzz: Web application fuzzing tool
  • nikto: Web server scanner

πŸ–₯️ Network Tools

  • curl: HTTP client tool
  • netcat: Network toolkit
  • traceroute: Route tracing tool

πŸ” SSL/TLS Testing

  • sslyze: SSL/TLS configuration analysis tool

πŸš€ Quick Start

1. Environment Setup

# Clone project
git clone https://github.com/penligent/AI2PentestTool.git
mkdir tools-new
cd tools-new

# Install Python dependencies
pip install -r requirements.txt

# Set OpenAI API key (optional, will use predefined installation plan if not set)
export OPENAI_API_KEY="your-api-key-here"

2. Basic Usage

View supported tools

python main.py show-tools

Install single tool

python main.py install nmap

Batch install all tools

python main.py install-default

Install tools from file

# Create tool list file
echo -e "nmap\ncurl\nsqlmap" > my_tools.txt

# Install from file
python main.py install-file my_tools.txt

View installed tools

python main.py list

πŸ“ Project Structure

tools-new/
β”œβ”€β”€ ai_agent.py         # AI agent and retry mechanisms
β”œβ”€β”€ config.py           # Configuration management and tool information definition
β”œβ”€β”€ main.py             # Command line entry program
β”œβ”€β”€ tool_installer.py   # Installation logic and error handling
β”œβ”€β”€ requirements.txt    # Python dependency package list
β”œβ”€β”€ logs/               # Installation logs (automatically created)
└── tools_config.json   # Installed tools configuration (automatically generated)

πŸ”§ Configuration System

Core Configuration File (config.py)

All tool configurations in the project are centralized in the TOOLS_INFO dictionary in the config.py file, including:

TOOLS_INFO = {
    "nmap": {
        "name": "nmap",
        "description": "Network discovery and security audit tool",
        "macos": "brew install nmap",
        "linux": "apt update && apt install -y nmap", 
        "windows": "https://nmap.org/download.html",
        "verify_command": "nmap --version",
        "category": "Network Scanning"
    },
    # ... other 14 tool configurations
}

Custom Installation Plans

You can modify the config.py file to:

  • Add New Tools: Add new tool definitions in TOOLS_INFO
  • Modify Installation Commands: Update installation methods for existing tools
  • Adjust Tool Categories: Modify tool category classifications
  • Update Verification Commands: Customize post-installation verification methods

Example of Adding New Tool

"your_tool": {
    "name": "your_tool", 
    "description": "Tool description",
    "macos": "brew install your_tool",
    "linux": "apt install -y your_tool",
    "windows": "https://download-link.com",
    "verify_command": "your_tool --version",
    "category": "Tool Category"
}

πŸ”„ Workflow

AI Mode (Recommended)

Set API Key β†’ AI Analyze Environment β†’ Generate Installation Plan β†’ Execute Commands β†’ Verify Installation β†’ Record Results

Offline Mode (No API Key)

System Detection β†’ Use Predefined Plan β†’ Execute Commands β†’ Verify Installation β†’ Record Results

Error Handling Process

Installation Failed β†’ Error Analysis β†’ Try Backup Plan β†’ User Choice β†’ Continue/Skip

🚨 Error Handling Mechanisms

Network Errors

  • SSL Connection Failure: Automatically try HTTP sources or mirror sites
  • DNS Resolution Failure: Use backup DNS or direct IP access
  • Connection Timeout: Increase timeout and retry

Installation Errors

  • Package Manager Lock: Wait for lock release and retry
  • Dependency Conflicts: Provide virtual environment isolation solutions
  • Insufficient Permissions: Intelligently prompt to use sudo privileges

AI Service Errors

  • API Call Limits: Automatically retry 3 times with increasing intervals
  • Network Connection Issues: Downgrade to predefined installation plans
  • Response Format Errors: Try parsing or use backup plans

πŸ“Š Logging System

Log File Management

  • Location: ./logs/ directory (under current working directory)
  • Naming: installation_YYYYMMDD_HHMMSS.log
  • Content: Detailed installation process, error information, user operation records

Log Levels

  • INFO: Normal installation process and status information
  • WARNING: Potential issues and warning prompts
  • ERROR: Installation errors and exception conditions

Configuration File

  • Location: ./tools_config.json (current directory)
  • Content: Detailed information of installed tools, including path, description, installation time, etc.

βš™οΈ Environment Configuration

Required Configuration

  • Python 3.7+: Runtime environment requirement
  • Network Connection: For downloading tools and AI services

Optional Configuration

  • OPENAI_API_KEY: OpenAI API key (improves installation success rate)
  • Package Manager: Homebrew (macOS) or APT (Linux)

System Adaptation

# Automatically detect operating system
OS_TYPE = platform.system().lower()  # darwin, linux, windows
OS_VERSION = platform.version()      # System version information

πŸ›‘οΈ Security Features

Command Security

  • Pre-validation: Verify security of all installation commands before execution
  • Permission Check: Intelligently detect required permissions and prompt users
  • Input Validation: Strictly validate all user inputs and parameters

Audit Functions

  • Operation Recording: Complete recording of all installation operations and commands
  • Error Tracking: Detailed error stacks and diagnostic information
  • Configuration Backup: Automatic backup of tool configuration status

πŸ”§ Advanced Features

Batch Operations

# Create custom tool list
cat > custom_tools.txt << EOF
nmap
sqlmap
gobuster
nikto
EOF

# Batch installation
python main.py install-file custom_tools.txt

Configuration Viewing

# View all supported tools
python main.py show-tools

# View installed tool status
python main.py list

# View configuration details
python -c "from config import Config; print(Config.TOOLS_INFO)"

πŸ› Troubleshooting

Common Issues

1. AI Query Failure

# Check API connection
curl -I https://api.openai.com

# Verify API key
echo $OPENAI_API_KEY

# View detailed logs
tail -f logs/installation_*.log

2. Permission Issues

# Use administrator privileges
sudo python main.py install <tool>

# Or install to user directory
python main.py install <tool>

3. Package Manager Issues

# macOS - Install/update Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Linux - Update package manager
sudo apt update && sudo apt upgrade

# Check package manager status
brew doctor  # macOS
apt list --upgradable  # Linux

4. Network Connection Issues

# Test network connectivity
ping google.com

# Check DNS resolution
nslookup brew.sh

# Use proxy (if needed)
export https_proxy=http://proxy:port

πŸ“ˆ Project Advantages

  • 🎯 Zero Dependencies: Based on built-in configuration, no external file dependencies
  • πŸ€– Intelligence: AI-driven personalized installation plans
  • πŸ›‘οΈ High Reliability: Multi-layer error handling and backup plans
  • 🌍 Cross-platform: Complete multi-operating system support
  • πŸ“Š Observable: Detailed logging and status tracking
  • πŸ”§ Easy Extension: Simple configuration files to add new tools

πŸ’‘ Best Practices

  1. First Use: Recommend setting OpenAI API key for best experience
  2. Network Environment: Ensure stable network connection, system will automatically handle temporary failures
  3. Permission Management: Use administrator privileges reasonably according to prompts
  4. Log Monitoring: Regularly check log files to understand system status
  5. Configuration Backup: Recommend backing up tools_config.json configuration in important environments

πŸ“š Technical Architecture

Core Components

  • AIAgent: Responsible for interacting with OpenAI API and retry logic
  • ToolInstaller: Handle tool installation, verification, and configuration management
  • Config: Centralized configuration management and tool definition
  • Main Program: Command line interface and user interaction

Design Philosophy

  • Agent Paradigm: True intelligent agent architecture
  • Fault Tolerance First: Multi-layer backup plans ensure high availability
  • User Friendly: Clear feedback and interaction design
  • Security First: Strict validation and permission control

🎯 Start using this powerful AI penetration testing tool auto installer now, let intelligence provide convenience for your security testing work!

About

Use AI to install penetration testing tool suites in one click.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%