root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat farewell.md
// Offensive

Farewell

21 Jun 2023 · 11 min read · root access
Executive summary — Farewell is a TryHackMe web room solved by chaining low-severity flaws: the login portal enumerates users and leaks password hints, narrowing the deliver11 account down to a Tokyo+4-digit pattern; a WAF with rate-limiting is bypassed by rotating X-Forwarded-For and tuning the User-Agent to complete the brute force; once in as a user, a stored XSS in the message form runs in the administrator's browser and, because the PHPSESSID cookie lacks the HttpOnly flag, it lets us steal the admin's session and take over the panel. A full Enumeration → Brute force → Stored XSS → Cookie theft → Admin path.
PlatformTryHackMe
Operating systemLinux
DifficultyMedium
RoomFarewell
Target IP10.48.178.163

Attack map

[80/HTTP]  Apache 2.4.58 — login portal
   │  username enumeration → password-hint disclosure
   ▼
[deliver11]  hint "Tokyo" + 4 digits (brute-forceable)
   │  WAF bypass: User-Agent + X-Forwarded-For rotation → password
   ▼
[dashboard.php]  USER FLAG + "Submit Farewell Message" form
   │  stored XSS reviewed by the admin bot (WAF keyword-filter bypass)
   ▼
[admin PHPSESSID]  cookie stolen (missing HttpOnly flag)
   │  session hijacking in the browser DevTools
   ▼
[admin.php]  ADMIN FLAG

1. Initial reconnaissance

We start by mapping the attack surface with a full port scan, version detection and default scripts:

nmap -T4 -n -sC -sV -Pn -p- 10.48.178.163

Why these flags:

  • -p- → scans all 65535 TCP ports, not just the usual top 1000.
  • -sC -sV → default NSE scripts + per-service version detection.
  • -Pn -n → skip host-discovery ping and DNS resolution (faster).

Relevant results:

  • Port 22 → OpenSSH 9.6p1.
  • Port 80 → Apache 2.4.58 serving a login form. The PHPSESSID cookie is issued without the HttpOnly flag —a seemingly minor detail that turns out to be decisive at the end—.
🔒 Clearance required

This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.

See Root Access plans

No account? Create one free then upgrade from your console.