Cloud Pen-testing Part-2
## Microsoft Azure & O365 CLI Tool Cheatsheet (Part - 2)
### Virtual Machines
#### List VMs and get OS details
```powershell
Get-AzVM
$vm = Get-AzVM -Name "VM Name"
$vm.OSProfileRun commands on VMs
Invoke-AzVMRunCommand -ResourceGroupName $ResourceGroupName -VMName $VMName -CommandId RunPowerShellScript -ScriptPath ./powershell-script.ps1Networking
List virtual networks
Get-AzVirtualNetworkList public IP addresses assigned to virtual NICs
Get-AzPublicIpAddressGet Azure ExpressRoute (VPN) Info
Get-AzExpressRouteCircuitGet Azure VPN Info
Backdoors
Create a new Azure service principal as a backdoor
MSOnline PowerShell Module
Authentication
Account and Directory Information
List Company Information
List all users
List all groups
List members of a group (Global Admins in this case)
List all user attributes
List Service Principals
Az CLI Tool
Authentication
Dump Azure Key Vaults
List out any key vault resources the current account can view
With contributor level access, you can give yourself the right permissions to obtain secrets.
Get URI for Key Vault
Get cleartext secret from key vault
Metadata Service URL
Get access tokens from the metadata service
Other Azure & O365 Tools
MicroBurst
Azure security assessment tool
Last updated
Was this helpful?