> 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/5671-5672-pentesting-amqp.md).

# 5671,5672 - Pentesting AMQP

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

## 基本信息

来自 [cloudamqp](https://www.cloudamqp.com/blog/2015-05-18-part1-rabbitmq-for-beginners-what-is-rabbitmq.html)：

> **RabbitMQ** 是一种被称为 *消息代理* 或 *队列管理器* 的 **消息队列软件**。简单来说；它是一个定义了队列的软件，应用程序连接到这些队列以传输消息。\
> 一个 **消息可以包含任何类型的信息**。例如，它可以包含关于应该在另一个应用程序上启动的进程或任务的信息（甚至可以在另一台服务器上），或者它可以只是一个简单的文本消息。队列管理器软件存储消息，直到接收应用程序连接并从队列中取出消息。然后接收应用程序处理消息。\
> 定义来自。

**默认端口**：5672,5671

```
PORT     STATE SERVICE VERSION
5672/tcp open  amqp    RabbitMQ 3.1.5 (0-9)
```

## 枚举

### 手动

```python
import amqp
#By default it uses default credentials "guest":"guest"
conn = amqp.connection.Connection(host="<IP>", port=5672, virtual_host="/")
conn.connect()
for k, v in conn.server_properties.items():
print(k, v)
```

### 自动

```bash
nmap -sV -Pn -n -T4 -p 5672 --script amqp-info <IP>

PORT     STATE SERVICE VERSION
5672/tcp open  amqp    RabbitMQ 3.1.5 (0-9)
| amqp-info:
|   capabilities:
|     publisher_confirms: YES
|     exchange_exchange_bindings: YES
|     basic.nack: YES
|     consumer_cancel_notify: YES
|   copyright: Copyright (C) 2007-2013 GoPivotal, Inc.
|   information: Licensed under the MPL.  See http://www.rabbitmq.com/
|   platform: Erlang/OTP
|   product: RabbitMQ
|   version: 3.1.5
|   mechanisms: PLAIN AMQPLAIN
|_  locales: en_US
```

### 暴力破解

* [**AMQP协议暴力破解**](/generic-methodologies-and-resources/brute-force.md#amqp-activemq-rabbitmq-qpid-joram-and-solace)
* [**STOMP协议暴力破解**](/generic-methodologies-and-resources/brute-force.md#stomp-activemq-rabbitmq-hornetq-and-openmq)

## 其他RabbitMQ端口

在<https://www.rabbitmq.com/networking.html>中，您可以发现**rabbitmq使用多个端口**：

* **1883, 8883**：([MQTT客户端](http://mqtt.org)未加密和加密，如果启用了[MQTT插件](https://www.rabbitmq.com/mqtt.html))。[**了解更多关于如何对MQTT进行渗透测试的信息**](/network-services-pentesting/1883-pentesting-mqtt-mosquitto.md)。
* **4369：epmd**，RabbitMQ节点和CLI工具使用的对等发现服务。[**了解更多关于如何对此服务进行渗透测试的信息**](/network-services-pentesting/4369-pentesting-erlang-port-mapper-daemon-epmd.md)。
* **5672, 5671**：用于AMQP 0-9-1和1.0客户端的未加密和加密连接
* **15672**：[HTTP API](https://www.rabbitmq.com/management.html)客户端，[管理界面](https://www.rabbitmq.com/management.html)和[rabbitmqadmin](https://www.rabbitmq.com/management-cli.html)（仅在启用[管理插件](https://www.rabbitmq.com/management.html)时）。[**了解更多关于如何对此服务进行渗透测试的信息**](/network-services-pentesting/15672-pentesting-rabbitmq-management.md)。
* 15674：STOMP-over-WebSockets客户端（仅在启用[Web STOMP插件](https://www.rabbitmq.com/web-stomp.html)时）
* 15675：MQTT-over-WebSockets客户端（仅在启用[Web MQTT插件](https://www.rabbitmq.com/web-mqtt.html)时）
* 15692：Prometheus指标（仅在启用[Prometheus插件](https://www.rabbitmq.com/prometheus.html)时）
* 25672：用于节点间和CLI工具通信（Erlang分发服务器端口），从动态范围分配（默认情况下限制为单个端口，计算为AMQP端口+20000）。除非这些端口上的外部连接确实非常必要（例如，集群使用[federation](https://www.rabbitmq.com/federation.html)或在子网外部的机器上使用CLI工具），否则不应公开这些端口。有**只有9个这些端口在互联网上打开**。
* 35672-35682：用于CLI工具（Erlang分发客户端端口）与节点通信，从动态范围分配（计算为服务器分发端口+10000到服务器分发端口+10010）。有关详细信息，请参阅[网络指南](https://www.rabbitmq.com/networking.html)。
* 61613, 61614：[STOMP客户端](https://stomp.github.io/stomp-specification-1.2.html)未加密和加密连接（仅在启用[STOMP插件](https://www.rabbitmq.com/stomp.html)时）。少于10台设备开放此端口，主要用于DHT节点的UDP。

## Shodan

* `AMQP`

<details>

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

支持HackTricks的其他方式：

* 如果您想在HackTricks中看到您的**公司广告**或**下载PDF版本的HackTricks**，请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
* 探索[**PEASS Family**](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>
