Az - File Shares
Tip
Leer & oefen AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Leer & oefen GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Leer & oefen Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Ondersteun HackTricks
- Kyk na die subscription plans!
- Sluit aan by die đŹ Discord group of die telegram group of volg ons op Twitter đŠ @hacktricks_live.
- Deel hacking tricks deur PRs in te dien by die HackTricks en HackTricks Cloud github repos.
Basiese Inligting
Azure Files is ân volledig bestuurde wolk lĂȘeropbergingsdiens wat gedeelde lĂȘeropberging bied wat toeganklik is via standaard SMB (Server Message Block) en NFS (Network File System) protokolle. Alhoewel die hoof protokol wat gebruik word SMB is, word NFS Azure lĂȘer deel nie ondersteun vir Windows (volgens die docs). Dit stel jou in staat om hoogs beskikbare netwerk lĂȘer dele te skep wat gelyktydig deur verskeie virtuele masjiene (VMs) of plaaslike stelsels toeganklik gemaak kan word, wat naatlose lĂȘerdeling oor omgewings moontlik maak.
Toegang Lae
- Transaksie Geoptimaliseer: Geoptimaliseer vir transaksie-sware operasies.
- Warm: Gebalanseerd tussen transaksies en stoor.
- Koel: Kostedoeltreffend vir stoor.
- Premium: HoĂ«-prestasie lĂȘeropberging geoptimaliseer vir lae-latensie en IOPS-intensiewe werklas.
Rugsteun
- Daaglikse rugsteun: ân Rugsteunpunt word elke dag op ân aangeduide tyd (bv. 19.30 UTC) geskep en gestoor vir 1 tot 200 dae.
- Weeklikse rugsteun: ân Rugsteunpunt word elke week op ân aangeduide dag en tyd (Sondag om 19.30) geskep en gestoor vir 1 tot 200 weke.
- Maandelikse rugsteun: ân Rugsteunpunt word elke maand op ân aangeduide dag en tyd (bv. eerste Sondag om 19.30) geskep en gestoor vir 1 tot 120 maande.
- Jaarlikse rugsteun: ân Rugsteunpunt word elke jaar op ân aangeduide dag en tyd (bv. Januarie eerste Sondag om 19.30) geskep en gestoor vir 1 tot 10 jaar.
- Dit is ook moontlik om handmatige rugsteun en snappshots op enige tyd uit te voer. Rugsteun en snappshots is eintlik dieselfde in hierdie konteks.
Gesteunde Outentikasies via SMB
- Plaaslike AD DS Outentikasie: Dit gebruik plaaslike Active Directory akrediteerlinge wat gesinkroniseer is met Microsoft Entra ID vir identiteitsgebaseerde toegang. Dit vereis netwerkverbinding met plaaslike AD DS.
- Microsoft Entra Domein Dienste Outentikasie: Dit benut Microsoft Entra Domein Dienste (wolk-gebaseerde AD) om toegang te bied met Microsoft Entra akrediteerlinge.
- Microsoft Entra Kerberos vir Hibrid Identiteite: Dit stel Microsoft Entra gebruikers in staat om Azure lĂȘer dele oor die internet te outentiseer met behulp van Kerberos. Dit ondersteun hibrid Microsoft Entra-verbonden of Microsoft Entra-verbonden VMs sonder om verbinding met plaaslike domeinbeheerders te vereis. Maar dit ondersteun nie wolk-slegs identiteite nie.
- AD Kerberos Outentikasie vir Linux Kliënte: Dit stel Linux kliënte in staat om Kerberos te gebruik vir SMB outentikasie via plaaslike AD DS of Microsoft Entra Domein Dienste.
Enumerasie
# Get storage accounts
az storage account list #Get the account name from here
# List file shares
az storage share list --account-name <name>
az storage share-rm list --storage-account <name> # To see the deleted ones too --include-deleted
# Get dirs/files inside the share
az storage file list --account-name <name> --share-name <share-name>
## If type is "dir", you can continue enumerating files inside of it
az storage file list --account-name <name> --share-name <prev_dir/share-name>
# Download a complete share (with directories and files inside of them)
az storage file download-batch -d . --source <share-name> --account-name <name>
# List snapshots
az storage share snapshot --name <share-name>
# List file shares, including deleted ones
az rest --method GET \
--url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{storageAccountName}/fileServices/default/shares?%24skipToken=&%24maxpagesize=20&%24filter=&%24expand=deleted&api-version=2019-06-01"
# Get snapshots/backups
az storage share list --account-name <name> --include-snapshots --query "[?snapshot != null]"
# List contents of a snapshot/backup
az storage file list --account-name <name> --share-name <share-name> --snapshot <snapshot-version> #e.g. "2024-11-25T11:26:59.0000000Z"
# Download snapshot/backup
az storage file download-batch -d . --account-name <name> --source <share-name> --snapshot <snapshot-version>
Note
Standaard sal
azcli ân rekening sleutel gebruik om ân sleutel te teken en die aksie uit te voer. Om die Entra ID hoofprivileges te gebruik, gebruik die parameters--auth-mode login --enable-file-backup-request-intent.
Tip
Gebruik die param
--account-keyom die rekening sleutel aan te dui wat gebruik moet word
Gebruik die param--sas-tokenmet die SAS-token om toegang te verkry via ân SAS-token
Verbinding
Dit is die skripte wat deur Azure voorgestel is ten tyde van die skryf om ân File Share te verbind:
Jy moet die <STORAGE-ACCOUNT>, <ACCESS-KEY> en <FILE-SHARE-NAME> plekhouers vervang.
$connectTestResult = Test-NetConnection -ComputerName filescontainersrdtfgvhb.file.core.windows.net -Port 445
if ($connectTestResult.TcpTestSucceeded) {
# Save the password so the drive will persist on reboot
cmd.exe /C "cmdkey /add:`"<STORAGE-ACCOUNT>.file.core.windows.net`" /user:`"localhost\<STORAGE-ACCOUNT>`" /pass:`"<ACCESS-KEY>`""
# Mount the drive
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\<STORAGE-ACCOUNT>.file.core.windows.net\<FILE-SHARE-NAME>" -Persist
} else {
Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
}
Gereelde stooropsporing (toegang sleutels, SASâŠ)
Privilege Escalation
Dieselfde as stoor privesc:
Post Exploitation
Az - File Share Post Exploitation
Persistensie
Dieselfde as stoor persistensie:
Tip
Leer & oefen AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Leer & oefen GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Leer & oefen Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Ondersteun HackTricks
- Kyk na die subscription plans!
- Sluit aan by die đŹ Discord group of die telegram group of volg ons op Twitter đŠ @hacktricks_live.
- Deel hacking tricks deur PRs in te dien by die HackTricks en HackTricks Cloud github repos.
HackTricks Cloud

