TryHackMe / Hard
Internal
Tested by:
Testing performed by Nikolay Kravtsov, a novice information security specialist at 19:46 *(I liked the room, but it seemed clearly not for hard)*
Testing scope and services used.
| IP/domain | Port | Service | Target Server Service |
|---|---|---|---|
| localhost | 5901 | WinKexServer | - |
| localhost | - | Nmap Port Scanner | - |
| localhost | - | Gobuster Directory Scanner | - |
| localhost | - | Obsidian Notes | - |
| localhost | 1234 | Reverse Shell listener | - |
| 10.10.47.117 | 8080 | Apache2 Web Server | + |
| 10.10.47.117 | 8000 | Jenkins Internal Web Server | + |
Files used:
- user.txt - flag.
- root.txt - flag.
- linpeas - a Linux privilege escalation script.
- php reverse shell - reverse shell from pentest monkey.
- CVE-2024-23897.py - LFI for Jenkins.
Procedure
1) Launch openvpn for access; kex to make Linux more convenient
kex --win && sudo openvpn Kolya080808.ovpn2) Scanning ports using nmap.
Results:
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 6e:fa:ef:be:f6:5f:98:b9:59:7b:f7:8e:b9:c5:62:1e (RSA)
| 256 ed:64:ed:33:e5:c9:30:58:ba:23:04:0d:14:eb:30:e9 (ECDSA)
|_ 256 b0:7f:7f:7b:52:62:62:2a:60:d4:3d:36:fa:89:ee:ff (ED25519)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-title: Apache2 Ubuntu Default Page: It works
|_http-server-header: Apache/2.4.29 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
3) Launch Gobuster to search for directories.
- Results:
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://internal.thm/
[+] Method: GET
[+] Threads: 10
[+] Wordlist: directory-list-2.3-medium.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/blog (Status: 301) [Size: 311] [--> http://internal.thm/blog/]
/wordpress (Status: 301) [Size: 316] [--> http://internal.thm/wordpress/]
/javascript (Status: 301) [Size: 317] [--> http://internal.thm/javascript/]
/phpmyadmin (Status: 301) [Size: 317] [--> http://internal.thm/phpmyadmin/]
Progress: 57547 / 220561 (26.09%)^C
[!] Keyboard interrupt detected, terminating.
Progress: 57603 / 220561 (26.12%)
===============================================================
Finished
===============================================================
4) And so, gobuster found two interesting directories. With /wordpress I used wpscan, and this is what he gave me:
Result:
(using it we will receive reverse shell)
(using this data we will log into the admin panel)5) Go in and get reverse shell:
Result:

6) Next I used linpeas, searched the directories for a long time, and eventually found something interesting in /opt:
Result:

7) We access the required data via ssh, read the flag and see another interesting file:
Result:

8) He tells us about some site on the network. So we set up a tunnel and look at it:
Result:

9) Well, I googled what can be done and found CVE-2024-23897, but it didn't help me. Therefore, it was necessary to just stupidly brute force the password. Since it took me almost an hour and the main password was not found, I looked it up in Writeup (sorry). Let's go:
[!Tip] If you are interested, then this command would be most correct:
hydra -l admin -P /usr/share/seclists/Passwords/xato-1mil-10000.txt -f -e ntp -v -s 8000 -t 4 -w 16 -b /path/to/payload.ffuf
Or something similar :)
Result:

10) Then we get a reverse shell with Java (sorry, my Java skills leave much to be desired):
Result:
First, start a netcat listener (on port 1234 in my case).11) When receiving a reverse shell, we look at the /opt directory by analogy and lo and behold:
Result:

12) Go to the window with the ssh user aubreanna and change it to root. Then we read the flag:
Result:

Note:
It's a cool room, but I wouldn't rate it as a hard room.
Thanks TryHackMe for the room!
Vulnerabilities found
Brute Force
PoC:
(point 4)
and (clause 9)
CVSSv3 Score: 8.8 (HIGH)
Description:
In this case, the attack involves simple passwords.
Reproducing the vulnerability:
wpscan --url http://internal.thm/wordpress -U admin -P rockyou.txt
Remediation recommendations:
Update your passwords to more complex ones.
Video walkthrough
Original:
- YouTube