How Exploit Matching Works
The exploit engine analyzes vulnerabilities from two sources:- Service-based matching: Vulnerable service versions detected by Nmap
- CVE-based matching: Known CVEs from the intelligence database
Exploitation Phases
1
Vulnerability Input
The engine receives vulnerability data from Phase 3 and Phase 4:
2
Exploit Database Lookup
Vulnerabilities are matched against the internal exploit database:
3
Confidence Scoring
Each match receives a confidence level:
- HIGH: Exact service version match
- MEDIUM: CVE-based match
- LOW: Generic service match
4
Safe Mode Check
Before simulation, the engine verifies each exploit’s safety rating:
5
Simulation & RC Script Generation
For safe exploits, Metasploit resource scripts are generated:
Built-in Exploit Database
AutoPentestX includes exploits for common vulnerabilities:- FTP Exploits
- SMB Exploits
- Web Exploits
VSFTPD 2.3.4 Backdoor
Metasploit Module:exploit/unix/ftp/vsftpd_234_backdoorDescription: VSFTPD version 2.3.4 contains a backdoor allowing remote code execution.Trigger Conditions:- Service:
ftp - Version:
vsftpd 2.3.4
ProFTPD 1.3.3c Backdoor
Metasploit Module:exploit/unix/ftp/proftpd_133c_backdoorDescription: ProFTPD 1.3.3c backdoor allows remote command execution.Trigger Conditions:- Service:
ftp - Version:
proftpd 1.3.3
Console Output Interpretation
Phase 6: Exploitation Assessment
Terminal Output
Status Meanings
success
Exploit was deemed safe and an RC script was generated. You can manually test this exploit using Metasploit.
warning
Exploit was flagged as potentially destructive and was not simulated, even in safe mode.
error
Safe mode prevented execution (this status appears if
--no-safe-mode is used, but exploitation is still blocked).Metasploit Resource Scripts
RC scripts are saved to theexploits/ directory and can be used for manual exploitation.
RC Script Structure
exploits/exploit_192.168.1.100_21_20240311_143022.rc
Using RC Scripts with Metasploit
1
Start Metasploit
Launch msfconsole:
2
Load the RC Script
Use the The script will:
resource command to load the script:- Load the exploit module
- Configure all parameters
- Run the
checkcommand to verify exploitability
3
Review Check Results
Metasploit’s or
check command tests if the target is vulnerable:4
Manual Exploitation (Optional)
If you have authorization and want to proceed:
Customizing RC Scripts
You can edit RC scripts before running them:Modified Script
Safe Mode vs No-Safe-Mode
Default Behavior (Safe Mode)
- ✅ Identifies exploitable vulnerabilities
- ✅ Matches exploits from database
- ✅ Generates Metasploit RC scripts
- ✅ Runs
checkcommand simulation - ❌ Does NOT execute exploits
- ❌ Does NOT modify target system
- ❌ Does NOT open reverse shells
Disabling Safe Mode
- ⚠️ Could execute actual exploits
- ⚠️ May crash services
- ⚠️ Could damage target systems
- ⚠️ Might trigger IDS/IPS alerts
- ⚠️ Legal liability if unauthorized
modules/exploit_engine.py:127-132:
Skipping Exploitation Phase
Use--skip-exploit to disable the entire exploitation phase:
- Phase 6 is skipped entirely
- No exploit matching occurs
- No RC scripts are generated
- Reduces scan time by 2-5 minutes
- Report shows 0 exploitation attempts
- ✅ Pure vulnerability discovery
- ✅ Compliance scanning
- ✅ Time-constrained assessments
- ✅ When Metasploit is not installed
Exploitation in PDF Report
The report includes an “EXPLOITATION ASSESSMENT” section:Section Content
Report Excerpt
Interpreting Results
SIMULATED Status
SIMULATED Status
Meaning: Exploit is available and an RC script was generated.Action Items:
- Review the RC script in
exploits/directory - Test in a lab environment first
- If authorized, manually execute using Metasploit
- Document findings
SKIPPED Status
SKIPPED Status
Meaning: Exploit exists but is flagged as dangerous.Action Items:
- Investigate the CVE manually
- Check vendor patches
- Test in an isolated lab only
- Do NOT attempt on production systems
No Exploits Matched
No Exploits Matched
Meaning: No known exploits for detected vulnerabilities.Action Items:
- Vulnerabilities still exist (lack of exploit ≠ lack of risk)
- Review CVE details for manual testing approaches
- Check vendor advisories
- Apply patches based on vulnerability severity
Manual Metasploit Workflow
After AutoPentestX generates RC scripts, follow this workflow for manual testing:Database Storage
Exploit attempts are stored in the database:Query Exploitation Data
Best Practices
Always Get Authorization
Never attempt exploitation without explicit written permission, even in safe mode.
Test in Labs First
Use Metasploitable, DVWA, or other vulnerable VMs for practice before testing real systems.
Keep Safe Mode Enabled
Only disable safe mode if you’re an expert and have proper authorization.
Document Everything
Keep detailed records of all exploitation attempts and results for legal protection.
Next Steps
Report Analysis
Learn how to interpret and act on PDF report findings
API Reference
Complete CLI flag reference and examples