THM: That's The Ticket
THM: That’s The Ticket
This is That’s The Ticket from THM. It’s Medium rated and says:
IT Support is going to have a really bad day today, but don’t think they’re stupid! They have really strict firewalls!
Using the IT support portal try and make your way into the admin account.
Hint: Our HTTP & DNS Logging tool on http://10.10.10.100 may come in useful!
Based on this, I was guessing this might have been XSS. Guess who doesn’t know anything about XSS? This guy. Let’s go.
SSH, and HTTP only.
Our first task is to find the email address of IT Support. We can register an account, and then create support tickets. Now when I said I don’t know shit about XSS, I wasn’t joking. It’s obviously not easy to do in CTF-type challenges when you’re working with Vulnhub boxes or on THM; they are usually single machine and single user type things.
Anyway I had once signed up for a course with the XSS Rat about XSS so I watched the first few videos, learned not quite enough to be dangerous and got started.
Using a polyglot that I borrowed, I could get an XSS payload to trigger on the ticket. Then, I tried getting it to send me the email address with this payload:
This would get an HTTP request to the logging tool on 10.10.10.100, but I’d only get my own email address, like so:
Next, I tried …. well, different things. I eventually landed on a payload like this:
Which would essentially exfil the entire page contents as base64, but it still didn’t contain the admin’s email address.
Eventually I quit and checked a writeup, because I genuinely didn’t know what to to. Specifically I looked here, not that it probably matters much. I got two things from here: one, we needed to escape a ‘textarea’, and two, a useful payload. Now as it happens my polyglot was already escaping the textarea but the payload could be much simpler without all the LeEt stuff. The payload:
So why does this work, whereas mine didn’t? Because the DNS lookup to the monitor is done by the admin account, but the GET request isn’t. We get a result like this:
And it looks like this since old mate replaced @ with ‘X’ and . with Y, so the answer is firstname.lastname@example.org
Now I knew this, I thought the payload could be simplified somewhat. Here’s my (slightly) optimised version:
No doubt there are better ones. This works though:
Once you’ve got that you just have to bruteforce the admin login; the password is trivial and I used Burp Turbo Intruder and then you just read a flag from a ticket. But I still found this really quite interesting and I definitely learned a few things so cheers adamtlangley.