Skip to content

The OSCP mindset & method

← Back to index

This page is the most important one in the repo. Every other page is commands; this one is how to think, because that — not the commands — is what the exam grades you on. If you internalise only one page, make it this one.

What the exam is actually testing

The OSCP does not test whether you can run linpeas. It tests whether, dropped onto an unfamiliar machine with no hints, you can systematically turn "I have nothing" into "I have root" — and do it again on a box that looks nothing like the last one. That skill is judgment under uncertainty: forming a theory from scraps of output, testing it, and — when it fails — knowing what to try next instead of freezing or flailing.

So read every command in these notes as a means to an end. The end is always a decision: "what did that tell me, and what does it make me want to try?"

The one belief that carries you

If you are stuck, the way forward is already within reach of your current access — you just haven't seen it yet. Stuck is not a signal to try something exotic. It's a signal that you've stopped looking.

This is the real meaning of "enumeration is 80%." It doesn't mean "run lots of scanners." It means: the foothold is almost always a service you enumerated shallowly, a version you didn't search, an output line you skimmed, or a credential you found and didn't reuse. When you feel stuck, the correct instinct is to go back — re-read what you already have — not forward into some clever new exploit.

How to enumerate with intent (not just run tools)

Running a tool is not enumeration. Reading its output and forming a question is. The loop:

flowchart TD
  A["Run an enumeration step"] --> B["Read ALL the output, slowly"]
  B --> C["Form a hypothesis: 'this looks exploitable because...'"]
  C --> D["Test the smallest version of that hypothesis"]
  D --> E{"Did it behave as predicted?"}
  E -->|yes| F["Exploit / escalate -> new access"]
  E -->|no| G["What does the failure rule OUT? Update the theory."]
  G --> C
  F --> A

The two steps people skip are B (actually reading everything) and G (treating a failure as information). A failed attempt is not a dead end — it narrows the space. "The SUID exploit didn't fire" tells you the binary isn't what you thought, which is progress.

A worked example of the loop

You land a www-data shell on a Linux box. Instead of immediately firing linpeas, you think:

  1. id → www-data. sudo -l → asks for a password you don't have. Hypothesis killed: no easy sudo.
  2. You read /var/www/html/config.php (web shell → you're already in the web root) → it holds db_user / S3cureP@ss. Signal: a credential.
  3. The reuse instinct fires. su with that password? cat /etc/passwd shows a user john. su john with S3cureP@ss → it works. Access changed.
  4. Access changed, so you restart enumeration as john: sudo -l → (root) NOPASSWD: /usr/bin/less. Hypothesis: GTFOBins has less. It does → !/bin/sh → root.

Notice the win came from reading a file and reusing a credential, not from a scanner. The scanner would have helped, but the mindset — "I found a password, where else does it work?" — is what actually rooted the box.

The stuck-protocol (what "try harder" really means)

"Try harder" is terrible advice stated plainly, because it sounds like "do more of what isn't working." What it actually means is try differently, systematically. When you've been stuck ~20 minutes, run this protocol instead of grinding:

  1. Re-read your own notes for this host from the top. Out loud if you can. You will find something you noted and didn't act on — a version, a username, a comment, a second port.
  2. Pick the service you enumerated least. You almost certainly went deep on 80 and glanced at the rest. Go deep on the one you glanced at.
  3. Re-run enumeration at your current access level. A shell sees internal ports, local files, running processes, and config that nmap never will. Did you actually enumerate as this user, or are you still working from the external scan?
  4. Take every credential/username you have and spray it everywhere — SSH, SMB, WinRM, the web login, the database, every other host.
  5. Search every version string again, this time on Google/GitHub, not just searchsploit.
  6. Change one variable. Different port for your callback (443/80/445 beat firewalls). Different shell type. Different wordlist.
  7. Physically step away for five minutes. This is not a joke — it's in the protocol because fatigue tunnel-visions you, and the answer is often obvious after a walk.

If you do all seven and still have nothing, then consider it a genuinely hard box and rotate to another target. Stuck is a process failure far more often than a hard box.

How to read output (the skill nobody teaches)

Tools bury one important line in a hundred boring ones. Train these reflexes:

  • Versions are leads, not trivia. Every 2.4.49, vsftpd 2.3.4, Windows Server 2016 Build 14393 is a thing to search. Copy it into your notes the moment you see it.
  • "Anonymous / null / default allowed" is a flashing light. Anonymous FTP, null SMB sessions, default creds on a panel — these are intended footholds far more often than a buffer overflow.
  • Anything that looks like a credential or a username is gold — a description field, a config value, a process running with a password in its arguments, a comment in page source. Note it and reuse it.
  • "Unusual" beats "vulnerable." You rarely get told something is exploitable. You get told something is non-standard — a SUID binary that shouldn't be SUID, a service running from C:\Temp, a cron job you can write to. Your job is to notice the thing that's out of place.
  • Normal is a baseline, not boredom. You can only spot the weird SUID binary if you know which SUID binaries are normal. Over time you build that baseline; until then, GTFOBins is your "is this normal?" oracle.

Access changes reset everything

The single most common wasted hour on the exam is enumerating a box from one perspective. Every time your access changes — a new open port, a shell, a new user, a foothold on a new host — start enumeration over from scratch at that level. The www-data shell, the john user, and root all see three completely different machines. New access = new enumeration, every time, no exceptions.

Time and emotion are part of the method

  • The 20-minute rule. No new information in ~20 minutes → run the stuck-protocol, then rotate targets. Sunk cost is not a strategy.
  • Get on the board early. Score something in the first few hours (often the AD foothold, worth 10). A single flag kills the panic spiral and lets you think.
  • Breaks are not time lost. A tired brain misses the obvious line in the output. The walk pays for itself.
  • Document as you go, not at the end. Screenshot every flag with id/ipconfig visible, and log the command that worked. A box you rooted but can't prove or reproduce scores zero — the mindset includes proving it, not just popping it.

The checklist (so the method survives stress)

Under exam pressure you will forget steps. Externalise the method into a per-host checklist and follow it mechanically — discipline beats memory at hour 14:

[ ] full TCP scan (all 65535) + top UDP — did I scan EVERY port?
[ ] for EACH open port: version noted, searchsploit'd, default/anon creds tried, "what does it leak?" answered
[ ] web: dirs, vhosts, source + comments, CMS version, default creds
[ ] every credential/username tried EVERYWHERE (ssh/smb/winrm/web/db/other hosts)
[ ] foothold -> shell STABILISED (TTY) -> re-enumerate AS this user
[ ] local enum: automated (peas) AND manual checklist
[ ] privesc -> proof.txt -> screenshot (flag + ip visible)
[ ] loot creds/keys/hashes for the NEXT host before leaving
[ ] stuck 20 min? -> run the stuck-protocol, THEN rotate

Everything after this page is detail. This page is the exam.