The idea
You are ops on the Harlow Dispatch depot box at 10.0.1.20 — the low operator shell the last playbook won,
carried here as evidence. A foothold is not control: ops cannot read the box's secrets, and your job now is to find the one
lever up. That is escalation, and it almost always opens with enumeration — reading
the box, patiently, for the one thing left wrong. The skill is twofold: when to sweep (hundreds of checks at once
with linpeas) versus check by hand (a few sharp commands you already know), and then telling the real lever
from the noise — most of what enumeration turns up is a dead end. You will meet both, and leave naming the vector
the next lab climbs.
Steps
-
Where the foothold leaves you
Start by placing yourself. Click Start to open a shell on the box over the foothold, then run three short reads:
idto see who you are,cat /etc/shadowto feel the wall a foothold stops at, and the appliance's own console record to confirm where you are standing.Watch the shadow file refuse you.
/etc/shadowholds every account's password hash and is readable by root alone — so an operator login is turned away flat. That refusal is the exact gap the rest of this playbook closes: everything from here is about turningopsinto the user who can read it.attacker:~# ssh box
-
The cheapest check, and why it ends here
Every escalation opens with the cheapest check there is: what may I already run as root? That is what
sudo -lasks. Add-n(non-interactive) so it never stops to prompt for a password you may not have — on a soft box this one line ends the job, because an operator left with asudorule can often run a root shell outright.Read what comes back carefully, because it is a lesson in dead ends. On this box
sudois locked behind a password, and you do not have one: the foothold was a login, not a password you can retype intosudo. No rule you can see, no password to offer — so this door is shut. That is the normal case, and recognising a dead end fast is half the skill. You move on.attacker:~# ssh box 'sudo -n -l'
-
Hunt the setuid binaries — lever or noise
Here is the check that pays off. A Setuid and setgid program runs as its owner, not as whoever started it — the bit shows as
sin-rwsr-xr-xand is matched byfind … -perm -4000. Owned by root, such a program runs as root for everyone. List every one in the system binary directories.Now the real work, which no tool does for you: tell the lever from the noise. Most of this list is expected —
mount,umount,su,sudo,passwd,chsh: tools that are setuid for good reason and do only their one fixed job, so you cannot bend them. The lever is the odd one out — a binary with no business being setuid-root, especially one that can run other commands. That is what GTFOBins catalogues, binary by binary. Scan the list for the name that does not belong.attacker:~# ssh box 'find /usr/bin /usr/sbin /bin /sbin -perm -4000 -type f'
-
Sweep it all with linpeas
By hand you ran two checks and got lucky on the second. A real box has dozens of places a lever can hide — sudo, setuid, file capabilities, cron jobs, writable service files, readable secrets — and checking each by eye is slow, and a check skipped is a lever missed. linpeas runs hundreds of those checks in one pass and flags what looks wrong, so a second lever you would have walked past still surfaces. That is the whole trade: by hand is fast and quiet for a hunch; the sweep is for coverage.
linpeas lives on your Kali box; the target has no internet, so copy it over the foothold with
scp, then run only its setuid group so it finishes in seconds. Watch it land on the sameniceyou found — and notice it is checking far more than you did by hand.attacker:~# scp /usr/share/peass/linpeas/linpeas.sh box:/tmp/linpeas.sh attacker:~# ssh box 'bash /tmp/linpeas.sh -N -q -o interesting_perms_files'
-
Name the lever — and the defender's answer
Lay it out and name the vector, because the next lab starts from it. Two checks came up empty or shut (
sudo), and one found the way: a setuid-root binary that should not be setuid at all. Confirm it with your own eyes —ls -lshows theswhere anxbelongs.That
sis the whole finding:-rwsr-xr-xmeans anyone who runs/usr/bin/niceruns it as root. You will not exploit it here — naming the lever is the job of enumeration. The vector goes into your evidence: a setuid binary at/usr/bin/nice.The defender's answer to this stage. Enumeration found the lever because the box handed it one. The fixes are least privilege, top to bottom: audit the setuid binaries and drop the bit from any that do not truly need it (
chmod u-s), scope sudo rules to the few commands an operator needs rather than a blanket grant, and keep secrets out of world-readable files. A box with no odd setuid bit, no loose sudo rule and no readable secret gives enumeration nothing to find.attacker:~# ssh box 'ls -l /usr/bin/nice'
Run these steps on real machines