Skip to main content

Overview

AutoPentestX generates Metasploit Resource (RC) scripts during the exploitation assessment phase. These scripts allow security professionals to manually validate identified vulnerabilities in controlled environments. All scripts are generated in SAFE MODE by default and require manual activation.
Safe Mode: AutoPentestX never automatically executes exploits. All exploitation is simulated, and RC scripts are provided for manual review and execution by authorized professionals only.

RC Script Location

All Metasploit resource scripts are saved to the exploits/ directory:
Naming Convention: exploit_{target}_{port}_{timestamp}.rc

RC Script Structure

Each generated script follows this format:

Script Components

Metadata for tracking:
  • Script purpose
  • Generator tool
  • Target information
  • Generation timestamp
Specifies the Metasploit exploit module to load based on:
  • Detected vulnerability
  • Service version
  • CVE matching
Pre-configured with scan results:
  • RHOSTS: Target IP or hostname
  • RPORT: Service port number
Default payload settings:
  • Reverse TCP shell (most compatible)
  • Placeholder LHOST (must be updated)
  • Standard port 4444
Non-invasive vulnerability check:
  • Verifies if target is vulnerable
  • Does not execute exploit
  • Safe for production systems
Manual activation required:
  • Prevents accidental execution
  • Requires explicit decision
  • Ensures authorized use only

Using RC Scripts

Loading in Metasploit Console

Checking Vulnerability

After loading the RC script:
Check command results:
  • The target appears to be vulnerable - Exploit likely to succeed
  • The target is not exploitable - Target not vulnerable
  • Unknown - Unable to determine (may still be vulnerable)

Configuring Payload

Update the LHOST before execution:

Executing Exploit (Manual Only)

WARNING: Only execute exploits on systems you own or have explicit written authorization to test. Unauthorized exploitation is illegal.

Exploit Database

AutoPentestX includes built-in exploit mappings for common vulnerabilities:

FTP Exploits

HTTP Exploits

SMB Exploits

*Potentially destructive - skipped in safe mode

Exploit Matching Logic

AutoPentestX uses two methods to match exploits:

1. Service Version Matching

Matches service banners to known vulnerable versions:

2. CVE-to-Exploit Mapping

Matches CVE identifiers to exploit modules:

Exploitation Output

During scan execution, the exploitation phase logs:

Customizing RC Scripts

After generation, you can manually customize scripts:

Change Payload

Add Advanced Options

Multiple Attempts

Safe Mode Behavior

AutoPentestX implements multiple safety layers:
Exploits marked as safe: False are automatically skipped in safe mode.
Even with Metasploit available, exploits are never automatically executed.
All RC scripts include commented exploit commands:
This prevents accidental execution via msfconsole -r script.rc.

Exploitation Report

Generate a JSON report of all exploitation attempts:
Output format:

Metasploit Detection

AutoPentestX automatically checks for Metasploit availability:
Or:
If Metasploit is not installed, RC scripts are still generated but cannot be loaded.

Installing Metasploit

Best Practices

  1. Always Review Scripts: Inspect RC scripts before loading in Metasploit
  2. Verify Authorization: Ensure written permission before exploitation
  3. Use Check Command: Run check before exploit to verify vulnerability
  4. Update LHOST: Always set your correct attacker IP address
  5. Lab Environment: Test exploits in isolated lab environments first
  6. Document Actions: Keep records of all exploitation attempts
  7. Safe Payloads: Start with non-destructive payloads (reverse shells)
  8. Backup Targets: Back up target systems before exploitation (if possible)
Legal Disclaimer: Unauthorized exploitation of computer systems is illegal in most jurisdictions. Always obtain explicit written permission before conducting penetration tests. AutoPentestX is designed for authorized security assessments only.

Troubleshooting

Cause: No exploits matched to vulnerabilitiesSolution:
  • Verify vulnerabilities were detected
  • Check if Metasploit is installed
  • Review logs for exploit matching errors
  • Manually search Metasploit for applicable exploits
Cause: Exploit flagged as potentially destructiveExample:
Solution:
  • Review exploit safety classification
  • Use in isolated lab environment only
  • Manually execute with extreme caution
Cause: False positive from automated detectionSolution:
Cause: Firewall, incorrect LHOST, or payload mismatchSolution: