Azure Virtual Machines
Enumerating of Administrative Users
abuse command execution on VM
abuse user data attached to VM
- user data
- Azure Instance Metadata Service
- not encrypted, any process on the VM can read this
- should be base64 and cannot be more than 64kb
- can be written with permission
Microsoft.Computer/virtualMachines/write
- default number of machines that a user can join to domain: 10
Get User Data:
adding custom script extension to VMs
- OMIGOD!
- custom script extension is used to run scripts on Azure VMs
- executed with SYSTEM privileges
- to update something
Microsoft.Compute/virtualMachines/extensions/write
- note: on virtual machines, get-azroleassignment might not sufficient → do direct HTTP calls
We can also use REST calls for enumeration:
{Microsoft.Compute/virtualMachines/extensions/write, Microsoft.Compute/virtualMachines/extensions/read}
Get-AzVMExtension -ResourceGroupName “Research” -VMName “infradminsrv”
Add a new Extension!