You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/lab-services/class-type-ethical-hacking.md
+56-46Lines changed: 56 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -5,71 +5,80 @@ ms.topic: article
5
5
ms.date: 06/26/2020
6
6
---
7
7
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.
10
11
11
12
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.
12
13
13
14
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.
14
15
15
16
## Lab configuration
17
+
16
18
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).
17
19
18
20
Follow [this tutorial](tutorial-setup-classroom-lab.md) to create a new lab and then apply the following settings:
19
21
20
22
| Virtual machine size | Image |
21
-
| -------------------- | ----- |
23
+
| -------------------- | ----- |
22
24
| Medium (Nested Virtualization) | Windows Server 2019 Datacenter |
23
25
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.
25
29
26
-
After the template machine is created, start the machine and connect to it to complete the following three major tasks.
27
-
28
30
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.
29
31
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.
30
32
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.
31
33
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).
33
35
34
36
### 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.
36
39
37
40
### Set up a nested virtual machine with Kali Linux Image
41
+
38
42
Kali is a Linux distribution that includes tools for penetration testing and security auditing.
39
43
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 64Bit** 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.
42
46
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.
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**.
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.
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**.
64
72
65
73
## Set up a nested VM with Metasploitable Image
74
+
66
75
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).
67
76
68
77
1. Download the Metasploitable image.
69
78
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.
70
79
2. Select the **Download Metasploitable Now** button.
71
80
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).
73
82
1. Start **StarWind V2V Converter**.
74
83
1. On the **Select location of image to convert** page, choose **Local file**. Select **Next**.
75
84
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
86
95
87
96

88
97
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**.
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**.
94
103
95
104

96
105
1. On the **Completing the New Virtual Machine Wizard** page, and select **Finish**.
97
106
1. Once the virtual machine is created, select it in the Hyper-V Manager. Don't turn on the machine yet.
98
107
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**.
100
109
1. Select **Legacy Network Adapter**, and select **Add**.
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.
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**.
108
116
109
117
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
-
111
118
112
119
## 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:
116
120
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:
118
124
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/).
120
129
121
130
## Conclusion
131
+
122
132
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.
0 commit comments