mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2025-12-30 22:50:43 -08:00
Translated ['.github/pull_request_template.md', 'src/pentesting-cloud/az
This commit is contained in:
@@ -2,54 +2,45 @@
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
### Illicit Consent Grant
|
||||
### Illegale Zustimmungserteilung
|
||||
|
||||
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.
|
||||
Standardmäßig kann sich jeder Benutzer in Azure AD eine Anwendung registrieren. Sie können also eine Anwendung (nur für den Zielmandanten) registrieren, die hohe Berechtigungen mit administrativer Zustimmung benötigt (und diese genehmigen, wenn Sie der Administrator sind) - wie das Senden von E-Mails im Namen eines Benutzers, Rollenmanagement usw. Dies ermöglicht es uns, **Phishing-Angriffe** durchzuführen, die im Erfolgsfall sehr **ertragreich** wären.
|
||||
|
||||
Moreover, you could also accept that application with your user as a way to maintain access over it.
|
||||
Darüber hinaus könnten Sie auch diese Anwendung mit Ihrem Benutzer akzeptieren, um den Zugriff darauf aufrechtzuerhalten.
|
||||
|
||||
### Applications and Service Principals
|
||||
### Anwendungen und Dienstprinzipale
|
||||
|
||||
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.
|
||||
Mit den Rechten eines Anwendungsadministrators, GA oder einer benutzerdefinierten Rolle mit microsoft.directory/applications/credentials/update Berechtigungen können wir Anmeldeinformationen (Geheimnis oder Zertifikat) zu einer bestehenden Anwendung hinzufügen.
|
||||
|
||||
It's possible to **target an application with high permissions** or **add a new application** with high permissions.
|
||||
Es ist möglich, **eine Anwendung mit hohen Berechtigungen zu zielen** oder **eine neue Anwendung** mit hohen Berechtigungen hinzuzufügen.
|
||||
|
||||
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**.
|
||||
Eine interessante Rolle, die der Anwendung hinzugefügt werden könnte, wäre die **Rolle des privilegierten Authentifizierungsadministrators**, da sie es ermöglicht, das Passwort von globalen Administratoren **zurückzusetzen**.
|
||||
|
||||
Diese Technik ermöglicht es auch, **MFA zu umgehen**.
|
||||
```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
|
||||
|
||||
- Für die authentifizierung basierend auf Zertifikaten
|
||||
```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:
|
||||
Mit **DA-Rechten** auf dem lokalen AD ist es möglich, **neue Token-Signierungs**- und **Token-Entschlüsselungszertifikate** zu erstellen und zu importieren, die eine sehr lange Gültigkeit haben. Dies ermöglicht es uns, **uns als jeden Benutzer** anzumelden, dessen ImuutableID wir kennen.
|
||||
|
||||
**Führen** Sie den folgenden Befehl als **DA auf dem ADFS-Server(n)** aus, um neue Zertifikate zu erstellen (Standardpasswort 'AADInternals'), fügen Sie sie zu ADFS hinzu, deaktivieren Sie die automatische Rollierung und starten Sie den Dienst neu:
|
||||
```powershell
|
||||
New-AADIntADFSSelfSignedCertificates
|
||||
```
|
||||
|
||||
Then, update the certificate information with Azure AD:
|
||||
|
||||
Dann aktualisieren Sie die Zertifikatsinformationen mit Azure AD:
|
||||
```powershell
|
||||
Update-AADIntADFSFederationSettings -Domain cyberranges.io
|
||||
```
|
||||
### Federation - Vertrauenswürdige Domäne
|
||||
|
||||
### 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:
|
||||
|
||||
Mit GA-Rechten auf einem Mandanten ist es möglich, eine **neue Domäne hinzuzufügen** (muss verifiziert werden), ihren Authentifizierungstyp auf Federated zu konfigurieren und die Domäne so zu konfigurieren, dass sie **ein bestimmtes Zertifikat** (any.sts im folgenden Befehl) und Aussteller vertraut:
|
||||
```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
|
||||
## Referenzen
|
||||
|
||||
- [https://aadinternalsbackdoor.azurewebsites.net/](https://aadinternalsbackdoor.azurewebsites.net/)
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,16 +4,15 @@
|
||||
|
||||
## Queue
|
||||
|
||||
For more information check:
|
||||
Für weitere Informationen siehe:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/az-queue-enum.md
|
||||
{{#endref}}
|
||||
|
||||
### 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.
|
||||
### Aktionen: `Microsoft.Storage/storageAccounts/queueServices/queues/write`
|
||||
|
||||
Diese Berechtigung ermöglicht es einem Angreifer, Warteschlangen und deren Eigenschaften innerhalb des Speicherkontos zu erstellen oder zu ändern. Sie kann verwendet werden, um unbefugte Warteschlangen zu erstellen, Metadaten zu ändern oder Zugriffssteuerlisten (ACLs) zu ändern, um den Zugriff zu gewähren oder einzuschränken. Diese Fähigkeit könnte Arbeitsabläufe stören, bösartige Daten injizieren, sensible Informationen exfiltrieren oder Warteschlangeneinstellungen manipulieren, um weitere Angriffe zu ermöglichen.
|
||||
```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
|
||||
## Referenzen
|
||||
|
||||
- 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,42 +4,34 @@
|
||||
|
||||
## Storage Privesc
|
||||
|
||||
For more information about storage check:
|
||||
Für weitere Informationen über Storage siehe:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/az-storage.md
|
||||
{{#endref}}
|
||||
|
||||
### Common tricks
|
||||
### Häufige Tricks
|
||||
|
||||
- Keep the access keys
|
||||
- Generate SAS
|
||||
- User delegated are 7 days max
|
||||
- Halte die Zugriffsschlüssel
|
||||
- Generiere SAS
|
||||
- Benutzerdelegierte sind maximal 7 Tage
|
||||
|
||||
### 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.
|
||||
|
||||
Diese Berechtigungen ermöglichen es dem Benutzer, die Eigenschaften des Blob-Dienstes für die Funktion zur Aufbewahrung gelöschter Container zu ändern, die den Aufbewahrungszeitraum für gelöschte Container aktiviert oder konfiguriert. Diese Berechtigungen können verwendet werden, um die Persistenz aufrechtzuerhalten und dem Angreifer ein Zeitfenster zu bieten, um gelöschte Container, die dauerhaft entfernt werden sollten, wiederherzustellen oder zu manipulieren und auf sensible Informationen zuzugreifen.
|
||||
```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.
|
||||
|
||||
Diese Berechtigungen können es dem Angreifer ermöglichen, die Aufbewahrungsrichtlinien zu ändern, gelöschte Daten wiederherzustellen und auf sensible Informationen zuzugreifen.
|
||||
```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}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,28 +2,24 @@
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
## VMs persistence
|
||||
## VMs Persistenz
|
||||
|
||||
For more information about VMs check:
|
||||
Für weitere Informationen zu VMs siehe:
|
||||
|
||||
{{#ref}}
|
||||
../az-services/vms/
|
||||
{{#endref}}
|
||||
|
||||
### Backdoor VM applications, VM Extensions & Images <a href="#backdoor-instances" id="backdoor-instances"></a>
|
||||
### Backdoor-VM-Anwendungen, VM-Erweiterungen & Bilder <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.
|
||||
Ein Angreifer identifiziert Anwendungen, Erweiterungen oder Bilder, die häufig im Azure-Konto verwendet werden. Er könnte seinen Code in VM-Anwendungen und -Erweiterungen einfügen, sodass jedes Mal, wenn sie installiert werden, die Hintertür ausgeführt wird.
|
||||
|
||||
### Backdoor Instances <a href="#backdoor-instances" id="backdoor-instances"></a>
|
||||
### Backdoor-Instanzen <a href="#backdoor-instances" id="backdoor-instances"></a>
|
||||
|
||||
An attacker could get access to the instances and backdoor them:
|
||||
Ein Angreifer könnte Zugriff auf die Instanzen erhalten und sie mit einer Hintertür versehen:
|
||||
|
||||
- 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**
|
||||
- Verwendung eines traditionellen **Rootkits** zum Beispiel
|
||||
- Hinzufügen eines neuen **öffentlichen SSH-Schlüssels** (siehe [EC2 privesc options](https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-privilege-escalation/aws-ec2-privesc))
|
||||
- Hintertür in den **Benutzerdaten**
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user