Skip to content

Commit c86885e

Browse files
author
HackTricks News Bot
committed
Add content from: Holiday Hack Challenge 2025 (Act 1) - Spare Key
1 parent ca809b9 commit c86885e

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

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

Lines changed: 25 additions & 0 deletions
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+
### Static website (`$web`) exposure & leaked secrets
69+
70+
- **Static websites** are served from the special `$web` container over a region-specific endpoint such as `https://<account>.z13.web.core.windows.net/`.
71+
- The `$web` container may report `publicAccess: null` via the blob API, but files are still reachable through the static site endpoint, so dropping config/IaC artifacts there can leak secrets.
72+
- Quick audit workflow:
73+
74+
```bash
75+
# Identify storage accounts with static website hosting enabled
76+
az storage blob service-properties show --account-name <acc-name> --auth-mode login
77+
# Enumerate containers (including $web) and their public flags
78+
az storage container list --account-name <acc-name> --auth-mode login
79+
# List files served by the static site even when publicAccess is null
80+
az storage blob list --container-name '$web' --account-name <acc-name> --auth-mode login
81+
# Pull suspicious files directly (e.g., IaC tfvars containing secrets/SAS)
82+
az storage blob download -c '$web' --name iac/terraform.tfvars --file /dev/stdout --account-name <acc-name> --auth-mode login
83+
```
84+
85+
- Inspect downloaded files for leaked **SAS tokens** or credentials. SAS params show scope and risk: `sv` (API version), `ss` (services like blob `b`), `srt` (resource types `s`/`c`/`o`), `sp` (permissions such as `r`/`l`/`a`/`c`/`w`/`d`/`x`), `se` (expiry), and `sig` (signature). A wide `sp` set plus far-future `se` indicates a long-lived bearer credential that enables read/list/write/delete until revoked.
86+
- Abuse a recovered SAS immediately, for example:
87+
88+
```bash
89+
az storage blob list --account-name <acc-name> --container-name <target-container> --sas-token "<sv=...&ss=...&srt=...&sp=...&se=...&sig=...>"
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.
@@ -433,6 +457,7 @@ az-file-shares.md
433457
- [https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction)
434458
- [https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview](https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview)
435459
- [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)
460+
- [Holiday Hack Challenge 2025 – Spare Key (Azure static website SAS leak)](https://0xdf.gitlab.io/holidayhack2025/act1/spare-key)
436461

437462
{{#include ../../../banners/hacktricks-training.md}}
438463

0 commit comments

Comments
 (0)