Overview
Timelapse is an Easy Active Directory box built around a single domain controller (DC01, domain timelapse.htb). The entry point is an anonymously readable SMB share that stores a backup zip containing a PFX certificate bundle. The zip and the PFX inside it are both password protected, but both fall quickly to john against rockyou.txt. Once the certificate and private key are extracted, they authenticate to WinRM over TLS as legacyy, which owns the user flag.
Post-exploitation enumeration of the legacyy PowerShell history file reveals cleartext credentials for a second account, svc_deploy. That account is a member of LAPS_Readers, which grants read access to the ms-Mcs-AdmPwd attribute - the LAPS-managed local administrator password for the domain controller. Reading that attribute yields the administrator password, which is used with impacket-psexec to land a NT AUTHORITY\SYSTEM shell and read the root flag.
The chain is a clean tour of common AD footholds: null-session SMB, offline cracking of PKCS#12 material, certificate-based WinRM, credential reuse from shell history, and abuse of a LAPS reader group.
| |
Reconnaissance
An initial full port scan against the target shows the port profile of a Windows domain controller.
| |
| |
The combination of Kerberos (88), LDAP (389/636/3268/3269), DNS (53) and SMB (445) is the classic domain controller signature. The TLS certificate on 5986 confirms the hostname and FQDN as dc01.timelapse.htb, and LDAP reports the domain as timelapse.htb.
Two ports drive the rest of the box. Port 445 (SMB) is the natural first stop for anonymous share enumeration on any Windows target, and port 5986 is WinRM wrapped in TLS (the SSL counterpart of the more common 5985). WinRM is the intended remote-shell channel here, so anything that produces valid credentials or a valid client certificate becomes a direct path to a shell.
Add the names to /etc/hosts so tooling can resolve the FQDN:
| |
Enumerating SMB with a null session exposes a non-default share named Shares:
| |
| |
The $ shares and NETLOGON/SYSVOL are standard, so Shares is the interesting one. It allows anonymous read:
| |
The share holds two directories, Dev and HelpDesk. Dev contains a single backup archive, and HelpDesk contains a set of LAPS documents and the LAPS installer (LAPS.x64.msi, LAPS_*.docx). The LAPS material is a strong hint that a LAPS-based privilege escalation is in play later.
| |
The archive name winrm_backup.zip maps directly to the open WinRM port, suggesting it carries authentication material for the WinRM service.
Initial Access
The downloaded zip is password protected. zip2john extracts a crackable hash, and john recovers the password from rockyou.txt:
| |
The zip password cracks to supremelegacy, and extracting the archive reveals a single PKCS#12 bundle:
| |
A .pfx file stores a certificate together with its private key. Given the archive name and the open WinRM/TLS port, this is almost certainly a client certificate for certificate-based WinRM authentication as legacyy. The PFX itself is also password protected, which blocks direct extraction with openssl:
| |
pfx2john converts the PKCS#12 into a John-compatible hash, which cracks against rockyou.txt:
| |
| |
The PFX password is thuglegacy. With it, openssl splits the bundle into a private key and a certificate:
| |
The extracted certificate confirms the subject is CN=Legacyy, matching the intended account.
evil-winrm supports certificate authentication with -c (public certificate) and -k (private key). Because the service runs over TLS on 5986, -S is required. A first attempt without -u fails, since evil-winrm still expects a username option to be present in the invocation; supplying both certificate flags plus SSL succeeds:
| |
| |
The shell lands as legacyy, and the user flag is on the desktop:
| |
| |
Lateral Movement
With a shell as legacyy, a reliable place to check on Windows is the PowerShell console history file, which frequently contains commands typed with inline credentials.
| |
| |
The history leaks a full credential for a second account: svc_deploy with the password E3R$Q62^12p7PLlC%KWaxuaV. This is a straightforward credential-reuse pivot - the operator who used legacyy had also authenticated as svc_deploy and left the password in cleartext.
Reconnecting with the recovered password gives a shell as the new account:
| |
Checking group membership on the new account immediately points at the escalation path:
| |
| |
svc_deploy belongs to LAPS_Readers. The LAPS documents seen earlier on the HelpDesk share and this group name together confirm the intended route: this account can read LAPS-managed local administrator passwords.
Privilege Escalation
Local Administrator Password Solution (LAPS) stores each managed machine’s local administrator password in the computer object’s ms-Mcs-AdmPwd attribute in Active Directory, and controls who can read it through delegated permissions. Members of LAPS_Readers have been granted read access to that attribute for the domain controller object, so reading it directly yields the current local administrator password.
The attribute is retrieved over LDAP with bloodyAD, filtering for computer objects that have a LAPS expiration time set and requesting the password attribute:
| |
| |
The LAPS-managed local administrator password for DC01 is 8!7}6{c+KP#Wn.uyFSq1L.0$. Because this is a full local administrator credential on the DC, it can be used with SMB-based execution rather than only WinRM. impacket-psexec authenticates as the administrator against the FQDN and returns a SYSTEM shell:
| |
| |
Note that connecting by IP or by the mistyped hostname dc01.timelaspe.htb fails name resolution; the connection must target the correct FQDN dc01.timelapse.htb (present in /etc/hosts).
The root flag is not in the administrator profile. Enumerating C:\Users shows an additional account, TRX, and the flag lives on that user’s desktop - reachable because the shell runs as SYSTEM:
| |
| |
The TRX account exists to support HackTheBox flag rotation: LAPS periodically rotates the administrator password, so the platform needs a separate account with a static administrative credential to reset flag contents. That is why the flag ends up under TRX rather than Administrator.
Detection and Mitigation
| Stage | Root cause | Mitigation |
|---|---|---|
SMB null session on Shares | Anonymous read enabled on a non-default share containing sensitive material | Remove anonymous/guest access; never store secrets (keys, backups) on readable shares |
| Zip and PFX offline cracking | Weak, wordlist-guessable passwords protecting the archive and PKCS#12 bundle | Use long random passphrases for key material; treat exported certificates as secrets and rotate them |
| Certificate-based WinRM as legacyy | Exported client certificate with private key left in an accessible location | Restrict certificate export, store private keys in protected stores, and scope WinRM access |
| Cleartext creds in PowerShell history | Credential passed inline on the command line, persisted to ConsoleHost_history.txt | Avoid inline credentials; clear or disable PSReadLine history for privileged sessions; prefer secret stores |
| LAPS password read via LAPS_Readers | Broad delegation of ms-Mcs-AdmPwd read rights to a service account | Minimize LAPS reader membership; monitor reads of ms-Mcs-AdmPwd; tier administrative access |
| psexec as local administrator | Reusable local admin password on the DC obtained from LAPS | Keep LAPS rotation short; alert on service creation via ADMIN$ (psexec pattern) |
Detection signals:
- SMB access events for anonymous/null sessions reading the
Sharesshare, especially retrieval ofwinrm_backup.zip. - WinRM (5986) authentication using a client certificate for
legacyy, particularly from an external source address. - LDAP queries reading
ms-Mcs-AdmPwdbysvc_deployor other non-tier-0 principals (Directory Service Access / event 4662 on the computer object). - Service creation and execution on the DC over ADMIN$ (events 7045 / 4697, plus 5145 for the ADMIN$ file write) matching the psexec pattern with a randomly named binary and service.
- Interactive/network logon as the local administrator account originating from an unexpected host.
Lessons Learned
- Anonymous SMB shares should never hold key material; a single readable backup archive collapsed the entire foothold.
- PKCS#12 exports are only as strong as their passphrase - both the zip and the PFX were wordlist-crackable, and
pfx2johnturns that into an offline problem. - PowerShell history is a routine credential source on Windows; inline credentials in scripts or one-liners persist to disk and enable trivial lateral movement.
- LAPS protects local admin passwords, but its value depends entirely on who can read
ms-Mcs-AdmPwd; over-broad reader groups turn a defensive control into an escalation primitive. - A LAPS-obtained local admin password is reusable across protocols - SMB execution via psexec was viable without touching WinRM.
- Flag rotation accounts (like
TRX) explain why an artifact may live outside the obvious administrator profile once SYSTEM is reached.
Command Reference
| |
Based on public write-ups of the Hack The Box machine Timelapse for background on the LAPS mechanism and the flag-rotation account.