Dyplesher
Summary
An attacker port-scanned Dyplesher (<retired-instance-ip>) and found a self-hosted Gogs Git service on port 3000 whose repositories embedded the Memcached SASL password in source-controlled configuration files and distributed MinatoTW's SSH private key as a release-bundle artifact.
Authenticating to the SASL-protected Memcached instance on port 11211 with those credentials exposed cached user records — email addresses, usernames, and bcrypt password hashes for all three application accounts — one of which cracked to a dictionary word.
The SSH private key from the Gogs bundle opened a shell as MinatoTW; a system credential for felamos hard-coded in the repository source enabled lateral movement and retrieval of the user flag.
To escalate to root, MinatoTW's unnecessary membership in the system Wireshark packet-capture group allowed sniffing the local RabbitMQ AMQP stream and recovering authenticated broker credentials; a Lua plugin URL published to RabbitMQ's plugin_data exchange is silently consumed by the root-owned Cuberite game-server process, which fetches and auto-loads the payload, granting full root code execution.
Attack path — how the box was taken
Mapped the full service stack across all TCP ports, then Extracted Memcached credentials and an SSH private key from Gogs repositories, then Authenticated to SASL-protected Memcached and dumped all cached user records, then Cracked the felamos bcrypt hash offline to recover her plaintext password, then Established a shell as MinatoTW using the SSH private key recovered from Gogs, then Switched to the felamos account with a hardcoded system password and read the user flag, then Sniffed the loopback AMQP stream via packet-capture group membership to recover RabbitMQ credentials, then Delivered a root-shell Lua plugin to the Cuberite game server via RabbitMQ and achieved full system compromise.
Exact commands 2
nmap -Pn -sS -sV -p- --min-rate 5000 -oA dyplesher_full $TARGETnmap -Pn -sV -p22,80,3000,4369,5672,11211,25562,25565,25672 --script default $TARGETExact commands 2
curl -s http://$TARGET:3000/explore/reposgit clone http://$TARGET/:3000/<user>/<repo>.gitExact commands 1
hashcat -m 3200 -a 0 --username felamos.hash /usr/share/wordlists/rockyou.txtExact commands 2
chmod 600 /tmp/dypl_rsassh -i /tmp/dypl_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null MinatoTW@$TARGETExact commands 2
su - felamoscat /home/felamos/user.txtExact commands 2
groupstcpdump -i lo -s0 -w /tmp/broker.pcap port 5672Exact commands 2
printf 'os.execute("cp /bin/bash /tmp/rootbash && chmod 4755 /tmp/rootbash")\n' > /tmp/pwn.luacd /tmp && python3 -m http.server 8888 &Attack patterns used
The transferable techniques behind the compromise.
Credentials in version-controlled filesSource Code ExposureT1552.001
What it is
The Gogs instance on port 3000 hosted repositories readable without strong authentication controls. Source-controlled configuration files committed to at least one repository contained the Memcached SASL credential pair felamos:[REDACTED: recovered credential] in plaintext. A release bundle distributed through the same Gogs service included MinatoTW's RSA SSH private key, giving the attacker direct authenticated system access without needing to crack any password. Both artefacts were never intended to be public but were pushed inadvertently into version control.
Why it works
Immediately rotate every credential and revoke every key that has appeared in a commit, even if subsequently deleted (git history is permanent unless rewritten). Going forward: store all runtime secrets in environment variables or a dedicated secrets manager (HashiCorp Vault, AWS Secrets Manager, Bitwarden Secrets); never commit .env files or private key files — add them to .gitignore; enforce a pre-commit hook such as git-secrets or trufflehog to block future secret commits; set all Gogs repositories to Private by default and review existing visibility settings.
Credential extraction from network cache serviceCredential AccessT1040
What it is
Memcached on port 11211 required SASL PLAIN authentication but was reachable over the network. Using felamos:[REDACTED: recovered credential] recovered from the Gogs repository, the attacker authenticated via the binary protocol and retrieved three predictably-named cache keys: email (three user addresses in the @dyplesher.htb domain), username (MinatoTW, felamos, yuntao), and password (three bcrypt hashes). The entire application user database was exposed in a single authenticated cache dump.
Why it works
Edit /etc/memcached.conf to set '-l 127.0.0.1' so Memcached only listens on loopback. Add a ufw rule to explicitly deny inbound connections to 11211 from any external interface as a defence-in-depth layer: 'ufw deny in on eth0 to any port 11211'. If remote access is operationally required, tunnel it through SSH port forwarding rather than exposing the port directly.
Offline password cracking — bcrypt dictionary attackCredential AccessT1110.002
What it is
The three bcrypt hashes extracted from Memcached were submitted to offline dictionary cracking. The hash for felamos ($2y$12$…, cost factor 12) matched the common word mommy1. The hashes for MinatoTW and yuntao resisted the available wordlist — but MinatoTW's access was already assured via the SSH private key recovered in step 2. The felamos plaintext credential confirmed that guessable, dictionary-word passwords were protecting application accounts.
Why it works
Remove all password hashes and personally identifiable information from the cache immediately. If authentication state must be cached, store only short-lived opaque session tokens keyed by a random UUID — never the underlying credential. Implement per-tenant or per-application SASL credentials with the least privilege needed, so a cache breach cannot expose other applications' data.
Network sniffing — loopback AMQP credential captureCredential AccessT1040
What it is
MinatoTW is a member of the system's Wireshark packet-capture group, which grants raw socket access to all network interfaces including the loopback adapter. By capturing traffic on the loopback interface filtered to port 5672 (AMQP), the attacker intercepted RabbitMQ authentication frames transmitted by other local processes. AMQP SASL PLAIN authentication sends credentials as null-delimited cleartext within the frame payload, so the username and password were directly readable from the capture without decryption. These credentials are the entry ticket for the root escalation step.
Why it works
Audit all packet-capture group members: 'getent group wireshark' (adjust for your distribution's capture group name). Remove any account that does not have a current, documented operational need to capture live traffic. If ad-hoc packet capture is genuinely needed for troubleshooting, grant temporary group membership through a change-management workflow and revoke it immediately after the task is complete rather than maintaining it permanently.
Remote plugin delivery via message-queue consumer executing as rootPrivilege EscalationT1574
What it is
The Cuberite game-server process runs as root and subscribes to a RabbitMQ exchange named plugin_data, from which it fetches plugin code by URL and auto-loads it as a Lua plugin. Because outbound HTTP from the server is blocked, the attacker hosted a reverse-shell Lua payload on the target's loopback interface using a Python HTTP server, then published that local URL to the plugin_data exchange using the AMQP credentials captured in the previous step. Cuberite fetched the URL as root, executed the Lua code, and granted the attacker a root shell — completing full system compromise.
Why it works
Create a dedicated low-privilege OS account ('useradd -r -s /usr/sbin/nologin cuberite') and configure the SystemD unit file with 'User=cuberite'. Restrict RabbitMQ publish permissions on the plugin_data exchange to a named administrative identity only — not to every authenticated broker user. Before loading any plugin, verify its cryptographic hash or signature against a trusted manifest; reject any plugin whose source URL is not on an explicit allowlist of internal, integrity-controlled locations.
Findings
Exposed services
| 22/tcp | ssh OpenSSH 8.0p1 Ubuntu 6build1 (Ubuntu Linux; protocol 2.0) |
| 80/tcp | http Apache httpd 2.4.41 ((Ubuntu)) |
| 3000/tcp | http Golang net/http server |
| 4369/tcp | epmd Erlang Port Mapper Daemon |
| 5672/tcp | amqp RabbitMQ 3.7.8 (0-9) |
| 11211/tcp | unknown recon-sweep-discovered |
| 25562/tcp | unknown |
| 25565/tcp | unknown recon-sweep-discovered |
| 25672/tcp | unknown recon-sweep-discovered |