Haze
Recon
HTTP (8000)
80/443 is closed, but 8000 stands out with Splunk header.

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

Check for vulnerabilities for this version https://advisory.splunk.com/?301=/en_us/product-security.html
CVE-2024-36991 stands out because we are attacking Windows machine and severity is also High, other payloads may require authentication.

POC: CVE-2024-36991. 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/Listofconfigurationfileshttps://docs.splunk.com/Documentation/Splunk/latest/Admin/Wheretofindtheconfigurationfiles
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/331207)
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
faketimeto avoid any data loss.
From bloodhound it seems mark has more permissions then paul.


GMSA (mark.adams)
GMSA fails, so something must be preventing reading the value
Add-ADPermission fails because the command doesn't seem to exist
Get existing commands for ADServiceAccount 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

OPSEC:
The computer
HAZE-IT-BACKUP$@HAZE.HTBhas the ability to modify the owner of the group SUPPORTSERVICES@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-ownership
https://www.thehacker.recipes/ad/movement/dacl/grant-rights
Note: Not positive why, but
genericAlldidn't work formark.adams
Shadow Credentials
Update bloodhound data

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', butcertipy-adis 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

Secure Splunk Enterprise service accounts: On Windows, the Local System user is often the best choice to run Splunk Enterprise.

Apps > Manage Apps

Install app from file

Upload malicious app

Change Sharing to All Apps (system)

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#seimpersonateprivilege
nt authority\system Shell
nt authority\system ShellLast updated