Hospital

Recon

nmap_scan.log

HTTP (8080)

Writeup-1.png

Creds: letmein:letmein

When logged in we get an upload form:

Writeup-2.png

We can fuzz the extension to see which one is valid or not.

Wordlist = /usr/share/seclists/Discovery/Web-Content/web-extensions.txt

To add string matching go to Settings, Grep Match, add string and include headers.

Writeup-3.png

Not sure why, but shell.phar wasn't getting uploaded. Changing the name helped.

Webshell: http://hospital.htb:8080/uploads/letmein.phararrow-up-right

Writeup-4.png

Bruteforce admin password

Creds don't work anywhere we know...

This is a Windows machine, but clearly we are inside Linux container. Linpeas didn't give anything useful, box is somewhat old so we can assume there's kernel exploit of some sort.

CVE-2023-35001arrow-up-right: Exploit used at pwn2own Vancouver 2023 on Ubuntu desktop. The exploit supports the kernel version available at the beginning of the event (5.19.0-35).

For whatever reason there's golang install on machine and we can leverage that to use exploit.

Note: CVE-2023-2640-CVE-2023-32629arrow-up-right GameOver(lay) exploit should also be valid for this kernel.

The only valid hash should be drwilliams

HTTPs (443)

There's HTTPs server which is serving RoundCube webmail.

Writeup.png

Creds: drwilliams:qwe123!@#

Using SSH credentials we can log into webmail. New user drbrown.

Writeup-5.png

About shows version Roundcube Webmail 1.6.4: CVE-2023-43770-POCarrow-up-right XSS vulnerability. Can't do much with XSS, so probably not useful...

CVE-2023-36664

drbrown is waiting for GhostScript, CVE-2023-36664-Ghostscript-command-injectionarrow-up-right could be valid exploit considering the dates.

Sending the email directly to drbrown doesn't get triggered, but replying to his message gives back connection.

Writeup-6.png

WinRM

Creds: drbrown:chr!$br0wn

User.txt

Privilege Escalation

Nothing useful from bloodhound

Enumerate with winpeas

Path 1

We basically have write permissions on XAMPP, usually due to misconfiguration it's not protected and it's also running as NT SYSTEM...

Writeup-7.png

Path 2 (Failed)

Because of UAC policy RunasCs should have worked, but it failed... Interesting.

Path 3

If we RDP we can observe the automated script logging into the webmail, probably to emulate the user.

Creds: Administrator:Th3B3stH0sp1t4l9786!

Writeup-8.png

Path 4

https://www.offsec.com/metasploit-unleashed/keylogging/arrow-up-right

When you want to listen for keystrokes either you attach yourself to process or explorer, generally explorer would be better idea.

Root.txt

Last updated