root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat valentine.md
// writeups

Valentine

17 Feb 2018 · 10 min read · root access
Valentine - maquina de Hack The Box

Executive summary — Valentine is an Easy Linux box that doesn't rely on a single exploit, but on a chain of matching clues: an RSA private key exposed on the web (encrypted, hex-encoded) and the Heartbleed (CVE-2014-0160) vulnerability, which leaks memory from the TLS process and with it the key's passphrase. With the key decrypted we SSH in as hype, and escalation abuses a poorly protected root tmux session: its socket is readable/writable by our user, so attaching is enough. A Heartbleed + RSA key → SSH → tmux → root path.

PlatformHack The Box
Operating systemLinux
DifficultyEasy
StatusRetired
Target IP10.129.232.136

Attack map

[22,80,443] nmap → OpenSSH 5.9p1 (old) + Apache 2.2.22 on HTTP and HTTPS
[80] gobuster → /dev/ (hype_key + notes.txt), /encode, /decode
   │  hype_key: encrypted RSA private key, hex-encoded
   ▼
[443] Heartbleed (CVE-2014-0160) → memory leak → base64 passphrase
   │  openssl rsa decrypts hype_key with that passphrase
   ▼
[SSH]  hype  (decrypted key, negotiating legacy ssh-rsa)  → user.txt
   │  .bash_history reveals a root tmux socket: /.devs/dev_sess
   ▼
[ROOT]  tmux -S /.devs/dev_sess attach → root.txt

1. Reconnaissance

As in any real assessment, the first step is identifying exposed services with a full port scan:

nmap -Pn --open -sV -sC -p- 10.129.232.136
  • -Pn → skips host-discovery ping (HTB usually blocks ICMP).
  • --open → shows only open ports.
  • -sV → tries to identify each service's version.
  • -sC → runs the default NSE scripts.
  • -p- → scans all 65535 ports, not just the top-1000.
22/tcp   open  ssh      OpenSSH 5.9p1 Debian 5ubuntu1.10
80/tcp   open  http     Apache httpd 2.2.22
443/tcp  open  ssl/http Apache httpd 2.2.22

Interpretation: port 22 could give us a way in if we get credentials or a key. Port 80 serves plain content; 443 serves it over HTTPS, and is especially interesting because many OpenSSL vulnerabilities affect TLS services. On top of that, both OpenSSH and Apache are fairly old versions — already suggesting the box may be vulnerable to known techniques.

🔒 Clearance required

This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.

See Root Access plans

No account? Create one free then upgrade from your console.