> For the complete documentation index, see [llms.txt](https://hacktricks.xsx.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacktricks.xsx.tw/network-services-pentesting/pentesting-vnc.md).

# 5800,5801,5900,5901 - Pentesting VNC

<details>

<summary><strong>从零开始学习 AWS 黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS 红队专家）</strong></a><strong>！</strong></summary>

支持 HackTricks 的其他方式：

* 如果您想看到您的**公司在 HackTricks 中做广告**或**下载 PDF 版本的 HackTricks**，请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方 PEASS & HackTricks 商品**](https://peass.creator-spring.com)
* 探索[**PEASS 家族**](https://opensea.io/collection/the-peass-family)，我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)
* **加入** 💬 [**Discord 群组**](https://discord.gg/hRep4RUj7f) 或 [**电报群组**](https://t.me/peass) 或 **关注**我们的 **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* 通过向 [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github 仓库提交 PR 来分享您的黑客技巧。

</details>

## 基本信息

\*\*虚拟网络计算（VNC）**是一种强大的图形化桌面共享系统，利用**远程帧缓冲（RFB）\*\*协议实现远程控制和与另一台计算机的协作。使用 VNC，用户可以通过双向传输键盘和鼠标事件与远程计算机无缝交互。这使得实时访问成为可能，并促进了通过网络进行高效远程协助或协作。

VNC 通常使用端口**5800 或 5801 或 5900 或 5901**。

```
PORT    STATE SERVICE
5900/tcp open  vnc
```

## 枚举

```bash
nmap -sV --script vnc-info,realvnc-auth-bypass,vnc-title -p <PORT> <IP>
msf> use auxiliary/scanner/vnc/vnc_none_auth
```

### [**暴力破解**](/generic-methodologies-and-resources/brute-force.md#vnc)

## 使用Kali连接到VNC

```bash
vncviewer [-passwd passwd.txt] <IP>::5901
```

## 解密 VNC 密码

默认**密码存储在**：\~/.vnc/passwd

如果你有 VNC 密码，且看起来是加密的（几个字节，就像是一个加密的密码），那么它可能是用 3des 加密的。你可以使用 <https://github.com/jeroennijhof/vncpwd> 获取明文密码。

```bash
make
vncpwd <vnc password file>
```

你可以这样做，因为多年前已经逆向破解了用于加密明文 VNC 密码的 3DES 内部密码。\
对于 **Windows**，你还可以使用这个工具：<https://www.raymond.cc/blog/download/did/232/>\
我也将工具保存在这里以便更方便访问：

{% file src="/files/7HDnASHPBZEmFtIl2rjn" %}

## Shodan

* `port:5900 RFB`

<details>

<summary><strong>从零开始学习 AWS 黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS 红队专家）</strong></a><strong>！</strong></summary>

支持 HackTricks 的其他方式：

* 如果你想看到你的 **公司在 HackTricks 中被广告** 或 **下载 HackTricks 的 PDF**，请查看 [**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取 [**官方 PEASS & HackTricks 商品**](https://peass.creator-spring.com)
* 探索 [**PEASS 家族**](https://opensea.io/collection/the-peass-family)，我们独家的 [**NFTs**](https://opensea.io/collection/the-peass-family) 集合
* **加入** 💬 [**Discord 群组**](https://discord.gg/hRep4RUj7f) 或 [**电报群组**](https://t.me/peass) 或 **关注** 我们的 **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* 通过向 [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github 仓库提交 PR 来分享你的黑客技巧。

</details>


---

# 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:

```
GET https://hacktricks.xsx.tw/network-services-pentesting/pentesting-vnc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
