Beginners Guide To Pentesting Azure

22 Mar 2021, 1:10 p.m.
01:46 minutes

This article serves as an introduction to Azure penetration testing

    Beginners Guide To Pentesting Azure

    Let us start by installing the Azure Active Directory PowerShell Modules.

    Install-Module AzureAD
    

    Beginners Guide To Pentesting Azure

    With the module installed we can now run the following from the command line to list all the available commands.

    get-command -Module AzureAD
    

    If we look down the list we can see a command for connecting to Azure

    Connecting to Azure

    Connect-AzureAD
    

    A pop-up should appear asking you to authenticate

    If you get the following error after trying to connect then you are possibly using PowerShell Core.

    Connect-AzureAD: One or more errors occurred. (Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.): Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Connect-AzureAD: One or more errors occurred. (Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.) Connect-AzureAD: Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Connect-AzureAD: One or more errors occurred. (Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.): Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    If you are able to successfully connect you will see a returned table showing your:

    • Account
    • Environment,
    • Tenant ID
    • Tenant Domain
    • Account Type

    What if you want to run cmdlets against a different Tennant.

    Connect-AzureAD -Tenant <Tenant ID>
    

    Where can I find the Tenant ID I hear you say?

    Getting the Tenant ID Via The Portal

    Captcha: What's the standard TCP port of the following service?

    captcha

    0 comments