# Az - Service Bus Enum {% 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 %} ## Service Bus Azure Service Bus is a cloud-based **messaging service** designed to enable reliable **communication between different parts of an application or separate applications**. It acts as a secure middleman, ensuring messages are safely delivered, even if the sender and receiver aren’t operating simultaneously. By decoupling systems, it allows applications to work independently while still exchanging data or instructions. It’s particularly useful for scenarios requiring load balancing across multiple workers, reliable message delivery, or complex coordination, such as processing tasks in order or securely managing access. ### Key Concepts 1. **Queues:** its purpose is to store messages until the receiver is ready. - Messages are ordered, timestamped, and durably stored. - Delivered in pull mode (on-demand retrieval). - Supports point-to-point communication. 2. **Topics:** Publish-subscribe messaging for broadcasting. - Multiple independent subscriptions receive copies of messages. - Subscriptions can have rules/filters to control delivery or add metadata. - Supports many-to-many communication. 3. **Namespaces:** A container for all messaging components, queues and topics, is like your own slice of a powerful Azure cluster, providing dedicated capacity and optionally spanning across three availability zones. ### Advance Features Some advance features are: - **Message Sessions**: Ensures FIFO processing and supports request-response patterns. - **Auto-Forwarding**: Transfers messages between queues or topics in the same namespace. - **Dead-Lettering**: Captures undeliverable messages for review. - **Scheduled Delivery**: Delays message processing for future tasks. - **Message Deferral**: Postpones message retrieval until ready. - **Transactions**: Groups operations into atomic execution. - **Filters & Actions**: Applies rules to filter or annotate messages. - **Auto-Delete on Idle**: Deletes queues after inactivity (min: 5 minutes). - **Duplicate Detection**: Removes duplicate messages during resends. - **Batch Deletion**: Bulk deletes expired or unnecessary messages. ### Authorization-Rule / SAS Policy SAS Policies define the access permissions for Azure Service Bus entities namespace (Most Important One), queues and topics. Each policy has the following components: - **Permissions**: Checkboxes to specify access levels: - Manage: Grants full control over the entity, including configuration and permissions management. - Send: Allows sending messages to the entity. - Listen: Allows receiving messages from the entity. - **Primary and Secondary Keys**: These are cryptographic keys used to generate secure tokens for authenticating access. - **Primary and Secondary Connection Strings**: Pre-configured connection strings that include the endpoint and key for easy use in applications. - **SAS Policy ARM ID**: The Azure Resource Manager (ARM) path to the policy for programmatic identification. ### NameSpace sku, authrorization rule, ### Enumeration {% code overflow="wrap" %} ```bash # Queue Enumeration az servicebus queue list --resource-group --namespace-name az servicebus queue show --resource-group --namespace-name --name # Topic Enumeration az servicebus topic list --resource-group --namespace-name az servicebus topic show --resource-group --namespace-name --name # Susbscription Enumeration az servicebus topic subscription list --resource-group --namespace-name --topic-name az servicebus topic subscription show --resource-group --namespace-name --topic-name --name # Namespace Enumeration az servicebus namespace list az servicebus namespace network-rule-set list --resource-group --namespace-name az servicebus namespace show --resource-group --name az servicebus namespace network-rule-set show --resource-group --namespace-name az servicebus namespace private-endpoint-connection list --resource-group --namespace-name az servicebus namespace exists --name ProposedNamespace # Authorization Rule Enumeration az servicebus namespace authorization-rule list --resource-group --namespace-name az servicebus queue authorization-rule list --resource-group --namespace-name --queue-name az servicebus topic authorization-rule list --resource-group --namespace-name --topic-name az servicebus namespace authorization-rule keys list --resource-group --namespace-name --name ``` {% endcode %} ### Privilege Escalation {% content-ref url="../az-services/az-servicebus-privesc.md" %} [az-servicebus-privesc.md](../az-services/az-servicebus-privesc.md) {% endcontent-ref %} ### Post Exploitation {% content-ref url="../az-post-exploitation/az-servicebus-post-exploitation.md" %} [az-servicebus-post-exploitation.md](../az-post-exploitation/az-servicebus-post-exploitation.md) {% endcontent-ref %} ## References * https://learn.microsoft.com/en-us/powershell/module/az.servicebus/?view=azps-13.0.0 * https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview * https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quickstart-cli
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 %}