> 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/vnc-5800-5801-5900-5901.md).

# VNC - 5800,5801,5900,5901

### 针对 5800、5801、5900 和 5901 的 VNC 利用

识别监听端口：

```bash
netstat -an | grep LISTEN
```

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

#### **用于重定向 VNC 端口的 SSH 隧道**

```bash
ssh -L 5801:127.0.0.1:5801 -L 5901:127.0.0.1:5901 charix@10.10.10.84
```

<figure><img src="/files/780e5796f3d558d26ffafe153f72b7173ad7ce2b" alt=""><figcaption></figcaption></figure>

扫描 VNC 服务：

```bash
nmap -sV --script vnc-info,realvnc-auth-bypass,vnc-title -p 5801 127.0.0.1
nmap -sV --script vnc-info,realvnc-auth-bypass,vnc-title -p 5901 127.0.0.1
```

<figure><img src="/files/15786c1d890068879b9e25f85ec1fb0282873cd0" alt=""><figcaption></figcaption></figure>

#### **通过 vncviewer 连接**

使用在……中找到的密码 `secret.zip`:

```bash
vncviewer -passwd secret 127.0.0.1:5901
```

VNC 会话提供 **root 访问权限** 在该机器上。

<figure><img src="/files/cc5333ae04e09ae55c7ebddbffc6c6d07adf8df8" 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 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/ports-and-services/vnc-5800-5801-5900-5901.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.
