TryHackMe / Medium / Linux
Anonymous
Tested by:
Testing performed by Nikolay Kravtsov, a novice information security specialist at 19:31 *(A simple room, even too much.)*.
Files used:
- user.txt - flag
- root.txt - flag
- clean.sh - the file we used to get the reverse shell
- linpeas.sh - a Linux privilege escalation script.
Procedure:
1) Editing /etc/resolv.conf for Internet access, creating a room folder, enabling win kex for convenience, enabling VPN for accessing rooms
1) sudo nano /etc/resolv.conf; clear; mkdir anonymous; cd anonymous; kex --win; clear; openvpn ../Kolya080808.ovpn
2) clear; sudo ./thm-troubleshoot; nmap -sCV 10.10.252.217; gobuster dir -w directory-list-2.3-medium.txt -b 404 -u http://10.10.252.217
2) Scanning ports using nmap.
- Results:
PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 2.0.8 or later
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_drwxrwxrwx 2 111 113 4096 Jun 04 2020 scripts [NSE: writeable]
| ftp-syst:
| STAT:
| FTP server status:
| Connected to ::ffff:10.9.2.149
| Logged in as ftp
| TYPE: ASCII
| No session bandwidth limit
| Session timeout in seconds is 300
| Control connection is plain text
| Data connections will be plain text
| At session startup, client count was 3
| vsFTPd 3.0.3 - secure, fast, stable
|_End of status
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 8b:ca:21:62:1c:2b:23:fa:6b:c6:1f:a8:13:fe:1c:68 (RSA)
| 256 95:89:a4:12:e2:e6:ab:90:5d:45:19:ff:41:5f:74:ce (ECDSA)
|_ 256 e1:2a:96:a4:ea:8f:68:8f:cc:74:b8:f0:28:72:70:cd (ED25519)
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open netbios-ssn Samba smbd 4.7.6-Ubuntu (workgroup: WORKGROUP)
Service Info: Host: ANONYMOUS; OS: Linux; CPE: cpe:/o:linux:linux_kernel
Host script results:
|_nbstat: NetBIOS name: ANONYMOUS, NetBIOS user: <unknown>, NetBIOS MAC: <unknown> (unknown)
| smb2-time:
| date: 2025-01-11T15:51:18
|_ start_date: N/A
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
| smb-os-discovery:
| OS: Windows 6.1 (Samba 4.7.6-Ubuntu)
| Computer name: anonymous
| NetBIOS computer name: ANONYMOUS\x00
| Domain name: \x00
| FQDN: anonymous
|_ System time: 2025-01-11T15:51:18+00:00
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
3) Launch Gobuster to search for directories.
- Results:
Ничего не дало.
4) First I answered 3 questions:
Result:

5) Then I connected via smb to the server and answered the fourth question:
Result:

6) Then, using ftp, I looked at what files we have and what rights we have to them:
Result:

7) Well, I changed clean.sh to my own and got a reverse shell:
Result:

8) Then I stabilized the command line and read the flag:
Result:

9) Then using linpeas.sh I looked at how we can increase privileges, and I increased them:
Result:

10) Well, we read the last flag:
Result:

Note
Note:
The room is cool, but it’s clearly not suitable for medium, it’s really very simple. I would even say it is easier than easy.
But anyway, thanks to TryHackMe for the room!
Video walkthrough
- Original:
- YouTube