Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 52bd116

Browse files
committedDec 16, 2020
Updating instructions to use latest Kali Linux.
1 parent 70fba50 commit 52bd116

File tree

5 files changed

+56
-46
lines changed

5 files changed

+56
-46
lines changed
 

‎articles/lab-services/class-type-ethical-hacking.md

Lines changed: 56 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,80 @@ ms.topic: article
55
ms.date: 06/26/2020
66
---
77

8-
# Set up a lab to teach ethical hacking class
9-
This article shows you how to set up 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.
8+
# Set up a lab to teach ethical hacking class
9+
10+
This article shows you how to set up 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.
1011

1112
In an ethical hacking class, students can learn modern techniques for defending against vulnerabilities. Each student gets a Windows Server host virtual machine that has two nested virtual machines – one virtual machine with [Metasploitable3](https://github.com/rapid7/metasploitable3) image and another machine with [Kali Linux](https://www.kali.org/) image. The Metasploitable virtual machine is used for exploiting purposes and Kali virtual machine provides access to the tools needed to execute forensic tasks.
1213

1314
This article has two main sections. The first section covers how to create the classroom lab. The second section covers how to create the template machine with nested virtualization enabled and with the tools and images needed. In this case, a Metasploitable image and a Kali Linux image on a machine that has Hyper-V enabled to host the images.
1415

1516
## Lab configuration
17+
1618
To set up this lab, you need an Azure subscription to get started. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/) before you begin. Once you get an Azure subscription, you can either create a new lab account in Azure Lab Services or use an existing account. See the following tutorial for creating a new lab account: [Tutorial to setup a lab account](tutorial-setup-lab-account.md).
1719

1820
Follow [this tutorial](tutorial-setup-classroom-lab.md) to create a new lab and then apply the following settings:
1921

2022
| Virtual machine size | Image |
21-
| -------------------- | ----- |
23+
| -------------------- | ----- |
2224
| Medium (Nested Virtualization) | Windows Server 2019 Datacenter |
2325

24-
## Template machine
26+
## Template machine
27+
28+
After the template machine is created, start the machine and connect to it to complete the following three major tasks.
2529

