Information
Room
- Name: Unstable Twin
- Profile: tryhackme.com
- Difficulty: Medium
- Description: A Services based room, extracting information from HTTP Services and finding the hidden messages.
Write-up
Overview
Install tools used in this WU on BlackArch Linux:
Network enumeration
Port and service scan with nmap:
Add local domain.
Web enumeration
The homepage is blank http://unstabletwin.thm
Let's enumerate to find routes.
There is one endpoint: http://unstabletwin.thm/info
It seems to be authenticated because it returns this message:
"The login API needs to be called with the username and password fields. It has not been fully tested yet so may not be full developed and secure"
Let's see HTTP headers:
The last two headers are custom.
1/2 times we have version 1.3.4-dev
and 1/2 times 1.3.6-final
as build number and Vincent
and Julias
as server name.
The /api/
route doesn't answer anything (with GET method) but maybe there are endpoints under it that does.
Also the endpoint answers to POST.
Let's see if we can do something with this.
SQL injection
The server reacts badly when we inject a quote, there may be a SQLi.
Here is a ruby PoC to extract all credentials.
Note: only 1/2 request is vulnerable depending on what version of the server is answering.
Mary Ann's SSH password is not here.
With this Ruby PoC we can list other tables:
Result:
Let's see the notes
table.
Result:
We have found a long hash, let's identify it with haiti:
It's a SHA-512 hash, it was easily cracked with https://crackstation.net/
SSH access
Now we can access the server via SSH, find the user flag:
Elevation of Privilege (EoP)
There is a hint too!
I first tried curl http://unstabletwin.thm/api/image?name=vincent
but it
was curl 'http://unstabletwin.thm/get_image?name=vincent'
.
Let's download an image then:
Let's write a ruby script to extract all images:
Unrealistic steganography
Extract a hidden file with steghide
for each image, eg.
Then let's read the extracted files:
So let's re-order the colors:
Then it seems decodable as Base62 on CyberChef.