THM Kenobi walkthrough
https://tryhackme.com/room/kenobi
10.10.41.115 # this is exampleNmap
─$ sudo nmap -sV -sC 10.10.126.130
[sudo] password for przemo:
Starting Nmap 7.95 ( https://nmap.org ) at 2025-10-15 23:06 CEST
Nmap scan report for 10.10.126.130
Host is up (0.052s latency).
Not shown: 993 closed tcp ports (reset)
PORT STATE SERVICE VERSION
21/tcp open ftp ProFTPD 1.3.5
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.13 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 9d:36:de:d0:39:fd:b1:fb:b0:44:c4:58:0b:28:c9:a4 (RSA)
| 256 71:8f:d8:9c:bf:ad:4a:0c:af:94:9d:8b:6c:34:1f:0f (ECDSA)
|_ 256 9b:f4:23:c0:5c:2c:1b:9e:4e:5b:48:7c:ef:92:64:68 (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
| http-robots.txt: 1 disallowed entry
|_/admin.html
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Site doesn't have a title (text/html).
111/tcp open rpcbind 2-4 (RPC #100000)
| rpcinfo:
| program version port/proto service
| 100000 2,3,4 111/tcp rpcbind
| 100000 2,3,4 111/udp rpcbind
| 100000 3,4 111/tcp6 rpcbind
| 100000 3,4 111/udp6 rpcbind
| 100003 3 2049/udp nfs
| 100003 3 2049/udp6 nfs
| 100003 3,4 2049/tcp nfs
| 100003 3,4 2049/tcp6 nfs
| 100005 1,2,3 34070/udp mountd
| 100005 1,2,3 47397/udp6 mountd
| 100005 1,2,3 51421/tcp mountd
| 100005 1,2,3 60221/tcp6 mountd
| 100021 1,3,4 33589/udp nlockmgr
| 100021 1,3,4 34483/tcp nlockmgr
| 100021 1,3,4 40803/tcp6 nlockmgr
| 100021 1,3,4 46741/udp6 nlockmgr
| 100227 3 2049/tcp nfs_acl
| 100227 3 2049/tcp6 nfs_acl
| 100227 3 2049/udp nfs_acl
|_ 100227 3 2049/udp6 nfs_acl
139/tcp open netbios-ssn Samba smbd 4
445/tcp open netbios-ssn Samba smbd 4
2049/tcp open nfs 3-4 (RPC #100003)
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
Host script results:
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
| smb2-time:
| date: 2025-10-15T21:06:40
|_ start_date: N/A
|_clock-skew: -1s
|_nbstat: NetBIOS name: KENOBI, NetBIOS user: <unknown>, NetBIOS MAC: <unknown> (unknown)
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 14.70 seconds
SMB enumerating shares
smbclient
enum4linux - detailed enummeration
Metasploit
smbmap
connecting to anonymous share
rpc port 111 showmount
ftp ProFTPD 1.3.5
What is NFS?
What Did You Find?
What the Nmap Script Found
Why Mount /var to the Attacking Machine?
SSH
Permissions
Notation
Meaning
SSH Accepts?
Find SUID binaries (CRITICAL):
Check the binary:
Run the binary:
Use strings to see what it executes:
Create the exploit:
PATH Manipulation
Trigger the Exploit
Get the Root Flag
Why This Works - Technical Explanation
SUID Bit:
Relative Path Vulnerability:
PATH Manipulation:
Exploitation:
Cleanup - if you finished Kenobi room
Step 1: Unmount the NFS Share
Step 2: Remove the Mount Point Directory
Step 3: Remove the SSH Key
Step 4: Remove SSH Known Hosts Entry
Step 5: Verify Cleanup
Complete Cleanup Commands (All Together)
Troubleshooting Unmount Issues
Issue: "Device is busy"
Summary - Cleanup Checklist
Last updated