26-
After the template machine is created, start the machine and connect to it to complete the following three major tasks.
27-
2830
1. Set up the machine for nested virtualization. It enables all the appropriate windows features, like Hyper-V, and sets up the networking for the Hyper-V images to be able to communicate with each other and the internet.
2931
2. Set up the [Kali](https://www.kali.org/) Linux image. Kali is a Linux distribution that includes tools for penetration testing and security auditing.
3032
3. Set up the Metasploitable image. For this example, the [Metasploitable3](https://github.com/rapid7/metasploitable3) image will be used. This image is created to purposely have security vulnerabilities.
3133

32-
A script that automates the tasks outlined above is available at [Lab Services Ethical Hacking Scripts](https://github.com/Azure/azure-devtestlab/tree/master/samples/ClassroomLabs/Scripts/EthicalHacking).
34+
The rest of this article will cover the manual steps to completing the tasks above. Alternatively, you can run the [Lab Services Hyper-V Scripts](https://github.com/Azure/azure-devtestlab/tree/master/samples/ClassroomLabs/Scripts/HyperV) and [Lab Services Ethical Hacking Scripts](https://github.com/Azure/azure-devtestlab/tree/master/samples/ClassroomLabs/Scripts/EthicalHacking).
3335

3436
### Prepare template machine for nested virtualization
35-
Follow instructions in [this article](how-to-enable-nested-virtualization-template-vm.md) to prepare your template virtual machine for nested virtualization.
37+
38+
Follow instructions to [enable nested virtualization](how-to-enable-nested-virtualization-template-vm.md) to prepare your template virtual machine for nested virtualization.
3639

3740
### Set up a nested virtual machine with Kali Linux Image
41+
3842
Kali is a Linux distribution that includes tools for penetration testing and security auditing.
3943

40-
1. Download image from [https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-download/](https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-download/).
41-
1. Download the **Kali Linux Hyper-V 64 Bit** for Hyper-V.
44+
1. Download image from [Offensive Security Kali Linux VM images](https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-download/). Remember the default username and password noted on the download page.
45+
1. Download the **Kali Linux VMware 64-Bit (7z)** image for VMware.
4246
1. Extract the .7z file. If you don’t already have 7 zip, download it from [https://www.7-zip.org/download.html](https://www.7-zip.org/download.html). Remember the location of the extracted folder as you'll need it later.
43-
2. Open **Hyper-V Manager** from Administrative Tools.
44-
1. Select **Action**, and then select **Import Virtual Machine**.
45-
1. On the **Locate Folder** page of the **Import Virtual Machine** wizard, choose the location of the extracted folder that holds the Kali Linux image.
46-
47-
![Locate Folder dialog](./media/class-type-ethical-hacking/locate-folder.png)
48-
1. On the **Select Virtual Machine** page, select the Kali Linux image. In this case, the image is **kali-linux-2019.3-hyperv**.
49-
50-
![Select Kali image](./media/class-type-ethical-hacking/select-kali-image.png)
51-
1. On the **Choose Import Type** page, select **Copy the virtual machine (create a new unique ID)**.
52-
53-
![Choose import type](./media/class-type-ethical-hacking/choose-import-type.png)
54-
1. Accept the default settings on **Choose Folders for Virtual Machine Files** and **Choose Folders to Store Virtual Hard Disks** pages, and then select **Next**.
55-
1. On the **Connect Network** page, choose **LabServicesSwitch** created earlier in the **Prepare Template for Nested Virtualization** section of this article, and then select **Next**.
56-
57-
![Connect network page](./media/class-type-ethical-hacking/connect-network.png)
58-
1. Select **Finish** on the **Summary** page. Wait until copy and importing operations are completed. The Kali Linux virtual machine will now be available in Hyper-V.
59-
1. From **Hyper-V Manager**, choose **Action** -> **Start**, then choose **Action** -> **Connect** to connect to the virtual machine.
60-
12. The default username is `root` and the password is `toor`.
61-
62-
> [!NOTE]
63-
> If you need to unlock the image, press the CTRL key and drag the mouse upwards.
47+
1. Convert the extracted vmdk file to a vhdx file so that you can use the vhdx file with Hyper-V. There are several tools available to convert VMware images to Hyper-V images. We'll be using the [StarWind V2V Converter](https://www.starwindsoftware.com/starwind-v2v-converter). To download, see [StarWind V2V Converter download page](https://www.starwindsoftware.com/starwind-v2v-converter#download).
48+
1. Start **StarWind V2V Converter**.
49+
1. On the **Select location of image to convert** page, choose **Local file**. Select **Next**.
50+
1. On the **Source image** page, navigate to and select the Kali Linux vmdk file extracted in the previous step for the **File name** setting. The file will be in the format Kali-Linux-{version}-vmware-amd64.vmdk. Select **Next**.
51+
1. On the **Select location of destination image**, choose **Local file**. Select **Next**.
52+
1. On the **Select destination image format** page, choose **VHD/VHDX**. Select **Next**.
53+
1. On the **Select option for VHD/VHDX image format** page, choose **VHDX growable image**. Select **Next**.
54+
1. On the **Select destination file name** page, accept the default file name. Select **Convert**.
55+
1. On the **Converting** page, wait for the image to be converted. This may take several minutes. Select **Finish** when the conversion is completed.
56+
1. Create a new Hyper-V virtual machine.
57+
1. Open **Hyper-V Manager**.
58+
1. Choose **Action** -> **New** -> **Virtual Machine**.
59+
1. On the **Before You Begin** page of the **New Virtual Machine Wizard**, select **Next**.
60+
1. On the **Specify Name and Location** page, enter **Kali-Linux** for the **name**, and select **Next**.
61+
1. On the **Specify Generation** page, accept the defaults, and select **Next**.
62+
1. On the **Assign Memory** page, enter **2048 MB** for the **startup memory**, and select **Next**.
63+
1. On the **Configure Networking** page, leave the connection as **Not Connected**. You'll set up the network adapter later.
64+
1. On the **Connect Virtual Hard Disk** page, select **Use an existing virtual hard disk**. Browse to the location for the **Kali-Linux-{version}-vmware-amd64.vmdk** file created in the previous step, and select **Next**.
65+
1. On the **Completing the New Virtual Machine Wizard** page, and select **Finish**.
66+
1. Once the virtual machine is created, select it in the Hyper-V Manager. Don't turn on the machine yet.
67+
1. Choose **Action** -> **Settings**.
68+
1. On the **Settings for Kali-Linux** dialog for, select **Add Hardware**.
69+
1. Select **Legacy Network Adapter**, and select **Add**.
70+
1. On the **Legacy Network Adapter** page, select **LabServicesSwitch** for the **Virtual Switch** setting, and select **OK**. LabServicesSwitch was created when preparing the template machine for Hyper-V in the **Prepare Template for Nested Virtualization** section.
71+
1. The Kali-Linux image is now ready for use. From **Hyper-V Manager**, choose **Action** -> **Start**, then choose **Action** -> **Connect** to connect to the virtual machine. The default username is **kali** and the password is **kali**.
6472

6573
## Set up a nested VM with Metasploitable Image
74+
6675
The Rapid7 Metasploitable image is an image purposely configured with security vulnerabilities. You'll use this image to test and find issues. The following instructions show you how to use a pre-created Metasploitable image. However, if a newer version of the Metasploitable image is needed, see [https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
6776

6877
1. Download the Metasploitable image.
6978
1. Navigate to [https://information.rapid7.com/download-metasploitable-2017.html](https://information.rapid7.com/download-metasploitable-2017.html). Fill out the form to download the image and select the **Submit** button.
7079
2. Select the **Download Metasploitable Now** button.
7180
3. When the zip file is downloaded, extract the zip file, and remember the location of the Metasploitable.vmdk file.
72-
1. Convert the extracted vmdk file to a vhdx file so that you can use the vhdx file with Hyper-V. There are several tools available to convert VMware images to Hyper-V images and vice versa. We'll be using the [StarWind V2V Converter](https://www.starwindsoftware.com/starwind-v2v-converter). To download, see [StarWind V2V Converter download page](https://www.starwindsoftware.com/starwind-v2v-converter#download).
81+
1. Convert the extracted vmdk file to a vhdx file so that you can use the vhdx file with Hyper-V. There are several tools available to convert VMware images to Hyper-V images. We'll be using the [StarWind V2V Converter](https://www.starwindsoftware.com/starwind-v2v-converter) again. To download, see [StarWind V2V Converter download page](https://www.starwindsoftware.com/starwind-v2v-converter#download).
7382
1. Start **StarWind V2V Converter**.
7483
1. On the **Select location of image to convert** page, choose **Local file**. Select **Next**.
7584
1. On the **Source image** page, navigate to and select the Metasploitable.vmdk extracted in the previous step for the **File name** setting. Select **Next**.
@@ -86,46 +95,47 @@ The Rapid7 Metasploitable image is an image purposely configured with security v
8695

8796
![New VM image wizard](./media/class-type-ethical-hacking/new-vm-wizard-1.png)
8897
1. On the **Specify Generation** page, accept the defaults, and select **Next**.
89-
1. On the **Assign Memory** page, enter **512 MB** for the **startup memory**, and select **Next**.
98+
1. On the **Assign Memory** page, enter **512 MB** for the **startup memory**, and select **Next**.
9099

91100
![Assign memory page](./media/class-type-ethical-hacking/assign-memory-page.png)
92101
1. On the **Configure Networking** page, leave the connection as **Not Connected**. You'll set up the network adapter later.
93-
1. On the **Connect Virtual Hard Disk** page, select **Use an existing virtual hard disk**. Browse to the location for the **metasploitable.vhdx** file created in the previous step, and select **Next**.
102+
1. On the **Connect Virtual Hard Disk** page, select **Use an existing virtual hard disk**. Browse to the location for the **metasploitable.vhdx** file created in the previous step, and select **Next**.
94103

95104
![Connect virtual network disk page](./media/class-type-ethical-hacking/connect-virtual-network-disk.png)
96105
1. On the **Completing the New Virtual Machine Wizard** page, and select **Finish**.
97106
1. Once the virtual machine is created, select it in the Hyper-V Manager. Don't turn on the machine yet.
98107
1. Choose **Action** -> **Settings**.
99-
1. On the **Settings for Metasploitable** dialog for, select **Add Hardware**.
108+
1. On the **Settings for Metasploitable** dialog for, select **Add Hardware**.
100109
1. Select **Legacy Network Adapter**, and select **Add**.
101110

102111
![Network adapter page](./media/class-type-ethical-hacking/network-adapter-page.png)
103112
1. On the **Legacy Network Adapter** page, select **LabServicesSwitch** for the **Virtual Switch** setting, and select **OK**. LabServicesSwitch was created when preparing the template machine for Hyper-V in the **Prepare Template for Nested Virtualization** section.
104113

105114
![Legacy Network adapter page](./media/class-type-ethical-hacking/legacy-network-adapter-page.png)
106-
1. The Metasploitable image is now ready for use. From **Hyper-V Manager**, choose **Action** -> **Start**, then choose **Action** -> **Connect** to connect to the virtual machine. The default username is **msfadmin** and the password is **msfadmin**.
107-
115+
1. The Metasploitable image is now ready for use. From **Hyper-V Manager**, choose **Action** -> **Start**, then choose **Action** -> **Connect** to connect to the virtual machine. The default username is **msfadmin** and the password is **msfadmin**.
108116

109117
The template is now updated and has images needed for an ethical hacking penetration testing class, an image with tools to do the penetration testing and another image with security vulnerabilities to discover. The template image can now be published to the class. Select the **Publish** button on template page to publish the template to the lab.
110-
111118

112119
## Cost
113-
If you would like to estimate the cost of this lab, you can use the following example:
114-
115-
For a class of 25 students with 20 hours of scheduled class time and 10 hours of quota for homework or assignments, the price for the lab would be:
116120

117-
25 students * (20 + 10) hours * 55 Lab Units * 0.01 USD per hour = 412.50 USD.
121+
If you would like to estimate the cost of this lab, you can use the following example:
122+
123+
For a class of 25 students with 20 hours of scheduled class time and 10 hours of quota for homework or assignments, the price for the lab would be:
118124

119-
For more information on pricing, see [Azure Lab Services Pricing](https://azure.microsoft.com/pricing/details/lab-services/).
125+
25 students \* (20 + 10) hours \* 55 Lab Units \* 0.01 USD per hour = 412.50 USD
126+
127+
>[!IMPORTANT]
128+
>Cost estimate is for example purposes only. For current details on pricing, see [Azure Lab Services Pricing](https://azure.microsoft.com/pricing/details/lab-services/).
120129
121130
## Conclusion
131+
122132
This article walked you through the steps to create a lab for ethical hacking class. It includes steps to set up nested virtualization for creating two virtual machines inside the host virtual machine for penetrating testing.
123133

124134
## Next steps
135+
125136
Next steps are common to setting up any lab:
126137

127138
- [Add users](tutorial-setup-classroom-lab.md#add-users-to-the-lab)
128139
- [Set quota](how-to-configure-student-usage.md#set-quotas-for-users)
129-
- [Set a schedule](tutorial-setup-classroom-lab.md#set-a-schedule-for-the-lab)
130-
- [Email registration links to students](how-to-configure-student-usage.md#send-invitations-to-users).
131-
140+
- [Set a schedule](tutorial-setup-classroom-lab.md#set-a-schedule-for-the-lab)
141+
- [Email registration links to students](how-to-configure-student-usage.md#send-invitations-to-users).
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.