Translated ['', 'src/pentesting-cloud/azure-security/az-enumeration-tool

This commit is contained in:
Translator
2026-05-26 19:12:19 +00:00
parent 722a5c3aa2
commit 817f6c3bb4
@@ -2,10 +2,10 @@
{{#include ../../banners/hacktricks-training.md}}
## PowerShell को Linux में इंस्टॉल करें
## Linux में PowerShell इंस्टॉल करें
> [!TIP]
> linux में आपको PowerShell Core इंस्टॉल करना होगा:
> Linux में आपको PowerShell Core इंस्टॉल करना होगा:
```bash
sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
@@ -24,15 +24,15 @@ pwsh
# Az cli
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
```
## MacOS पर PowerShell इंस्टॉल करें
## MacOS में PowerShell इंस्टॉल करें
निर्देश [**documentation**](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.4):
[**documentation**](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.4) से निर्देश:
1. यदि `brew` अभी तक इंस्टॉल नहीं है तो इंस्टॉल करें:
1. अगर `brew` अभी तक इंस्टॉल नहीं है, तो उसे इंस्टॉल करें:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
2. PowerShell का नवीनतम स्थिर संस्करण इंस्टॉल करें:
2. PowerShell का नवीनतम stable release install करें:
```sh
brew install powershell/tap/powershell
```
@@ -49,19 +49,19 @@ brew upgrade powershell
### az cli
[**Azure Command-Line Interface (CLI)**](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) एक क्रॉस-प्लेटफ़ॉर्म टूल है जो Python में लिखा गया है और (अधिकांश) Azure और Entra ID संसाधनों का प्रबंधन और प्रशासन करने के लिए उपयोग होता है। यह Azure से कनेक्ट होता है और कमांड लाइन या स्क्रिप्ट्स के माध्यम से प्रशासनिक कमांड निष्पादित करता है।
[**Azure Command-Line Interface (CLI)**](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) एक cross-platform tool है जो Python में लिखा गया है, Azure और Entra ID resources के (अधिकांश) प्रबंधन और प्रशासन के लिए। यह Azure से connect करता है और command line या scripts के माध्यम से administrative commands execute करता है।
इंस्टॉलेशन के लिए इस लिंक का पालन करें: [**installation instructions¡**](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli#install).
[**installation instructions¡**](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli#install) के लिए इस link का पालन करें।
Azure CLI में कमांड इस पैटर्न के अनुसार संरचित होत हैं: `az <service> <action> <parameters>`
Azure CLI में commands इस pattern के अनुसार structured होत हैं: `az <service> <action> <parameters>`
#### Debug | MitM az cli
पैरामीटर **`--debug`** का उपयोग करके यह देखना संभव है कि टूल **`az`** कौन-कौन से अनुरोध भेज रहा है:
**`--debug`** parameter का उपयोग करके tool **`az`** द्वारा भेजे जा रहे सभी requests को देखना संभव है:
```bash
az account management-group list --output table --debug
```
टूल पर **MitM** करने और यह मैन्युअली भेज रहा सभी **requests**ी जाँच करने के लिए आप कर सकते हैं:
MitM करने और tool द्वारा भेजे जा रहे **सभी requests**ो manually **check** करने के लिए आप यह कर सकते हैं:
{{#tabs }}
{{#tab name="Bash" }}
@@ -107,40 +107,40 @@ $env:HTTP_PROXY="http://127.0.0.1:8080"
<details>
<summary><strong>“CA cert does not include key usage extension” को ठीक करना</strong></summary>
### यह त्रुटि क्यों होत है
### यह error क्यों होत है
जब Azure CLI प्रमाणीकृत होता है, तो ह HTTPS अनुरोध बनाता है (via MSAL → Requests → OpenSSL)। अगर आप TLS को Burp के साथ इंटरसेप्ट कर रहे हैं, तो Burp `login.microsoftonline.com` जैसे साइट्स के लिए "on the fly" प्रमाणपत्र जेनरेट करता है और उन्हें Burp क CA से साइन करता है।
जब Azure CLI authenticate करता है, तो ह HTTPS requests बनाता है (MSAL → Requests → OpenSSL के जरिए)। अगर आप Burp के साथ TLS intercept कर रहे हैं, तो Burp `login.microsoftonline.com` जैसे sites के लिए on the fly” certificates बनाता है और उन्हें Burp क CA से sign करता है।
नए स्टैक्स पर (Python 3.13 + OpenSSL 3), CA वेलिडेशन अधिक कड़ा है:
नए stacks (Python 3.13 + OpenSSL 3) में, CA validation ज्यादा strict होती है:
- एक CA प्रमाणपत्र में **Basic Constraints: `CA:TRUE`** और प्रमाणपत्र साइन करने की अनुमति देने वाल **Key Usage** एक्सटेंशन होन चाहिए (**`keyCertSign`**, और आमतौर पर **`cRLSign`**)।
- एक CA certificate में **Basic Constraints: `CA:TRUE`** और certificate signing की अनुमति देने वाल **Key Usage** extension होन चाहिए (**`keyCertSign`**, और आमतौर पर **`cRLSign`** भी)।
Burp की डिफ़ॉल्ट CA (PortSwigger CA) पुरान है और आमतौर पर Key Usage एक्सटेंशन से परे रहती है, इसलिए OpenSSL से तब भी अस्वीकार कर देता है जब आप उसे "trust" करते हैं।
Burp का default CA (PortSwigger CA) पुरान है और आमतौर पर उसमें Key Usage extension नहीं होती, इसलिए OpenSSL से reject कर देता है, भले ही आप उसे trust करं।
इसपरिणामस्वरूप ऐसी त्रुटियाँ आत हैं:
इसऐसे errors आत हैं:
- `CA cert does not include key usage extension`
- `CERTIFICATE_VERIFY_FAILED`
- `self-signed certificate in certificate chain`
इसलिए आपको:
इसलिए आपको यह करना होगा:
1. एक आधुनिक CA बनानी होगी (सही Key Usage के साथ)।
2. Burp को से intercepted certs साइन करने के लिए उपयोग करवाना होगा
3. उस CA को macOS में ट्रस्ट करना होगा
4. Azure CLI / Requests को उस CA बंडल की ओर पॉइंट करना होगा
1. एक modern CA बनाएं (सही Key Usage के साथ)।
2. Burp को उससे intercepted certs sign करने के लिए use कराएं
3. उस CA को macOS में trust करें
4. Azure CLI / Requests को उस CA bundle की ओर point करें
### चरण-दर-चरण: कार्यरत कॉन्फ़िगरेशन
### Step-by-step: working configuration
#### 0) पूर्वापेक्षाएँ
#### 0) Prereqs
- लोकल पर Burp चल रहा हो (proxy at `127.0.0.1:8080`)
- Azure CLI इंस्टॉल किया हुआ हो (Homebrew)
- आपके पास `sudo`ी पहुँच हो (system keychain में CA को ट्रस्ट करने के लिए)
- Burp लोकली running हो (proxy at `127.0.0.1:8080`)
- Azure CLI installed हो (Homebrew)
- आप `sudo`र सकें (system keychain में CA trust करने के लिए)
#### 1) एक मानक-अनुरूप Burp CA बनाएं (PEM + KEY)
#### 1) एक standards-compliant Burp CA (PEM + KEY) बनाएं
एक OpenSSL config फ़ाइल बनाएं जो स्पष्ट रूप से CA एक्सटेंशंस सेट करे:
एक OpenSSL config file बनाएं जो explicit रूप से CA extensions set करे:
```bash
mkdir -p ~/burp-ca && cd ~/burp-ca
@@ -164,7 +164,7 @@ subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
EOF
```
CA certificate + private key जनरेट करें:
CA certificate + private key जनरेट करें:
```bash
openssl req -x509 -new -nodes \
-days 3650 \
@@ -172,16 +172,16 @@ openssl req -x509 -new -nodes \
-out burp-ca.pem \
-config burp-ca.cnf
```
बुनियादी सत्यापन (आपको Key Usage अवश्य दिखना चाहिए):
Sanity check (आपको Key Usage देखना ही होगा):
```bash
openssl x509 -in burp-ca.pem -noout -text | egrep -A3 "Basic Constraints|Key Usage"
```
Expected to include something like:
अपेक्षित रूप से कुछ ऐसा शामिल होना चाहिए:
- `CA:TRUE`
- `Key Usage: ... Certificate Sign, CRL Sign`
#### 2) PKCS#12 में परिवर्तित करें (Burp import format)
#### 2) PKCS#12 में convert करें (Burp import format)
Burp को certificate + private key चाहिए, सबसे आसान PKCS#12 के रूप में:
```bash
@@ -191,52 +191,52 @@ openssl pkcs12 -export \
-in burp-ca.pem \
-name "Burp Custom Root CA"
```
आपसे एक निर्यात पासवर्ड पूछा जाएगा (एक सेट करें; Burp यह पूछेगा)।
आपसे एक export password पूछा जाएगा (एक सेट करें; Burp इसके लिए पूछेगा)।
#### 3) CA को Burp में इम्पोर्ट करें और Burp को रीस्टार्ट करें
#### 3) CA को Burp में import करें और Burp restart करें
Burp में:
- Proxy → Options
- Find Import / export CA certificate
- Click Import CA certificate
- Choose PKCS#12
- Select `burp-ca.p12`
- पासवर्ड दर्ज करें
- Burp को पूरी तरह से रीस्टार्ट करें (महत्वपूर्ण)
- Import / export CA certificate खोजें
- Import CA certificate पर क्लिक करें
- PKCS#12 चुनें
- `burp-ca.p12` चुनें
- password दर्ज करें
- Burp को पूरी तरह restart करें (महत्वपूर्ण)
क्यों रीस्टार्ट करें? Burp रीस्टार्ट तक पुरान CA का उपयोग करत रह सकत है।
क्यों restart करें? Burp restart तक पुरान CA का उपयोग करत रह सकत है।
#### 4) macOS system keychain में नए CA को ट्रस्ट करें
#### 4) नए CA पर macOS system keychain में trust करें
यह सिस्टम ऐप्स और कई TLS stacks को CA पर भरोसा करने की अनुमति देता है।
यह system apps और कई TLS stacks को CA पर trust करने की अनुमति देता है।
```bash
sudo security add-trusted-cert \
-d -r trustRoot \
-k /Library/Keychains/System.keychain \
~/burp-ca/burp-ca.pem
```
(यदि आप GUI पसंद करते हैं: Keychain Access → System → Certificates → import → set “Always Trust”.)
(यदि आप GUI पसंद करते हैं: Keychain Access → System → Certificates → import → “Always Trust” सेट करें।)
#### 5) प्रॉक्सी के env vars कॉन्फ़िगर करें
#### 5) proxy env vars कॉन्फ़िगर करें
```bash
export HTTPS_PROXY="http://127.0.0.1:8080"
export HTTP_PROXY="http://127.0.0.1:8080"
```
#### 6) Requests/Azure CLI को अपने Burp CA पर भरोसा करने के लिए कॉन्फ़िगर करें
#### 6) Requests/Azure CLI को अपने Burp CA पर trust करने के लिए configure करें
Azure CLI आंतरिक रूप से Python Requests का उपयोग करता है; इन दोनों को सेट करें:
Azure CLI internally Python Requests का उपयोग करता है; दोनों को set करें:
```bash
export REQUESTS_CA_BUNDLE="$HOME/burp-ca/burp-ca.pem"
export SSL_CERT_FILE="$HOME/burp-ca/burp-ca.pem"
```
Notes:
- `REQUESTS_CA_BUNDLE` का उपयोग Requests द्वारा किया जाता है।
- `SSL_CERT_FILE` अन्य TLS consumers और edge cases के लिए सहायक होता है।
- आम तौर पर आपको पुराने `ADAL_PYTHON_SSL_NO_VERIFY` / `AZURE_CLI_DISABLE_CONNECTION_VERIFICATION` की आवश्यकता नहीं होती जब तक CA सही न हो
- `REQUESTS_CA_BUNDLE` Requests द्वारा उपयोग किया जाता है।
- `SSL_CERT_FILE` अन्य TLS consumers और edge cases के लिए मदद करता है।
- आमतौर पर, जब CA सही हो, तो आपको पुराने `ADAL_PYTHON_SSL_NO_VERIFY` / `AZURE_CLI_DISABLE_CONNECTION_VERIFICATION` की आवश्यकता नहीं होती।
#### 7) सुनिश्चित करें कि Burp वास्तव में आपके नए CA के साथ साइन कर रहा है (महत्वपूर्ण जाँच)
#### 7) Verify Burp वास्तव में आपके नए CA के साथ signing कर रहा है (critical check)
यह पुष्टि करता है कि आपकी interception chain सही है:
```bash
@@ -244,13 +244,13 @@ openssl s_client -connect login.microsoftonline.com:443 \
-proxy 127.0.0.1:8080 </dev/null 2>/dev/null \
| openssl x509 -noout -issuer
```
अपेक्षित issuer में आपका CA नाम शामिल होना चाहिए, उदाहरण:
अपेक्षित issuer में आपका CA नाम होना चाहिए, जैसे:
`O=Burp Custom CA, CN=Burp Custom Root CA`
यदि आप अभी भी PortSwigger CA दख रह है, तो Burp आपका imported CA उपयोग नहीं कर रहा है → import की जाँच करें और पुनरारंभ करें।
अगर आपको अभी भी PortSwigger CA दिख रह है, तो Burp आपका imported CA इस्तेमाल नहीं कर रहा है → import दोबारा जांचें और restart करें।
#### 8) सुनिश्चित करें कि Python Requests Burp के माध्यम से काम कर रहा है
#### 8) Verify Python Requests works through Burp
```bash
python3 - <<'EOF'
import requests
@@ -258,61 +258,59 @@ requests.get("https://login.microsoftonline.com")
print("OK")
EOF
```
अपेक्षित: `OK`
#### 9) Azure CLI परीक्षण
#### 9) Azure CLI test
```bash
az account get-access-token --resource=https://management.azure.com/
```
यदि आप पहले से लॉग इन हैं, तो यह `accessToken` के साथ JSON लौटाएगा
यदि आप पहले से logged in हैं, तो इसे `accessToken` के साथ JSON लौटाना चाहिए।
</details>
### Az PowerShell
Azure PowerShell एक मॉड्यूल है जिसमें cmdlets होते हैं जो PowerShell कमांड लाइन से सीधे Azure resources को प्रबंधित करने के लिए होते हैं।
Azure PowerShell एक module है जिसमें Azure resources को सीधे PowerShell command line से manage करने के लिए cmdlets होते हैं।
इंस्टॉलेशन निर्देशों के लिए इस लिंक को देखें: [**installation instructions**](https://learn.microsoft.com/en-us/powershell/azure/install-azure-powershell).
[**installation instructions**](https://learn.microsoft.com/en-us/powershell/azure/install-azure-powershell) के लिए इस link का पालन करें।
Azure PowerShell AZ Module में कमांड्स इस प्रकार संरचित होत हैं: `<Action>-Az<Service> <parameters>`
Azure PowerShell AZ Module में commands इस तरह structured होत हैं: `<Action>-Az<Service> <parameters>`
#### Debug | MitM Az PowerShell
`-Debug` parameter का उपयोग करके आप टूल द्वारा भेजे जा रहे सभी अनुरोध देख सकते है:
**`-Debug`** parameter का उपयोग करके tool द्वारा भेजे जा रहे सभी requests देखना संभव है:
```bash
Get-AzResourceGroup -Debug
```
In order to do a **MitM** to the tool and **check all the requests** it's sending manually you can set the env variables `HTTPS_PROXY` and `HTTP_PROXY` according to the [**docs**](https://learn.microsoft.com/en-us/powershell/azure/az-powershell-proxy).
**MitM** करने और **सभी requests को manually check** करने के लिए, आप env variables `HTTPS_PROXY` और `HTTP_PROXY` को [**docs**](https://learn.microsoft.com/en-us/powershell/azure/az-powershell-proxy) के अनुसार set कर सकते हैं।
### Microsoft Graph PowerShell
Microsoft Graph PowerShell एक क्रॉस‑प्लेटफ़ॉर्म SDK है जो एकल endpoint का उपयोग करके SharePoint, Exchange, और Outlook जैसी सेवाओं सहित सभी Microsoft Graph APIs तक पहुँच प्रदान करता है। यह PowerShell 7+ का समर्थन करता है, MSAL के माध्यम से आधुनिक प्रमाणीकरण, external identities और advanced queries का समर्थन करता है। न्यूनतम विशेषाधिकार (least privilege) पहुंच पर ध्यान केंद्रित करते हुए यह सुरक्षित संचालन सुनिश्चित करता है और नवीनतम Microsoft Graph API सुविधाओं के अनुरूप रहने के लिए नियमित अपडेट प्राप्त करता है।
Microsoft Graph PowerShell एक cross-platform SDK है जो SharePoint, Exchange, और Outlook जैसी services सहित सभी Microsoft Graph APIs तक single endpoint का उपयोग करके access enable करता है। यह PowerShell 7+, MSAL के through modern authentication, external identities, और advanced queries को support करता है। least privilege access पर focus के साथ, यह secure operations सुनिश्चित करता है और latest Microsoft Graph API features के साथ align रहने के लिए नियमित updates प्राप्त करता है।
Follow this link for the [**installation instructions**](https://learn.microsoft.com/en-us/powershell/microsoftgraph/installation).
[**installation instructions**](https://learn.microsoft.com/en-us/powershell/microsoftgraph/installation) के लिए इस link को follow करें।
Commands in Microsoft Graph PowerShell are structured like: `<Action>-Mg<Service> <parameters>`
Microsoft Graph PowerShell में commands इस तरह structured होती हैं: `<Action>-Mg<Service> <parameters>`
#### Debug Microsoft Graph PowerShell
पैरामीटर **`-Debug`** का उपयोग करके आप टूल द्वारा भेजे जा रहे सभी अनुरोधों को देख सकते है:
**`-Debug`** parameter का उपयोग करके tool जो सभी requests भेज रहा है, उन्हें देखना possible है:
```bash
Get-MgUser -Debug
```
### ~~**AzureAD Powershell**~~
Azure Active Directory (AD) मॉड्यूल, अब **अप्रचलित**, Azure PowerShell का हिस्सा है जो Azure AD resources के प्रबंधन के लिए है। यह users, groups और application registrations को Entra ID में प्रबंधित करने जैसे कार्यों के लिए cmdlets प्रदान करता है।
Azure Active Directory (AD) module, अब **deprecated** है, Azure PowerShell का हिस्सा है जो Azure AD resources को manage करने के लिए उपयोग होता है। यह users, groups, और application registrations in Entra ID को manage करने के लिए cmdlets प्रदान करता है।
> [!TIP]
> यह Microsoft Graph PowerShell बदल दिया गया है
> इसे Microsoft Graph PowerShell replace कर दिया है
Follow this link for the [**स्थापना निर्देश**](https://www.powershellgallery.com/packages/AzureAD).
[**installation instructions**](https://www.powershellgallery.com/packages/AzureAD) के लिए इस link को follow करें।
## स्वचालित Recon और Compliance टूल्स
## Automated Recon & Compliance Tools
### [turbot azure plugins](https://github.com/orgs/turbot/repositories?q=mod-azure)
Turbot, steampipe और powerpipe के साथ Azure और Entra ID से जानकारी एकत्र करने, अनुपालन जांच करने और गलत कॉन्फ़िगरेशन खोजने की अनुमति देता है। वर्तमान में चलाने के लिए सबसे अनुशंसित Azure मॉड्यूल हैं:
steampipe और powerpipe के साथ Turbot, Azure और Entra ID से information gather करने, compliance checks perform करने, और misconfigurations find करने की सुविधा देता है। अभी सबसे recommended Azure modules जिन्हें run करना चाहिए, वे हैं:
- [https://github.com/turbot/steampipe-mod-azure-compliance](https://github.com/turbot/steampipe-mod-azure-compliance)
- [https://github.com/turbot/steampipe-mod-azure-insights](https://github.com/turbot/steampipe-mod-azure-insights)
@@ -343,9 +341,9 @@ powerpipe server
```
### [Prowler](https://github.com/prowler-cloud/prowler)
Prowler एक Open Source सुरक्षा टूल है जो AWS, Azure, Google Cloud और Kubernetes के लिए security best practices के आकलन, audits, incident response, continuous monitoring, hardening और forensics readiness करने के लिए उपयोग किया जाता है।
Prowler एक Open Source security tool है जो AWS, Azure, Google Cloud और Kubernetes के security best practices assessments, audits, incident response, continuous monitoring, hardening और forensics readiness के लिए उपयोग होता है।
यह मूल रूप से हमें Azure environment के खिलाफ सैकड़ों checks चलाक security misconfigurations खोजने और परिणामों को json (और अन्य टेक्स्ट फॉर्मेट) में इकट्ठा करने या वेब पर देखने की अनुमति देता है
यह मूल रूप से हमें Azure environment के खिलाफ hundreds of checks run करने की अनुमति देता है ताकि security misconfigurations ढूंढी जा सकें और results को json (और अन्य text format) में gather किया जा सके या web में check किया जा सके
```bash
# Create a application with Reader role and set the tenant ID, client ID and secret in prowler so it access the app
@@ -367,9 +365,9 @@ docker run --rm -e "AZURE_CLIENT_ID=<client-id>" -e "AZURE_TENANT_ID=<tenant-id>
```
### [Monkey365](https://github.com/silverhack/monkey365)
यह Azure सब्सक्रिप्शन और Microsoft Entra ID की सुरक्षा कॉन्फ़िगरेशन समीक्षाओं को स्वचालित रूप से करने की अनुमति देता है।
यह Azure subscriptions और Microsoft Entra ID security configuration reviews को automatically perform करने की अनुमति देता है।
HTML रिपोर्टें github रिपॉज़िटरी फ़ोल्डर के अंदर `./monkey-reports` डायरेक्टरी में संग्रहीत की जाती हैं।
HTML reports github repository folder के अंदर `./monkey-reports` directory में stored होते हैं।
```bash
git clone https://github.com/silverhack/monkey365
Get-ChildItem -Recurse monkey365 | Unblock-File
@@ -390,7 +388,7 @@ Invoke-Monkey365 -TenantId <tenant-id> -ClientId <client-id> -ClientSecret $Secu
```
### [ScoutSuite](https://github.com/nccgroup/ScoutSuite)
Scout Suite मैन्युअल निरीक्षण के लिए कॉन्फ़िगरेशन डेटा इकट्ठा करता है और जोखिम वाले क्षेत्रों को उजागर करता है। यह एक multi-cloud security-auditing टूल है, जो cloud environments की security posture का आकलन करने में सक्षम बनाता है।
Scout Suite मैनुअल inspection के लिए configuration data इकट्ठा करता है और risk areas को highlight करता है। यह एक multi-cloud security-auditing tool है, जो cloud environments की security posture assessment को सक्षम बनाता है।
```bash
virtualenv -p python3 venv
source venv/bin/activate
@@ -406,18 +404,26 @@ python scout.py azure --cli
```
### [Azure-MG-Sub-Governance-Reporting](https://github.com/JulianHayward/Azure-MG-Sub-Governance-Reporting)
यह एक powershell स्क्रिप्ट है जो आपको **Management Group और Entra ID के भीतर सभी संसाधन और अनुमतियों को दृश्य रूप में देखने** और सुरक्षा गलत कॉन्फ़िगरेशन खोजने में मदद करती है।
यह एक powershell script है जो आपको **Management Group और Entra ID** tenant के अंदर मौजूद सभी resources और permissions को visualize करने और security misconfigurations खोजने में मदद करती है।
यह Az PowerShell module का उपयोग करके काम करती है, इसलिए जो भी authentication Az PowerShell module द्वारा समर्थित है, वह इस tool द्वारा भी समर्थित है।
यह Az PowerShell module का उपयोग करके काम करती है, इसलिए इस tool द्वारा समर्थित कोई भी authentication, tool द्वारा भी समर्थित है।
```bash
import-module Az
.\AzGovVizParallel.ps1 -ManagementGroupId <management-group-id> [-SubscriptionIdWhitelist <subscription-id>]
```
## स्वचालित Post-Exploitation टूल्स
## Automated Post-Exploitation tools
### [**ROADRecon**](https://github.com/dirkjanm/ROADtools)
### [**ROADtools**](https://github.com/dirkjanm/ROADtools) / ROADrecon / ROADtx
ROADRecon का enumeration Entra ID की कॉन्फ़िगरेशन के बारे में जानकारी देता है, जैसे उपयोगकर्ता, समूह, भूमिकाएँ, कंडीशनल एक्सेस नीतियाँ...
ROADtools Entra ID offensive research के लिए मुख्य open-source frameworks में से एक है। सबसे relevant components ये हैं:
- **`roadrecon`**: tenant discovery और local dataset generation (users, groups, roles, devices, service principals, applications, directory settings).
- **`roadtx`**: token acquisition/exchange, refresh-token reuse, device registration, and PRT workflows.
- **`roadlib`**: lower-level auth/API library used by the other modules.
Collected data local SQLite database में store होती है और ROADrecon web UI में explore की जा सकती है, जो privileged users, role assignments, devices, service principals, और application relationships को map करने के लिए useful है, before planning persistence or lateral movement.
#### ROADrecon collection
```bash
cd ROADTools
pipenv shell
@@ -428,25 +434,58 @@ roadrecon auth --as-app --client "<client-id>" --password "<secret>" --tenant "<
roadrecon gather
roadrecon gui
```
ROADrecon मूल रूप से Azure AD Graph को लक्षित करता था। **22 मई, 2026** तक, आधिकारिक repository अभी भी **`msgraph`** branch में Microsoft Graph support बनाए रखता है, और **Tom2Byrne/ROADtools** जैसे community forks Graph-based collection को अपडेट करना जारी रखते हैं। Graph-capable builds में, ROADrecon **`-mg`** switch जोड़ता है ताकि **`/users`**, **`/groups`**, **`/devices`**, **`/servicePrincipals`**, और **`/applications`** जैसे endpoints को enumerate किया जा सके।
```bash
# Graph-capable ROADrecon builds
roadrecon auth -u test@corp.onmicrosoft.com -p "Welcome2022!"
roadrecon gather -mg
roadrecon gui
```
#### ROADtx high-value use cases
अगर आपके पास पहले से valid credentials, एक refresh token, या एक PRT-derived session है, तो ROADtx आमतौर पर इन कामों के लिए इस्तेमाल होता है:
- **Register a rogue Entra ID device** against **`urn:ms-drs:enterpriseregistration.windows.net`** to device keys/certificates प्राप्त करने और durable device-backed access बनाने के लिए।
- **Exchange/reuse refresh tokens** ताकि बिना interactive sign-in दोहराए fresh Microsoft Graph या अन्य resource tokens मिल सकें।
- **Abuse PRT workflows** ताकि background में silently नए access tokens mint किए जा सकें।
एक useful hunting clue यह है कि default **`roadtx device`** values historically ये रही हैं:
- **OS**: `Windows`
- **OS version**: `10.0.19041.928`
- **Name**: `DESKTOP-<RANDOM 8 DIGITS>`
इन values को आसानी से बदला जा सकता है, इसलिए इन्हें **weak indicators** मानें। फिर भी, unusual device registration events, non-corporate naming patterns, suspicious source IPs/geos/ASNs, या scripted user agents के साथ correlate करने पर ये उपयोगी होते हैं।
#### ROADtools opsec / hunting notes
क्योंकि ROADtools legitimate Microsoft identity APIs का उपयोग करता है, defenders को malware-like signatures की उम्मीद करने के बजाय **token activity, enumeration patterns, और user-agent anomalies के combination** पर hunt करना चाहिए। उपयोगी signals में शामिल हैं:
- `Add device`, `Add registered owner to device`, `Add registered user to device`, और `Register device` जैसी **Device registration** audit operations
- **Device Registration Service** से जुड़ी requests या sign-ins
- **`python-requests`**, **`urllib`**, या **`curl`** जैसे script-like user agents
- **`/users`**, **`/groups`**, **`/devices`**, **`/servicePrincipals`**, और **`/applications`** जैसे discovery-heavy endpoints के खिलाफ bursty Microsoft Graph reads
- audit data में दिखने वाले powerful OAuth scopes, खासकर **`Directory.ReadWrite.All`**, **`Device.ReadWrite.All`**, **`Application.ReadWrite.All`**, **`AuditLog.ReadWrite.All`**, और **`Policy.ReadWrite.All`**
### [**AzureHound**](https://github.com/BloodHoundAD/AzureHound)
AzureHound Microsoft Entra ID और Azure के लिए BloodHound collector है। यह Windows/Linux/macOS के लिए एक single static Go binary है जो सीधे निम्नलिखित से संपर्क करता है:
AzureHound, Microsoft Entra ID और Azure के लिए BloodHound collector है। यह Windows/Linux/macOS के लिए एक single static Go binary है जो सीधे इनसे बात करता है:
- Microsoft Graph (Entra ID directory, M365) और
- Azure Resource Manager (ARM) control plane (subscriptions, resource groups, compute, storage, key vault, app services, AKS, etc.)
मुख्य विशेषताएँ
- सार्वजनिक इंटरनेट से कहीं से भी tenant APIs के खिलाफ चलाया जा सकता है (कोई internal network access आवश्यक नहीं)
- BloodHound CE ingest के लिए JSON आउटपुट करता है ताकि identities और cloud resources के across attack paths को visualize किया जा सके
- डिफ़ॉल्ट User-Agent देखा गया: azurehound/v2.x.x
मुख्य traits
- tenant APIs के खिलाफ public internet पर कहीं से भी run होता है (internal network access की जरूरत नहीं)
- identities और cloud resources के across attack paths visualize करने के लिए BloodHound CE ingestion हेतु JSON output देता है
- देखा गया default User-Agent: azurehound/v2.x.x
प्रमाणीकरण विकल्प
- उपयोगकर्ता नाम + पासवर्ड: -u <upn> -p <password>
- रीफ़्रेश टोकन: --refresh-token <rt>
Authentication options
- Username + password: -u <upn> -p <password>
- Refresh token: --refresh-token <rt>
- JSON Web Token (access token): --jwt <jwt>
- Service principal secret: -a <appId> -s <secret>
- Service principal certificate: -a <appId> --cert <cert.pem> --key <key.pem> [--keypass <pass>]
उदाहरण
Examples
```bash
# Full tenant collection to file using different auth flows
## User creds
@@ -481,7 +520,7 @@ azurehound list storage-containers -t "<tenant-id>" -o containers.json
azurehound list web-apps -t "<tenant-id>" -o webapps.json
azurehound list function-apps -t "<tenant-id>" -o funcapps.json
```
What gets queried
क्या क्वेरी किया जाता है
- Graph endpoints (examples):
- /v1.0/organization, /v1.0/users, /v1.0/groups, /v1.0/roleManagement/directory/roleDefinitions, directoryRoles, owners/members
- ARM endpoints (examples):
@@ -511,7 +550,7 @@ Launch the BloodHound web with `curl -L https://ghst.ly/getbhce | docker compose
### [**MicroBurst**](https://github.com/NetSPI/MicroBurst)
MicroBurst includes functions and scripts that support Azure Services discovery, weak configuration auditing, and post exploitation actions such as credential dumping. It is intended to be used during penetration tests where Azure is in use.
MicroBurst में ऐसे functions और scripts शामिल हैं जो Azure Services discovery, weak configuration auditing, और post exploitation actions जैसे credential dumping को support करते हैं। इसे Azure के उपयोग वाले penetration tests के दौरान उपयोग करने के लिए intended किया गया है।
```bash
Import-Module .\MicroBurst.psm1
Import-Module .\Get-AzureDomainInfo.ps1
@@ -519,9 +558,9 @@ Get-AzureDomainInfo -folder MicroBurst -Verbose
```
### [**PowerZure**](https://github.com/hausec/PowerZure)
PowerZure को Azure, EntraID और उनसे जुड़े संसाधनों के reconnaissance और exploitation दोनों करने में सक्षम एक फ्रेमवर्क की आवश्यकता के चलते बनाया गया था।
PowerZure को Azure, EntraID, और उनसे जुड़े resources पर reconnaissance और exploitation दोनों करने वाले framework की जरूरत से बनाया गया था।
यह **Az PowerShell** मॉड्यूल का उपयोग करता है, इसलिए इस मॉड्यूल द्वारा समर्थित कोई भी authentication इस टूल द्वारा भी समर्थित है।
यह **Az PowerShell** module का उपयोग करता है, इसलिए इस tool द्वारा supported कोई भी authentication, इस tool द्वारा भी supported है।
```bash
# Login
Import-Module Az
@@ -552,7 +591,7 @@ Invoke-AzureRunCommand -Command <command> -VMName <vmname>
```
### [**GraphRunner**](https://github.com/dafthack/GraphRunner/wiki/Invoke%E2%80%90GraphRunner)
GraphRunner, Microsoft Graph API के साथ इंटरैक्ट करने के लिए एक post-exploitation टूलसेट है। यह Microsoft Entra ID (Azure AD) खाते से reconnaissance, persistence और data pillaging के लिए विभिन्न टूल प्रदान करता है।
GraphRunner Microsoft Graph API के साथ interact करने के लिए एक post-exploitation toolset है। यह Microsoft Entra ID (Azure AD) account से reconnaissance, persistence, और data pillaging करने के लिए विभिन्न tools प्रदान करता है।
```bash
#A good place to start is to authenticate with the Get-GraphTokens module. This module will launch a device-code login, allowing you to authenticate the session from a browser session. Access and refresh tokens will be written to the global $tokens variable. To use them with other GraphRunner modules use the Tokens flag (Example. Invoke-DumpApps -Tokens $tokens)
Import-Module .\GraphRunner.ps1
@@ -596,9 +635,9 @@ Invoke-GraphRunner -Tokens $tokens
```
### [Stormspotter](https://github.com/Azure/Stormspotter)
Stormspotter Azure subscription में मौजूद resources का “attack graph” बनाता है। यह red teams और pentesters को tenant के भीतर attack surface और pivot opportunities को visualize करने में सक्षम बनाता है, और आपके defenders को incident response कार्यों को जल्दी से ओरिएंट और प्राथमिकता देने के लिए तेज़ी से सक्षम कर देता है।
Stormspotter Azure subscription के resources का एक “attack graph” बनाता है। यह red teams और pentesters को tenant के भीतर attack surface और pivot opportunities visualize करने देता है, और आपके defenders को incident response work को जल्दी orient और prioritize करने में मदद करता है।
**दुर्भाग्यवश, यह मेंटेन नहीं किया जा रहा लगता है।**
**दुर्भाग्य से, यह maintained नहीं लगता**.
```bash
# Start Backend
cd stormspotter\backend\
@@ -616,11 +655,15 @@ az login -u test@corp.onmicrosoft.com -p Welcome2022!
python stormspotter\stormcollector\sscollector.pyz cli
# This will generate a .zip file to upload in the frontend (127.0.0.1:9091)
```
## संदर्भ
- [AzureHound के साथ क्लाउड खोज (Unit 42)](https://unit42.paloaltonetworks.com/threat-actor-misuse-of-azurehound/)
- [AzureHound रिपॉजिटरी](https://github.com/SpecterOps/AzureHound)
- [BloodHound रिपॉजिटरी](https://github.com/SpecterOps/BloodHound)
- [AzureHound Community Edition फ़्लैग्स](https://bloodhound.specterops.io/collect-data/ce-collection/azurehound-flags)
## References
- [Cloud Discovery With AzureHound (Unit 42)](https://unit42.paloaltonetworks.com/threat-actor-misuse-of-azurehound/)
- [Paved With Intent: ROADtools and Nation-State Tactics in the Cloud](https://unit42.paloaltonetworks.com/roadtools-cloud-attacks/)
- [ROADtools repository](https://github.com/dirkjanm/ROADtools)
- [ROADtools msgraph branch](https://github.com/dirkjanm/ROADtools/tree/msgraph)
- [Tom2Byrne/ROADtools](https://github.com/Tom2Byrne/ROADtools)
- [AzureHound repository](https://github.com/SpecterOps/AzureHound)
- [BloodHound repository](https://github.com/SpecterOps/BloodHound)
- [AzureHound Community Edition Flags](https://bloodhound.specterops.io/collect-data/ce-collection/azurehound-flags)
- [AzureHound constants/environments.go](https://github.com/SpecterOps/AzureHound/blob/main/constants/environments.go)
- [AzureHound client/storage_accounts.go](https://github.com/SpecterOps/AzureHound/blob/main/client/storage_accounts.go)
- [AzureHound client/roles.go](https://github.com/SpecterOps/AzureHound/blob/main/client/roles.go)