Haze

Recon

nmap_scan.log

HTTP (8000)

80/443 is closed, but 8000 stands out with Splunk header.

Writeup.png

splunkd discloses the version information on port 8089. There's 4 routes, but we don't have access to them without credentials.

Writeup-1.png

Check for vulnerabilities for this version https://advisory.splunk.com/?301=/en_us/product-security.htmlarrow-up-right

CVE-2024-36991arrow-up-right stands out because we are attacking Windows machine and severity is also High, other payloads may require authentication.

Writeup-2.png

POC: CVE-2024-36991arrow-up-right. TLDR: It's fucking os.path.join again, why can't people just use Pathlib

PoC works, but there's /etc/passwd which contains passwords on Windows???

Make script more interactive with file of our choice.

hostname doesn't exist so passwd file is some decoy or smth

Splunk uses Linux like structure for storing the files, configuration and whatnot

https://docs.splunk.com/Documentation/Splunk/latest/Admin/Listofconfigurationfilesarrow-up-righthttps://docs.splunk.com/Documentation/Splunk/latest/Admin/Wheretofindtheconfigurationfilesarrow-up-right

server.conf: Contains a variety of settings for configuring the overall state of a Splunk Enterprise instance

authentication.conf: Toggle between Splunk's built-in authentication or LDAP, and configure LDAP.

SplunkSecrets

To decrypt splunk secrets splunk command is required, but alternative is always there. Secrets file is required (https://community.splunk.com/t5/Knowledge-Management/What-is-the-splunk-secret-file-and-is-it-possible-to-change-it/m-p/331207arrow-up-right)

Generate possible AD usernames and try passwords

SMB (135)

SMB share is empty, but we can get valid users

Check password reuse

Bloodhound

Enumerate with Bloodhound.

Note: There was an error with Kerberos time skew, fix it with faketime to avoid any data loss.

From bloodhound it seems mark has more permissions then paul.

Writeup-3.png
Writeup-4.png

GMSA (mark.adams)

GMSA fails, so something must be preventing reading the value

Add-ADPermissionarrow-up-right fails because the command doesn't seem to exist

Get existing commands for ADServiceAccountarrow-up-right manipulation

Inspect if you can read the value:

Grant read permission and check the value again

Now we are able to read GMSA for Haze-IT-Backup

HAZE-IT-BACKUP

Writeup-5.png

OPSEC:

  • The computer HAZE-IT-BACKUP$@HAZE.HTB has the ability to modify the owner of the group SUPPORT SERVICES@HAZE.HTB.

  • Object owners retain the ability to modify object security descriptors, regardless of permissions on the object's DACL.

https://www.thehacker.recipes/ad/movement/dacl/grant-ownershiparrow-up-right

https://www.thehacker.recipes/ad/movement/dacl/grant-rightsarrow-up-right

Note: Not positive why, but genericAll didn't work for mark.adams

Shadow Credentials

Update bloodhound data

Writeup-6.png

Can also be done with bloodyAD -> faketime -f +8h bloodyAD --host "dc01.haze.htb" -d "haze.htb" -u "Haze-IT-Backup$" -p ":735c02c6b2dc54c3c8c6891f55279ebc" add shadowCredentials 'edward.martin', but certipy-ad is simpler.

You might want to execute commands quickly, because of HTB's 10 second cleanup rules..

WinRM (edward.martin)

User.txt

Privilege Escalation (alexander.green)

User is part of HAZE\Backup_Reviewers group and there's a Backups directory on root.

Credentials don't work

Reverse Shell

We are not able to login into the machine, but we can login into Splunk as Administrator with admin:Sp1unkadmin@2k24

Writeup-7.png

Secure Splunk Enterprise service accountsarrow-up-right: On Windows, the Local System user is often the best choice to run Splunk Enterprise.

Writeup-8.png
  1. Apps > Manage Apps

Writeup-9.png
  1. Install app from file

Writeup-10.png
  1. Upload malicious app

Writeup-11.png
  1. Change Sharing to All Apps (system)

Writeup-12.png

After waiting for a minute nothing makes a callback 🤔

I made a mistake of not going inside directory; reverse_shell_splunk module is inside the git repository, git repository is not the module 😓 (Command above updated, so ignore)

SeImpersonatePrivilege

SeImpersonatePrivilege is useful for privilege escalation -> https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/privilege-escalation-abusing-tokens.html#seimpersonateprivilegearrow-up-right

nt authority\system Shell

Last updated