Skip to main content

Installation Errors

Error Message:
bash: venv/bin/activate: No such file or directory
Cause: The virtual environment was not created during installation or was deleted.Solution:
1

Recreate the virtual environment

python3 -m venv venv
2

Activate the environment

source venv/bin/activate
3

Reinstall dependencies

pip install -r requirements.txt
Always activate the virtual environment before running AutoPentestX to ensure all dependencies are available.
Error Message:
ModuleNotFoundError: No module named 'nmap'
ImportError: No module named 'reportlab'
Cause: Python dependencies were not installed or the virtual environment is not activated.Solution:
# Activate virtual environment first
source venv/bin/activate

# Reinstall all requirements
pip install -r requirements.txt
Never install packages globally with sudo pip. Always use the virtual environment to avoid system-wide conflicts.
Error Message:
E: Unable to locate package nmap
E: Package 'nikto' has no installation candidate
Cause: Package lists are outdated or repository issues.Solution:
1

Update package lists

sudo apt-get update
2

Upgrade system packages

sudo apt-get upgrade
3

Install packages manually

sudo apt-get install -y python3 python3-pip python3-venv nmap nikto sqlmap git curl wget
4

Rerun installation script

./install.sh

Runtime Errors

Error Message:
[✗] Invalid target: 192.168.1.100
socket.gaierror: [Errno -2] Name or service not known
Cause: Target IP/domain cannot be resolved or is unreachable.Solution:
1

Verify network connectivity

ping -c 4 192.168.1.100
2

Check DNS resolution (for domains)

nslookup example.com
dig example.com
3

Verify target format

Make sure you’re using a valid IP address or domain:
  • Valid: 192.168.1.100, example.com, 10.0.0.1
  • Invalid: 192.168.1.1000, example .com, http://example.com
4

Check firewall rules

# Check if your firewall is blocking outbound connections
sudo ufw status
sudo iptables -L
Ensure you have network access to the target and that no firewall is blocking your scans.
Symptoms:
  • Scan completes but shows 0 open ports
  • All ports appear filtered or closed
  • PDF report has minimal information
Possible Causes:
  1. Target has no open ports (unlikely)
  2. Firewall is blocking scan traffic
  3. Insufficient permissions (no sudo)
  4. Network restrictions
Solutions:
# Many scan techniques require root privileges
sudo python3 main.py -t 192.168.1.100
Start with a quick scan on localhost (127.0.0.1) to verify AutoPentestX is working correctly before scanning remote targets.
Error Message:
[✗] Report generation failed
ImportError: cannot import name 'ImageReader' from 'PIL'
ReportLabError: Unable to generate PDF
Cause: PDF generation libraries are corrupted or missing dependencies.Solution:
1

Reinstall PDF libraries

pip install --upgrade reportlab pillow
2

Install system dependencies

sudo apt-get install -y libjpeg-dev zlib1g-dev
3

Verify installation

python3 -c "from reportlab.lib.pagesizes import letter; print('ReportLab OK')"
python3 -c "from PIL import Image; print('Pillow OK')"
4

Check reports directory

# Ensure reports directory exists and is writable
ls -la reports/
chmod 755 reports/
Even if report generation fails, scan data is still saved to the SQLite database in database/autopentestx.db.
Error Message:
sqlite3.OperationalError: unable to open database file
sqlite3.DatabaseError: database disk image is malformed
Solutions:
# Fix database directory permissions
mkdir -p database
chmod 755 database/
When pressing Ctrl+C during a scan:Expected Behavior:
[!] MISSION ABORT - Operator initiated shutdown
The scan will gracefully terminate and mark the status as “interrupted” in the database.If AutoPentestX hangs:
1

Force terminate

Press Ctrl+C multiple times or use:
# In another terminal
pkill -f "python3 main.py"
2

Check for zombie processes

ps aux | grep -E "nmap|nikto|sqlmap"
# Kill any remaining processes
sudo pkill nmap
sudo pkill nikto
sudo pkill sqlmap
Some subprocesses (Nmap, Nikto, SQLMap) may continue running even after terminating AutoPentestX. Always verify they’re stopped.

Tool-Specific Errors

Error Message:
nmap.nmap.PortScannerError: 'nmap program was not found in path'
Solution:
# Install Nmap
sudo apt-get install nmap

# Verify installation
which nmap
nmap --version
Nmap is required for all network scanning operations. AutoPentestX cannot function without it.
Error Message:
FileNotFoundError: [Errno 2] No such file or directory: 'nikto'
nikto: command not found
Solution:
# Install Nikto
sudo apt-get install nikto

# Alternative: Install from GitHub
git clone https://github.com/sullo/nikto.git
cd nikto/program
./nikto.pl -h
Workaround:
# Skip web scanning if Nikto is not available
python3 main.py -t 192.168.1.100 --skip-web
Error Message:
sqlmap: command not found
Solution:
# Install SQLMap
sudo apt-get install sqlmap

# Or download latest version
git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git
Skip SQL injection testing:
python3 main.py -t 192.168.1.100 --skip-web
Warning Message:
[!] Metasploit Framework not found
[!] Exploitation features will be limited
Solution:
1

Install Metasploit

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall
chmod 755 msfinstall
sudo ./msfinstall
2

Verify installation

msfconsole --version
Workaround:
# Skip exploitation phase entirely
python3 main.py -t 192.168.1.100 --skip-exploit
Metasploit is optional. AutoPentestX can perform reconnaissance and vulnerability scanning without it.

Performance Issues

Symptoms: Scan runs for 30+ minutesSolutions:
# Nikto and SQLMap are time-intensive
python3 main.py -t 192.168.1.100 --skip-web
# Reduces scan time by 10-15 minutes
Use --skip-web --skip-exploit for quick reconnaissance, then run a full scan later if needed.

Getting Help

If your issue is not listed here:
  1. Check the logs: ls -lh logs/ and examine recent log files
  2. Review scan database: sqlite3 database/autopentestx.db "SELECT * FROM scans ORDER BY id DESC LIMIT 5;"
  3. Test components individually: Run Nmap, Nikto, and SQLMap manually to isolate the issue
  4. Consult other troubleshooting pages:

Still Need Help?

Open an issue on GitHub with your error logs and system information

Build docs developers (and LLMs) love