Skip to content

Commit 76162d9

Browse files
authored
Merge pull request #239 from HackTricks-wiki/update_Holiday_Hack_Challenge_2025__Blob_Storage__Storage_20260106_124314
Holiday Hack Challenge 2025 Blob Storage (Storage Secrets)
2 parents b5aa9c1 + f9b181a commit 76162d9

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

src/pentesting-cloud/azure-security/az-services/az-storage.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,30 @@ If "Allow Blob public access" is **enabled** (disabled by default), when creatin
6565

6666
<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUfoetUnYBPWQpRrWNnnlbqWpl8Rdoaeg5uBrCVlvcNDlnKwQHjZe8nUb2SfPspBgbu-lCZLmUei-hFi_Jl2eKbaxUtBGTjdUSDmkrcwr90VZkmuMjk9tyh92p75btfyzGiUTa0-=s2048?key=m8TV59TrCFPlkiNnmhYx3aZt" alt=""><figcaption></figcaption></figure>
6767

68+
#### Auditing anonymous blob exposure
69+
70+
- **Locate storage accounts** that can expose data: `az storage account list | jq -r '.[] | select(.properties.allowBlobPublicAccess==true) | .name'`. If `allowBlobPublicAccess` is `false` you cannot turn containers public.
71+
- **Inspect risky accounts** to confirm the flag and other weak settings: `az storage account show --name <acc> --query '{allow:properties.allowBlobPublicAccess, minTls:properties.minimumTlsVersion}'`.
72+
- **Enumerate container-level exposure** where the flag is enabled:
73+
74+
```bash
75+
az storage container list --account-name <acc> \
76+
--query '[].{name:name, access:properties.publicAccess}'
77+
```
78+
79+
- `"Blob"`: anonymous reads allowed **only when blob name is known** (no listing).
80+
- `"Container"`: anonymous **list + read** of every blob.
81+
- `null`: private; authentication required.
82+
- **Prove access** without credentials:
83+
- If `publicAccess` is `Container`, anonymous listing works: `curl "https://<acc>.blob.core.windows.net/<container>?restype=container&comp=list"`.
84+
- For both `Blob` and `Container`, anonymous blob download works when the name is known:
85+
86+
```bash
87+
az storage blob download -c <container> -n <blob> --account-name <acc> --file /dev/stdout
88+
# or via raw HTTP
89+
curl "https://<acc>.blob.core.windows.net/<container>/<blob>"
90+
```
91+
6892
### Connect to Storage
6993

7094
If you find any **storage** you can connect to you could use the tool [**Microsoft Azure Storage Explorer**](https://azure.microsoft.com/es-es/products/storage/storage-explorer/) to do so.
@@ -222,6 +246,9 @@ Azure Blob Storage now supports the SSH File Transfer Protocol (SFTP), enabling
222246
{{#tabs }}
223247
{{#tab name="az cli" }}
224248

249+
<details>
250+
<summary>az cli enumeration</summary>
251+
225252
```bash
226253
# Get storage accounts
227254
az storage account list #Get the account name from here
@@ -339,11 +366,16 @@ az storage account local-user list \
339366
--resource-group <resource-group-name>
340367
```
341368

369+
</details>
370+
342371
{{#endtab }}
343372

344373
{{#tab name="Az PowerShell" }}
345374

346-
```bash
375+
<details>
376+
<summary>Az PowerShell enumeration</summary>
377+
378+
```powershell
347379
# Get storage accounts
348380
Get-AzStorageAccount | fl
349381
# Get rules to access the storage account
@@ -401,6 +433,8 @@ New-AzStorageBlobSASToken `
401433
-ExpiryTime (Get-Date "2024-12-31T23:59:00Z")
402434
```
403435

436+
</details>
437+
404438
{{#endtab }}
405439
{{#endtabs }}
406440

@@ -433,6 +467,10 @@ az-file-shares.md
433467
- [https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction)
434468
- [https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview](https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview)
435469
- [https://learn.microsoft.com/en-us/azure/storage/blobs/secure-file-transfer-protocol-support](https://learn.microsoft.com/en-us/azure/storage/blobs/secure-file-transfer-protocol-support)
470+
- [Holiday Hack Challenge 2025: Blob Storage (Storage Secrets)](https://0xdf.gitlab.io/holidayhack2025/act1/blob-storage)
471+
- [https://learn.microsoft.com/en-us/cli/azure/storage/account](https://learn.microsoft.com/en-us/cli/azure/storage/account)
472+
- [https://learn.microsoft.com/en-us/cli/azure/storage/container](https://learn.microsoft.com/en-us/cli/azure/storage/container)
473+
- [https://learn.microsoft.com/en-us/cli/azure/storage/blob](https://learn.microsoft.com/en-us/cli/azure/storage/blob)
436474

437475
{{#include ../../../banners/hacktricks-training.md}}
438476

0 commit comments

Comments
 (0)