[Thread] This is a dope post-ex tool but wanted to clear something up that can be confusing AF when it comes to Azure-related command line tools. Even the Azure Red Team gets confused at times when talking about them and we have to carefully name them when talking features. https://twitter.com/Haus3c/status/1281226642241851394
There are 5 primary command line tools you can use for Azure. The most common one you'll hear about is the Azure CLI. This tool is written in Python so when you install it, you are also installing Python on your machine. Example command:
`az login` https://github.com/Azure/azure-cli
`az login` https://github.com/Azure/azure-cli
There are FOUR primary PowerShell modules you'll hear about. First is Az PowerShell and it is the newest version. This is the one you should install when dealing with Azure resources. Cannot coexist with AzureRM.
Install-Module -Name Az
Connect-AzAccount https://github.com/Azure/azure-powershell
Install-Module -Name Az
Connect-AzAccount https://github.com/Azure/azure-powershell
Next is AzureRM. This is the older version of what Az PowerShell is. A lot of scripts are still written with this module so update if you can. Interacts with Azure resources. Last updated 2018.
Install-Module -Name AzureRm
Connect-AzureRmAccount https://www.powershellgallery.com/packages/AzureRM/6.13.1
Install-Module -Name AzureRm
Connect-AzureRmAccount https://www.powershellgallery.com/packages/AzureRM/6.13.1
For Azure Active Directory, there's the AzureAD PowerShell module. Best choice for interacting with AAD.
Install-Module -Name AzureADPreview
Connect-AzureAD
https://www.powershellgallery.com/packages/AzureADPreview/2.0.2.105
You may be asking why AzureAD Preview and not AzureAD. Well, that's because...
Install-Module -Name AzureADPreview
Connect-AzureAD
https://www.powershellgallery.com/packages/AzureADPreview/2.0.2.105
You may be asking why AzureAD Preview and not AzureAD. Well, that's because...
There is a PowerShell module called MSOnline which was used for Graph/O365. I -believe- this is being phased out in favor of AzureAD but all of the features may not exist in AzureAD module yet. Also, MSOL commands don't work in PS Core. https://www.powershellgallery.com/packages/MSOnline/1.1.166.0
Anyway, finally, there's Azure PowerShell, which sounds like it might be current but is actually used for classic resources. Want to abuse classic management certs you've found? Use Azure PowerShell, fam.
Install-Module Azure
Add-AzureAccount https://www.powershellgallery.com/packages/Azure/5.3.0
Install-Module Azure
Add-AzureAccount https://www.powershellgallery.com/packages/Azure/5.3.0
So yeah, confusing AF and because of the similarity of names, it's super easy to talk about the wrong tool. But it's also important to learn the features of each if you wanna offsec Azure properly. [/thread]
@threadreaderapp unroll