Skip to main content

Overview

AutoPentestX requires both system-level tools and Python packages to function. This guide covers troubleshooting dependency installation and compatibility issues.

System Dependencies

  • Nmap
  • Nikto
  • SQLMap
  • Metasploit (optional)

Python Dependencies

  • python-nmap
  • requests
  • reportlab
  • sqlparse

System Dependencies

Required Packages

Purpose: Port scanning, service detection, OS fingerprintingInstallation:
sudo apt-get update
sudo apt-get install -y nmap
Verification:
which nmap
nmap --version
# Should output: Nmap version 7.80+ 
AutoPentestX will not work without Nmap. It’s the core scanning engine.
Purpose: Web server vulnerability scanning, CGI testingInstallation:
sudo apt-get update
sudo apt-get install -y nikto
Verification:
which nikto
nikto -Version
Workaround if unavailable:
# Skip web vulnerability scanning
python3 main.py -t 192.168.1.100 --skip-web
Purpose: Automated SQL injection detection and exploitationInstallation:
sudo apt-get update
sudo apt-get install -y sqlmap
Verification:
which sqlmap
sqlmap --version
Workaround if unavailable:
# Skip SQL injection testing (part of --skip-web)
python3 main.py -t 192.168.1.100 --skip-web
Purpose: Exploit generation, RC script creation, payload developmentInstallation:
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall
chmod 755 msfinstall
sudo ./msfinstall
Verification:
which msfconsole
msfconsole --version
Workaround if unavailable:
# Skip exploitation phase
python3 main.py -t 192.168.1.100 --skip-exploit
Metasploit is optional. AutoPentestX can perform reconnaissance and vulnerability scanning without it, but exploitation features will be limited.
Additional system packages required:
Core Tools
sudo apt-get install -y \
  python3 \
  python3-pip \
  python3-venv \
  git \
  curl \
  wget
PDF Generation Dependencies
# Required for ReportLab
sudo apt-get install -y \
  libjpeg-dev \
  zlib1g-dev \
  libfreetype6-dev
SSL/TLS Support
sudo apt-get install -y \
  libssl-dev \
  openssl

Python Dependencies

Requirements File Breakdown

AutoPentestX uses these Python packages (from requirements.txt):
requirements.txt
python-nmap==0.7.1
requests>=2.31.0
reportlab>=4.0.4
sqlparse>=0.4.4
Purpose: Python wrapper for NmapInstallation:
pip install python-nmap==0.7.1
Common Issues:
ModuleNotFoundError: No module named 'nmap'
Solution:
# Ensure virtual environment is activated
source venv/bin/activate

# Install package
pip install python-nmap

# Verify
python3 -c "import nmap; print(nmap.__version__)"
Purpose: HTTP library for web vulnerability scanning and CVE lookupsInstallation:
pip install requests>=2.31.0
Common Issues:
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED]
Solution:
# Update certificates
pip install --upgrade certifi

# Or install requests with security extras
pip install 'requests[security]'
Purpose: PDF report generationInstallation:
pip install reportlab>=4.0.4
Common Issues:
error: command 'gcc' failed with exit status 1
fatal error: Python.h: No such file or directory
Solution:
# Install build dependencies
sudo apt-get install -y \
  python3-dev \
  build-essential \
  libjpeg-dev \
  zlib1g-dev \
  libfreetype6-dev

# Then reinstall
pip install --upgrade reportlab
Purpose: SQL parsing and formattingInstallation:
pip install sqlparse>=0.4.4
Issues: Rarely causes problems. If needed:
pip install --upgrade sqlparse

Complete Dependency Resolution

Fresh Installation

1

Update system package lists

sudo apt-get update
sudo apt-get upgrade -y
2

Install system dependencies

sudo apt-get install -y \
  python3 \
  python3-pip \
  python3-venv \
  nmap \
  nikto \
  sqlmap \
  git \
  curl \
  wget \
  build-essential \
  python3-dev \
  libjpeg-dev \
  zlib1g-dev
3

Create virtual environment

cd AutoPentestX
python3 -m venv venv
source venv/bin/activate
4

Upgrade pip

pip install --upgrade pip setuptools wheel
5

Install Python packages

pip install -r requirements.txt
6

Verify installation

python3 -c "
import nmap
import requests
from reportlab.lib.pagesizes import letter
import sqlparse
print('✓ All Python modules imported successfully')
"
7

Test system tools

which nmap && echo "✓ Nmap found"
which nikto && echo "✓ Nikto found" || echo "⚠ Nikto not found"
which sqlmap && echo "✓ SQLMap found" || echo "⚠ SQLMap not found"
which msfconsole && echo "✓ Metasploit found" || echo "⚠ Metasploit not found"

Troubleshooting Dependency Installation

Symptoms:
  • Package installation errors
  • Compilation failures
  • Permission denied errors
Solutions:
pip --version
# Should be pip 21.0+

# Upgrade if old
python3 -m pip install --upgrade pip
Error Message:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed.
Solution:
1

Create fresh virtual environment

rm -rf venv
python3 -m venv venv
source venv/bin/activate
2

Upgrade pip

pip install --upgrade pip
3

Install requirements

pip install -r requirements.txt
Creating a fresh virtual environment resolves most dependency conflicts.
Error Message:
fatal error: Python.h: No such file or directory
error: command 'gcc' failed with exit status 1
Solution:
# Install development headers
sudo apt-get install -y \
  python3-dev \
  build-essential \
  gcc \
  g++ \
  make

# Then retry pip install
pip install -r requirements.txt
Symptoms:
  • Timeout errors during pip install
  • Cannot reach PyPI
  • SSL certificate errors
Solutions:
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
pip install -r requirements.txt

Verification Script

Use this script to verify all dependencies:
check_dependencies.py
#!/usr/bin/env python3
"""Check AutoPentestX dependencies"""

import sys
import subprocess
import importlib

def check_system_tool(tool):
    try:
        result = subprocess.run(['which', tool], capture_output=True)
        return result.returncode == 0
    except:
        return False

def check_python_module(module):
    try:
        importlib.import_module(module)
        return True
    except ImportError:
        return False

print("=" * 60)
print("AutoPentestX Dependency Checker")
print("=" * 60)

# System tools
print("\n[System Tools]")
tools = {'nmap': True, 'nikto': False, 'sqlmap': False, 'msfconsole': False}
for tool, required in tools.items():
    status = "✓" if check_system_tool(tool) else "✗"
    req_str = "REQUIRED" if required else "OPTIONAL"
    print(f"{status} {tool:15s} [{req_str}]")

# Python modules
print("\n[Python Modules]")
modules = ['nmap', 'requests', 'reportlab', 'sqlparse']
for module in modules:
    status = "✓" if check_python_module(module) else "✗"
    print(f"{status} {module:15s} [REQUIRED]")

print("\n" + "=" * 60)
print("Check complete!")
Run with:
python3 check_dependencies.py

Platform-Specific Notes

# Update sources
sudo apt-get update

# Install everything
sudo apt-get install -y \
  python3 python3-pip python3-venv \
  nmap nikto sqlmap \
  build-essential python3-dev \
  libjpeg-dev zlib1g-dev

# Python packages
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Getting Help

If dependencies still fail to install:
  1. Collect diagnostic information:
    python3 --version
    pip --version
    cat /etc/os-release
    uname -a
    
  2. Check error logs:
    pip install -r requirements.txt --verbose
    
  3. Consult other guides:

Need More Help?

Open a GitHub issue with your system info and error messages

Build docs developers (and LLMs) love