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

Armageddon

27 Mar 2021 · 9 min read · root access
Armageddon - maquina de Hack The Box

Executive summary — Armageddon is an Easy Linux box on CentOS 7 that opens with Drupalgeddon2 (CVE-2018-7600), an unauthenticated RCE in Drupal 7. From the resulting apache shell we read MySQL credentials out of settings.php, dump Drupal's users table and crack brucetherealadmin's hash to SSH in. The final escalation abuses a misconfigured sudo rule (NOPASSWD: /usr/bin/snap install *) by packaging a malicious snap whose install hook runs as root. A Drupalgeddon2 → settings.php → MySQL → cracked hash → SSH → sudo snap install → root path.

PlatformHack The Box
Operating systemLinux — CentOS 7 (Apache 2.4.6 + PHP 5.4.16)
DifficultyEasy
StatusRetired
Target IP10.129.48.89

Attack map

[80] Drupal 7 (CentOS 7, Apache 2.4.6, PHP 5.4.16)
   │  CVE-2018-7600 (Drupalgeddon2) — Forms API property injection
   │  via form_build_id → unauth RCE → apache
   ▼
[FILE]  sites/default/settings.php → cleartext MySQL credentials (drupaluser)
   │  mysql -u drupaluser drupal → users table → brucetherealadmin's Drupal 7 hash
   ▼
[HASH]  $S$... (Drupal 7, salted SHA-512) → hashcat -m 7900 + rockyou → booboo
   ▼
[SSH]  brucetherealadmin : booboo  (user.txt)
   │  sudo -l → NOPASSWD: /usr/bin/snap install *  (unrestricted wildcard)
   ▼
[ROOT]  malicious snap (fpm) with an install hook → reverse shell as root (root.txt)

1. Reconnaissance

We add the box to /etc/hosts and run a full port scan:

echo "10.129.48.89 armageddon.htb" | sudo tee -a /etc/hosts
nmap -sC -sV -p- armageddon.htb
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.4 (protocol 2.0)
80/tcp open  http    Apache httpd 2.4.6 (CentOS) PHP/5.4.16

CentOS 7 with Apache 2.4.6 and PHP 5.4.16 (EOL for years) already points to an unmaintained stack. We confirm the CMS with curl:

curl -s http://armageddon.htb/ | grep -i drupal

The <meta name="Generator" content="Drupal 7 …"> tag and robots.txt (with Drupal's typical /modules, /themes, /sites paths) confirm Drupal 7, vulnerable to Drupalgeddon2 if unpatched.

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