In Lab Services, you can set up a lab for a class that focuses on forensics side of ethical hacking. Penetration testing, a practice used by the ethical hacking community, occurs when someone attempts to gain access to the system or network to demonstrate vulnerabilities that a malicious attacker may exploit. Detailed steps showing how to set up this type of lab is available at Set up a lab to teach ethical hacking class.
Curious and just want to try it out? We’ve automated the steps for creating an ethical hacking lab. All the steps are written in a couple PowerShell scripts. We’ve done our best to make the commands copy and paste with just a few prompts for you.
Before we get started, you will need access to an Azure subscription and contributor access. If you don't have an Azure subscription, create a free account before you begin. We won’t be navigating the Azure Portal today; we just need a place to keep the lab account.
Okay, that’s it. Hit that Windows key, type in ‘PowerShell’ and let’s get started.
Creating the Lab
The first step to creating the Ethical Hacking lab is to create the lab itself. Copy and paste the code below into your PowerShell window.
Invoke-WebRequest "https://raw.githubusercontent.com/Azure/azure-devtestlab/master/samples/ClassroomLabs/Scripts/EthicalHacking/Create-EthicalHackingLabAccountWithPrompts.ps1" -OutFile Create-EthicalHackingLabAccountWithPrompts.ps1 ./Create-EthicalHackingLabAccountWithPrompts.ps1
You’ll be asked a couple of questions and then the script will do its job. Now we just wait for the script to complete. When the script prints 'Done!' you can move to the next section.
Modify the Template Machine
Okay, our lab is created. It’s time to modify the template machine to have all the tools we need for the class. Let’s log into our template machine and open PowerShell once again. Make sure PowerShell is running in Administrator mode this time.
We download the necessary files:
Invoke-WebRequest "https://raw.githubusercontent.com/Azure/azure-devtestlab/master/samples/ClassroomLabs/Scripts/EthicalHacking/Setup-EthicalHacking.ps1" -OutFile Setup-EthicalHacking.ps1 Invoke-WebRequest "https://raw.githubusercontent.com/Azure/azure-devtestlab/master/samples/ClassroomLabs/Scripts/HyperV/SetupForNestedVirtualization.ps1" -OutFile SetupForNestedVirtualization.ps1
Run the command below. This command may require a machine restart. Keep running the script until it displays a ‘Script completed’ message.
Run the final command for the template setup.
That’s it. Our template is ready. There are now two Hyper-V virtual machines. The first is the Kali Linux image with necessary tools. Default password is toor. The second image is the Metasploitable image with purposely built flaws. It has a default username of msfadmin and password of msfadmin.
Click the Publish button on your lab’s dashboard. Once completed, students will have access to the same virtual machine configuration as your template.
For more examples of classes that can be run with Lab Services, see Lab Services Class Types blog post.
The Lab Services Team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.