Intuition

Recon

nmap_scan.log|h-50%_styled
└─$ echo '10.10.11.14    comprezzor.htb' | sudo tee -a /etc/hosts
10.10.11.14    comprezzor.htb

HTTP (80)

Pasted_image_20240527212242.png

Dir enumeration returned nothing, since we have a vhost we could also enumerate that:

report.comprezzor.htb:Pasted_image_20240527212305.png

Possible XSS?

To make reports we need account and auth subdomain lets us login/register.

Creds: hacka:hacka

XSS (Session Hijack)

[[xss-reflected-steal-cookie]]

Payload:

Change cookie and visit dashboard subdomain:Pasted_image_20240527212355.png

Now we are user webdev.

Submit a new report as webdev to gain admin access, it was described in About Bug Reports.

That didn't work...

The report gets deleted like after 10 seconds so we have to create a report as a user, make a request as webdev to escalate priority so admin can take a look at it:

Note: report_id your report id

Ok, so

  1. Do XSS as user

  2. Login and escalate report as webdev

  3. Listen for cookies

LFI

Pasted_image_20240527212433.png
Pasted_image_20240527212443.png

Typical file:/// protocol wasn't working and it kept throwing invalid url error, let's see if we can make request to ourselves:

User-Agent is Python-urllib instead of Python-requests so it can be deducted that urllib.parse is used for parsing URLs.

After googling we find: CVE-2023–24329 Bypassing URL Blackslisting using Blank in Python urllib libraryarrow-up-right

DESCRIPTION: Python could allow a remote attacker to bypass security restrictions, caused by a flaw in the urllib.parse component. By sending a specially-crafted request using URL starts with blank characters, an attacker could exploit this vulnerability to bypass blocklisting methods. sourcearrow-up-right

Add a space in front and then file protocol:Pasted_image_20240527212503.png

It was really painful to view files though browser so here's a small script to read pdf files:

PDF output is terrible with spaces, but it's readable so yeah and I normalized it in above block... We have a secret key and imports.

From dashboard we get FTP credentials:

FTP (SSRF)

Hmm.. but the port is not open, SSRF?

Used ChatGPT to fix the spaces D:

Nice, we have private key and it's password, but who does it belong to? [[Labs/HackTheBox/Seasonal/Season 5/Intuition/id_rsa]]

SSH

User.txt

Privileges Escalation (lopez)

Credentials from auth module:

Note: Yes, the password has space

I tried changing to user adam, but it didn't work. I then tried FTP:

runner1.c|h-50%

Right away we see AUTH_KEY_HAS, since we don't know last 4 it can be bruteforced:

Hmm... /opt contains runner2 and it's probably version 2, we have version 1...

Enumerate files readable to us which are owned by users:

Suricata is a network Intrusion Detection System, Intrusion Prevention System and Network Security Monitoring engine developed by the OISF and the Suricata community. suricataarrow-up-right

Let's see what we can dig up in the logs:

Creds: lopez:Lopezz1992%123

Switch user with su - lopez

Privileges Escalation (root)

lopez is part of sys-adm group so we can view /opt/runner2:

Let's download the file and inspect what kind of JSON it expects:

The run command has less control then install. run is checked that file ends with .yml and it must be in /opt/playbooks where we don't have write access.install takes ansible template and does operation on it. Filename is controlled from JSON so injecting commands isn't a problem since ; character is allowed on Linux filesystem.


Writeups used: https://blog.taipanbyte.ru/hackthebox/Intuition-HTB-Writeup

Note: I decided to use Syncthing for syncing my notes on phone, but shit went sideways and everything got deleted from notes. Luckily I recovered files with DMDE software, but wasn't so lucky with images. Hence they are taken from writeup above!

Last updated