# 5671,5672 - Pentesting AMQP {% hint style="success" %} Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
Support HackTricks * Check the [**subscription plans**](https://github.com/sponsors/carlospolop)! * **Join the** πŸ’¬ [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.** * **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
{% endhint %} ## Basic Information From [cloudamqp](https://www.cloudamqp.com/blog/2015-05-18-part1-rabbitmq-for-beginners-what-is-rabbitmq.html): > **RabbitMQ**λŠ” _λ©”μ‹œμ§€ 브둜컀_ λ˜λŠ” _큐 κ΄€λ¦¬μž_둜 μ•Œλ €μ§„ **λ©”μ‹œμ§€ νμž‰ μ†Œν”„νŠΈμ›¨μ–΄**μž…λ‹ˆλ‹€. κ°„λ‹¨νžˆ 말해, λ©”μ‹œμ§€λ₯Ό μ „μ†‘ν•˜κΈ° μœ„ν•΄ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ΄ μ—°κ²°λ˜λŠ” 큐가 μ •μ˜λœ μ†Œν”„νŠΈμ›¨μ–΄μž…λ‹ˆλ‹€.\ > **λ©”μ‹œμ§€λŠ” μ–΄λ–€ μ’…λ₯˜μ˜ 정보도 포함할 수 μžˆμŠ΅λ‹ˆλ‹€**. 예λ₯Ό λ“€μ–΄, λ‹€λ₯Έ μ• ν”Œλ¦¬μΌ€μ΄μ…˜(λ‹€λ₯Έ μ„œλ²„μ— μžˆμ„ μˆ˜λ„ 있음)μ—μ„œ μ‹œμž‘ν•΄μ•Ό ν•˜λŠ” ν”„λ‘œμ„ΈμŠ€λ‚˜ μž‘μ—…μ— λŒ€ν•œ 정보가 포함될 수 있으며, λ‹¨μˆœν•œ ν…μŠ€νŠΈ λ©”μ‹œμ§€μΌ μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€. 큐 κ΄€λ¦¬μž μ†Œν”„νŠΈμ›¨μ–΄λŠ” μˆ˜μ‹  μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ΄ μ—°κ²°λ˜μ–΄ νμ—μ„œ λ©”μ‹œμ§€λ₯Ό κ°€μ Έκ°ˆ λ•ŒκΉŒμ§€ λ©”μ‹œμ§€λ₯Ό μ €μž₯ν•©λ‹ˆλ‹€. μˆ˜μ‹  μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ€ κ·Έ ν›„ λ©”μ‹œμ§€λ₯Ό μ²˜λ¦¬ν•©λ‹ˆλ‹€.\ Definition from . **Default port**: 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="", 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 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 ``` ### Brute Force * [**AMQP Protocol Brute-Force**](../generic-methodologies-and-resources/brute-force.md#amqp-activemq-rabbitmq-qpid-joram-and-solace) * [**STOMP Protocol Brute-Force**](../generic-methodologies-and-resources/brute-force.md#stomp-activemq-rabbitmq-hornetq-and-openmq) ## Other RabbitMQ ports In [https://www.rabbitmq.com/networking.html](https://www.rabbitmq.com/networking.html) you can find that **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**: TLS 없이 및 TLS와 ν•¨κ»˜ AMQP 0-9-1 및 1.0 ν΄λΌμ΄μ–ΈνŠΈμ—μ„œ μ‚¬μš© * **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` {% hint style="success" %} Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
Support HackTricks * Check the [**subscription plans**](https://github.com/sponsors/carlospolop)! * **Join the** πŸ’¬ [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.** * **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
{% endhint %}