These scripts will guide you to create and setup an Azure Lab Services lab that is configured to run an ethical hacking class. Part 1 of these instructions will be to create the lab plan and lab resource in Azure. Part 2 of these instructions will be to prepare the template VM instance of the newly created lab to be used by your class.
This script will help create a lab plan and lab in your Azure subscription.
To create a lab using the following instructions, you must have
- Contributor permissions on the subscription in which the lab will be created
-
Open a PowerShell window. Make sure that the window notes it is running under administrator privileges.
-
Download the
Create-EthicalHackingLabplanAndLab.ps1
PowerShell script onto your local machine:Invoke-WebRequest "https://raw.githubusercontent.com/Azure/LabServices/main/ClassTypes/PowerShell/EthicalHacking/Create-EthicalHackingLabplanAndLab.ps1" -OutFile Create-EthicalHackingLabplanAndLab.ps1
-
Run
Create-EthicalHackingLabplanAndLab.ps1
script.Install-Module 'Az' -Force Login-AzAccount ./Create-EthicalHackingLabplanAndLab.ps1 -UserName "AdminUser" -Password $(ConvertTo-SecureString "<password>" -AsPlainText -Force) -Location "centralus"
Note
Run Get-help .\Create-EthicalHackingLabplanAndLab.ps1 -Detailed
to see more information about script.
- Open the Azure Labs Services website and login with your Azure credentials to see the lab created by this script.
This script will help prepare your template virtual machine for a ethical hacking class. Script will:
- Enable Hyper-V.
- Install 7-Zip to extra Kali Linux Hyper-V disk.
- Create a Hyper-V virtual machine with a Kali Linux. Kali is a Linux distribution that includes tools for penetration testing and security auditing.
- Install Starwind V2V Converter to convert Metasploitable VMWare disk to Hyper-V disk.
- Create a Hyper-V virtual machine with a Metasploitable image is created. The Rapid7 Metasploitable image is an image purposely configured with security vulnerabilities. You'll use this image to test and find issues.
- Lab with a template VM.
- Template VM for lab has a Windows Server OS.
-
Open the Azure Labs Services website and login with your Azure credentials to see the lab created by script in Part 1.
-
Connect to template machine for your lab.
-
Download the
SetupForNestedVirtualization.ps1
andSetup-EthicalHacking.ps1
and PowerShell scripts onto the Template Virtual Machine:Invoke-WebRequest 'https://aka.ms/azlabs/scripts/hyperV-powershell' -Outfile SetupForNestedVirtualization.ps1 Invoke-WebRequest ' https://aka.ms/azlabs/scripts/EthicalHacking-powershell' -Outfile Setup-EthicalHacking.ps1
-
Open a PowerShell window. Make sure that the window notes it is running under administrator privileges.
-
Run
SetupForNestedVirtualization.ps1
. This installs the necessary features to create HyperV virtual machines..\SetupForNestedVirtualization.ps1
Note
The script may ask you to restart the machine and re-run it. A note that the script is completed will show in the PowerShell window when no further action is needed.
-
Run
Setup-EthicalHacking.ps1
If you are using Windows 10 or Windows 11, the following command:
.\Setup-EthicalHacking.ps1 -SwitchName 'Default Switch'
If you are using Windows Server, the following command.
.\Setup-EthicalHacking.ps1
Consider enabling Hyper-V DHCP guard and Router guard.
Get-VMNetworkAdapter * | Set-VMNetworkAdapter -RouterGuard On -DhcpGuard On
Warning
Use Setup-EthicalHacking.ps1 -Force
will cause any software to be installed silently. By using the Force switch you are automatically accepting the terms for the installed software.