mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
74 lines
4.4 KiB
Markdown
74 lines
4.4 KiB
Markdown
# 5671,5672 - Pentesting AMQP
|
||
|
||
{{#include ../banners/hacktricks-training.md}}
|
||
|
||
## 基本信息
|
||
|
||
来自 [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-hacking/brute-force.md#amqp-activemq-rabbitmq-qpid-joram-and-solace)
|
||
- [**STOMP协议暴力破解**](../generic-hacking/brute-force.md#stomp-activemq-rabbitmq-hornetq-and-openmq)
|
||
|
||
## 其他RabbitMQ端口
|
||
|
||
在 [https://www.rabbitmq.com/networking.html](https://www.rabbitmq.com/networking.html) 中可以找到 **rabbitmq使用多个端口**:
|
||
|
||
- **1883, 8883**: ([MQTT客户端](http://mqtt.org) 无TLS和有TLS,如果启用了 [MQTT插件](https://www.rabbitmq.com/mqtt.html)。 [**了解如何对MQTT进行渗透测试**](1883-pentesting-mqtt-mosquitto.md))。
|
||
- **4369: epmd**,RabbitMQ节点和CLI工具使用的对等发现服务。 [**了解如何对该服务进行渗透测试**](4369-pentesting-erlang-port-mapper-daemon-epmd.md)。
|
||
- **5672, 5671**: AMQP 0-9-1和1.0客户端无TLS和有TLS使用
|
||
- **15672**: [HTTP API](https://www.rabbitmq.com/management.html) 客户端,[管理UI](https://www.rabbitmq.com/management.html) 和 [rabbitmqadmin](https://www.rabbitmq.com/management-cli.html)(仅在启用 [管理插件](https://www.rabbitmq.com/management.html) 的情况下)。 [**了解如何对该服务进行渗透测试**](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)。除非这些端口上的外部连接确实必要(例如,集群使用 [联邦](https://www.rabbitmq.com/federation.html) 或CLI工具在子网外的机器上使用),否则这些端口不应公开暴露。有关详细信息,请参见 [网络指南](https://www.rabbitmq.com/networking.html)。 **仅有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) 无TLS和有TLS(仅在启用 [STOMP插件](https://www.rabbitmq.com/stomp.html) 的情况下)。少于10个设备开放此端口,主要用于DHT节点的UDP。
|
||
|
||
## Shodan
|
||
|
||
- `AMQP`
|
||
|
||
{{#include ../banners/hacktricks-training.md}}
|