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

FriendZone

9 Feb 2019 · 10 min read · root access
FriendZone - maquina de Hack The Box

Executive summary — FriendZone is an Easy Linux box that chains several small flaws all the way to root: a DNS zone transfer (AXFR) reveals hidden subdomains; SMB exposes an anonymous share with credentials and a writable one; a LFI in the admin panel includes a webshell uploaded over SMB (RCE as www-data); a leaked config file allows a password-reuse pivot to the friend user; and the final escalation abuses a world-writable Python os.py run by a root cron. A DNS → SMB → LFI/RCE → credential reuse → Python module → root path.

PlatformHack The Box
Operating systemLinux
DifficultyEasy
StatusRetired
Target IP10.129.23.177

Attack map

[21/22] FTP (vsftpd 3.0.3) + SSH (OpenSSH 7.6p1) open, not exploited
[53] DNS → zone transfer (AXFR) → hidden subdomains
[139/445] SMB: «general» (anon → creds.txt) · «Development» (writable)
   │  mount hint in the «Files» share comment (/etc/Files)
   │  [443] administrator1: log in with the SMB creds → dashboard.php with LFI (pagename)
   │  upload a webshell to Development (mounted at /etc/Development) → include it via LFI
   ▼
[RCE]  www-data  (id confirms execution)
   │  /var/www/mysql_data.conf leaks MySQL credentials for «friend»
   │  the same password works for the friend system account (reuse)
   ▼
[USER]  friend  (user.txt)
   │  /usr/lib/python2.7/os.py is world-writable + root cron (run-parts/cron.hourly)
   ▼
[ROOT]  inject a reverse shell into os.py → root cron runs it

1. Reconnaissance

nmap -sV -sC -p- -Pn 10.129.23.177
21/tcp   open  ftp     vsftpd 3.0.3
22/tcp   open  ssh     OpenSSH 7.6p1
53/tcp   open  domain  ISC BIND 9.11.3
80/tcp   open  http    Apache 2.4.29  ("Friend Zone Escape software")
139/tcp  open  netbios-ssn  Samba
443/tcp  open  ssl/http     (cert: friendzone.red)
445/tcp  open  microsoft-ds Samba

FTP and SSH are open but don't offer an entry point on their own (no anonymous FTP, no SSH credentials yet). Port 80 only serves a themed landing page ("Friend Zone Escape software"); the 443 certificate, on the other hand, is the first real lead: it reveals the domain friendzone.red.

🔒 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.