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

Spectra

27 Feb 2021 · 12 min read · root access
Spectra - maquina de Hack The Box

Executive summary — Spectra is an interesting Easy box because it doesn't run a standard Linux, but ChromiumOS. A forgotten directory listing at /testing/ exposes wp-config.php.save, a leftover backup with the database credentials. Those credentials don't work against MySQL remotely (the server restricts the source host), but the admin reuses them as their WordPress account password: we log into the panel and edit an inactive theme's 404.php template for RCE. With LinPEAS we find a ChromiumOS-specific autologin file holding katie's password in plaintext (SSH, user.txt). katie can run /sbin/initctl via sudo —the Upstart job manager, which isn't listed on GTFOBins— and the test job /etc/init/test.conf is editable: we inject a payload that runs as root. Path: wp-config.save -> WP RCE -> autologin -> katie -> initctl -> root.

PlatformHack The Box
Operating systemLinux (ChromiumOS)
DifficultyEasy
StatusRetired
Target IP10.10.10.229

Attack map

[80] /testing/ with directory listing -> wp-config.php.save (DB creds)
   |  the DB refuses remote connections, but the admin reuses that
   |  password on WordPress
   v
[WP admin]  edit 404.php on an inactive theme -> reverse shell (www-data)
   |  ChromiumOS (not standard Linux) -> LinPEAS -> plaintext autologin
   |  passwd file -> katie password
   v
[SSH]  katie  (user.txt)
   |  sudo NOPASSWD /sbin/initctl (Upstart, not on GTFOBins) ->
   |  editable /etc/init/test.conf job
   v
[ROOT]  inject reverse shell into the job -> initctl start test

1. Nmap reconnaissance

Before running a heavy scan with version detection and scripts, it's worth quickly finding which ports are open, to avoid scanning all 65535 with -sC -sV (much slower):

sudo nmap -p- --min-rate=10000 -oA allports 10.10.10.229 -v

-p- sweeps all 65535 TCP ports; --min-rate=10000 forces a high send rate (more false negatives on high-latency networks, but works fine on HTB); -oA saves the output in all three formats with the given prefix.

With the list of open ports (22, 80, 3306), we run a detailed scan against just those:

sudo nmap -sC -sV -Pn -T4 -p22,80,3306 10.10.10.229 -oN nmap_detailed.txt
PortServiceDetail
22SSHOpenSSH
80HTTPWeb server
3306MySQLDatabase, restricted access

Without credentials yet for either SSH or MySQL, the entry vector can only be port 80.

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