mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-27 23:34:32 -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
|
||||
### अवैध सहमति अनुदान
|
||||
|
||||
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 पर, **नए Token signing** और **Token Decrypt certificates** बनाना और आयात करना संभव है जिनकी वैधता बहुत लंबी होती है। यह हमें **किसी भी उपयोगकर्ता के रूप में लॉग-इन** करने की अनुमति देगा जिसका ImuutableID हमें पता है।
|
||||
|
||||
**निम्नलिखित कमांड** को **ADFS सर्वर(s) पर DA के रूप में चलाएँ** नए certs बनाने के लिए (डिफ़ॉल्ट पासवर्ड '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 विशेषाधिकारों के साथ एक टेनेट पर, **एक नया डोमेन जोड़ना** संभव है (इसकी पुष्टि होनी चाहिए), इसके प्रमाणीकरण प्रकार को फेडरेटेड पर कॉन्फ़िगर करना और डोमेन को **एक विशिष्ट प्रमाणपत्र** (नीचे दिए गए कमांड में 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}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
यह अनुमति एक हमलावर को स्टोरेज खाते के भीतर कतारें और उनकी विशेषताओं को बनाने या संशोधित करने की अनुमति देती है। इसका उपयोग अनधिकृत कतारें बनाने, मेटाडेटा को संशोधित करने, या एक्सेस कंट्रोल सूचियों (ACLs) को बदलने के लिए किया जा सकता है ताकि पहुँच को प्रदान या प्रतिबंधित किया जा सके। यह क्षमता कार्यप्रवाहों को बाधित कर सकती है, दुर्भावनापूर्ण डेटा इंजेक्ट कर सकती है, संवेदनशील जानकारी को एक्सफिल्ट्रेट कर सकती है, या आगे के हमलों को सक्षम करने के लिए कतार सेटिंग्स में हेरफेर कर सकती है।
|
||||
```bash
|
||||
az storage queue create --name <new-queue-name> --account-name <storage-account>
|
||||
|
||||
@@ -21,7 +20,6 @@ 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
|
||||
@@ -29,7 +27,3 @@ az storage queue policy set --name <queue-name> --permissions rwd --expiry 2024-
|
||||
- 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:
|
||||
स्टोरेज के बारे में अधिक जानकारी के लिए देखें:
|
||||
|
||||
{{#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.
|
||||
|
||||
ये अनुमतियाँ उपयोगकर्ता को कंटेनर हटाने की रिटेंशन सुविधा के लिए ब्लॉब सेवा गुणों को संशोधित करने की अनुमति देती हैं, जो हटाए गए कंटेनरों के लिए रिटेंशन अवधि को सक्षम या कॉन्फ़िगर करती है। इन अनुमतियों का उपयोग स्थिरता बनाए रखने के लिए किया जा सकता है ताकि हमलावर को हटाए गए कंटेनरों को पुनर्प्राप्त करने या हेरफेर करने का एक अवसर मिल सके, जिन्हें स्थायी रूप से हटाया जाना चाहिए था और संवेदनशील जानकारी तक पहुँचने के लिए।
|
||||
```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}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,26 +4,22 @@
|
||||
|
||||
## VMs persistence
|
||||
|
||||
For more information about VMs check:
|
||||
VMs के बारे में अधिक जानकारी के लिए देखें:
|
||||
|
||||
{{#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**
|
||||
- उदाहरण के लिए एक पारंपरिक **रूटकिट** का उपयोग करके
|
||||
- एक नया **पब्लिक SSH की** जोड़कर (देखें [EC2 प्रिवेस्क विकल्प](https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-privilege-escalation/aws-ec2-privesc))
|
||||
- **यूजर डेटा** को बैकडोर करके
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user