Files
hacktricks-cloud/src/pentesting-cloud/azure-security/az-post-exploitation/az-servicebus-post-exploitation.md

77 lines
8.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Az - Service Bus Post Exploitation
{{#include ../../../banners/hacktricks-training.md}}
## Service Bus
詳細については、次を確認してください:
{{#ref}}
../az-services/az-servicebus.md
{{#endref}}
### Actions: `Microsoft.ServiceBus/namespaces/Delete`
この権限を持つ攻撃者は、Azure Service Busの名前空間全体を削除できます。このアクションは、名前空間とすべての関連リソースキュー、トピック、サブスクリプション、およびそれらのメッセージを削除し、すべての依存システムとワークフローにわたる広範な混乱と永続的なデータ損失を引き起こします。
```bash
az servicebus namespace delete --resource-group <ResourceGroupName> --name <NamespaceName>
```
### Actions: `Microsoft.ServiceBus/namespaces/topics/Delete`
この権限を持つ攻撃者は、Azure Service Bus トピックを削除できます。このアクションはトピックとその関連するすべてのサブスクリプションおよびメッセージを削除し、重要なデータの損失を引き起こし、トピックに依存するシステムやワークフローを混乱させる可能性があります。
```bash
az servicebus topic delete --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --name <TopicName>
```
### Actions: `Microsoft.ServiceBus/namespaces/queues/Delete`
この権限を持つ攻撃者は、Azure Service Bus キューを削除できます。このアクションはキューとその中のすべてのメッセージを削除し、重要なデータの喪失を引き起こし、キューに依存するシステムやワークフローを混乱させる可能性があります。
```bash
az servicebus queue delete --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --name <QueueName>
```
### Actions: `Microsoft.ServiceBus/namespaces/topics/subscriptions/Delete`
この権限を持つ攻撃者は、Azure Service Bus サブスクリプションを削除できます。このアクションはサブスクリプションとその関連メッセージをすべて削除し、サブスクリプションに依存するワークフロー、データ処理、およびシステム操作を潜在的に中断させる可能性があります。
```bash
az servicebus topic subscription delete --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --topic-name <TopicName> --name <SubscriptionName>
```
### Actions: `Microsoft.ServiceBus/namespaces/queues/write` (`Microsoft.ServiceBus/namespaces/queues/read`)
Azure Service Bus キューを作成または変更する権限を持つ攻撃者キューを変更するには、Action:`Microsoft.ServiceBus/namespaces/queues/read` も必要です)は、これを利用してデータを傍受したり、ワークフローを妨害したり、無許可のアクセスを可能にしたりすることができます。彼らは、悪意のあるエンドポイントにメッセージを転送する、メッセージの TTL を調整してデータを不適切に保持または削除する、またはエラーハンドリングに干渉するためにデッドレターを有効にするなど、重要な設定を変更することができます。さらに、サービス機能を妨害したり、検出を回避したりするために、キューのサイズ、ロックの期間、またはステータスを操作することもできます。これは重要なポストエクスプロイテーションリスクです。
```bash
az servicebus queue create --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --name <QueueName>
az servicebus queue update --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --name <QueueName>
```
### Actions: `Microsoft.ServiceBus/namespaces/topics/write` (`Microsoft.ServiceBus/namespaces/topics/read`)
Azure Service Bus 名前空間内でトピックを作成または変更する権限を持つ攻撃者は、これを利用してメッセージワークフローを妨害したり、機密データを露出させたり、無許可のアクションを有効にしたりすることができます。az servicebus topic updateのようなコマンドを使用して、スケーラビリティの悪用のためにパーティショニングを有効にしたり、メッセージを不適切に保持または破棄するためにTTL設定を変更したり、制御を回避するために重複検出を無効にしたりするなど、構成を操作できます。さらに、トピックのサイズ制限を調整したり、ステータスを変更して可用性を妨害したり、インターセプトされたメッセージを一時的に保存するためにエクスプレストピックを構成したりすることができるため、トピック管理はポストエクスプロイテーションの緩和において重要な焦点となります。
```bash
az servicebus topic create --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --name <TopicName>
az servicebus topic update --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --name <TopicName>
```
### Actions: `Microsoft.ServiceBus/namespaces/topics/subscriptions/write` (`Microsoft.ServiceBus/namespaces/topics/subscriptions/read`)
サブスクリプションを作成または変更する権限を持つ攻撃者サブスクリプションを変更するには、Action: `Microsoft.ServiceBus/namespaces/topics/subscriptions/read` も必要ですは、Azure Service Bus トピック内でこれを利用してメッセージワークフローを傍受、再ルーティング、または中断することができます。az servicebus topic subscription updateのようなコマンドを使用して、メッセージを転送するためにデッドレターを有効にしたり、無許可のエンドポイントにメッセージを転送したり、TTLやロック期間を変更してメッセージ配信を保持または干渉したりするなどの設定を操作できます。さらに、ステータスや最大配信回数の設定を変更して操作を中断させたり、検出を回避したりすることができるため、サブスクリプションの制御はポストエクスプロイテーションシナリオの重要な側面となります。
```bash
az servicebus topic subscription create --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --topic-name <TopicName> --name <SubscriptionName>
az servicebus topic subscription update --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --topic-name <TopicName> --name <SubscriptionName>
```
### アクション: `AuthorizationRules` メッセージの送信と受信
ここを見てください:
{{#ref}}
../az-privilege-escalation/az-queue-privesc.md
{{#endref}}
## 参考文献
- [https://learn.microsoft.com/en-us/azure/storage/queues/storage-powershell-how-to-use-queues](https://learn.microsoft.com/en-us/azure/storage/queues/storage-powershell-how-to-use-queues)
- [https://learn.microsoft.com/en-us/rest/api/storageservices/queue-service-rest-api](https://learn.microsoft.com/en-us/rest/api/storageservices/queue-service-rest-api)
- [https://learn.microsoft.com/en-us/azure/storage/queues/queues-auth-abac-attributes](https://learn.microsoft.com/en-us/azure/storage/queues/queues-auth-abac-attributes)
- [https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-python-how-to-use-topics-subscriptions?tabs=passwordless](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-python-how-to-use-topics-subscriptions?tabs=passwordless)
- [https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/integration#microsoftservicebus](https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/integration#microsoftservicebus)
- [https://learn.microsoft.com/en-us/cli/azure/servicebus/namespace?view=azure-cli-latest](https://learn.microsoft.com/en-us/cli/azure/servicebus/namespace?view=azure-cli-latest)
- [https://learn.microsoft.com/en-us/cli/azure/servicebus/queue?view=azure-cli-latest](https://learn.microsoft.com/en-us/cli/azure/servicebus/queue?view=azure-cli-latest)
{{#include ../../../banners/hacktricks-training.md}}