University

Recon

nmap_scan.log|h-50%_styled

DNS

HTTP (80)

Writeup.png

XSS (?)

We are able to submit Contact form and team will probably review it. Potential XSS?

Writeup-1.png

Student

We are able to register as a Student or Professor. First I tried registering as Student.

Creds: test02:test02@university.htb:Password123$

We have option to sign in with normal credentials or certificate.

Writeup-2.png

With normal (successful) login we end up on profile page:

Writeup-3.png

We are able to request a signed certificate:

Writeup-4.png

I wasn't able to generate valid certificate, so I just skipped to Professor role:

Writeup-5.png

Creds: ptest02:ptest02@university.htb:Password123$

We are not able to authenticate as Professor, but we are able to use certificate to login.

Certificates

Let's try forging certificate from Student account.

Generate valid certificate:

Get signed certificate:

On Courses we can see other user profiles, fuzz:

george@university.htb is most likely the only real user from this machine.

Playing with certificates yielded no success..

Fuzzing

The application is built very incrementally, like users are queries from URL which is potential IDOR vulnerability, but it easily becomes a pattern.

Writeup-6.png

/static/assets/uploads/csrs/ is "Forbidden", not "Not Found" meaning it exists.

Certificates are not working, 9th certificate turned out to be professor account which isn't activated, 7th is student account and 5th is professor which we can't auth as.

csrs was a lucky predicted guess, it exists in this wordlists:

Fuzz some more:

Do the same with csrs:

No luck, even with different extensions.

PDF

At this point nothing related to certificates is working...

https://media1.tenor.com/m/RytdQ4rnlkUAAAAC/spongebob-squarepants-spongebob.gif

Going back to /accounts/profile/ we are able to edit our profile. PHP revshell is not possible, because server is Python.

I tried enumerating other directories and got a hit:

http://university.htb/accounts/profile/pdf/ gives a PDF of our profile:

Writeup-7.png

Producer is xhtml2pdf. It's most probably vulnerable to CVE-2024-25885arrow-up-right: An issue in the getcolor function in utils.py of xhtml2pdf v0.2.13 allows attackers to cause a Regular expression Denial of Service (ReDOS) via supplying a crafted string.

PoC: salvatore-abelloarrow-up-right/CVE-2024-25885.mdarrow-up-right

Hmm.... the exploit DoS attack which is useless right now. Previously (on SolarLab) we encountered CVE-2023-33733arrow-up-right exploit which has very similar payload and is also using same module.

Something happened, but no callback

Writeup-8.png

Testing something simple like certutil should be enough for PoC:

Writeup-9.png

PoC worked, but we are not able to catch shell.

Create reverse shell:

New payload:

wao (Reverse Shell)

There's database file in app directory, download it:

Current user (wao) doesn't exist in this database, probably not interesting (also it's PBKDF2).

There's backup cronjob which has a password:

wao (WinRM) (DC)

Creds: wao:WebAO1337

Enumerate with WinPeas:

Nothing too flashy...

Writeup-10.png

Looks like we need to setup tunneling to access internal network hosts.

Get the IP addresses via arp

or because hostnames are known:

wao (WinRM) (WS-3)

wao (WinRM) (DC) (Probably unintended)

RunasCs gives us elevated privileges. I thought we would get elevated user, always check privs I guess!

Note: Above was ran in DC machine

Potato family can help with elevating the user, somewhat same steps like on Ghost machine.

Instead of reverse shell I decided to just add new user with admin privs.

letmein.cs

Flags

Secretsdump

SSH

There's also some other machine, let's inspect it.

Hashes are most probably not crackable....

Some credentials were left in settings.py:

Writeup-11.png

Creds: WAO:W3lc0meT0TheH3ll!

Password doesn't work for any linux user, nor for DC via netexec smb enum.

Last updated