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
+36-40Lines changed: 36 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ ms.date: 01/24/2023
16
16
17
17
This article shows you how to set up a class that focuses on the forensics side of ethical hacking with Azure Lab Services. In an ethical hacking class, students can learn modern techniques for defending against vulnerabilities. Penetration testing, a practice that the ethical hacking community uses, occurs when someone attempts to gain access to the system or network to demonstrate vulnerabilities that a malicious attacker may exploit.
18
18
19
-
Each student gets a Windows Server host virtual machine (VM) that has two nested virtual machines: one VM with [Metasploitable3](https://github.com/rapid7/metasploitable3) image and another VM with the [Kali Linux](https://www.kali.org/) image. You use the Metasploitable VM for exploiting purposes. The Kali VM provides access to the tools you need to execute forensic tasks.
19
+
Each student gets a Windows host virtual machine (VM) that has two nested virtual machines: one VM with [Metasploitable3](https://github.com/rapid7/metasploitable3) image and another VM with the [Kali Linux](https://www.kali.org/) image. You use the Metasploitable VM for exploiting purposes. The Kali VM provides access to the tools you need to execute forensic tasks.
20
20
21
21
This article has two main sections. The first section covers how to create the 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.
22
22
@@ -33,25 +33,43 @@ This article has two main sections. The first section covers how to create the l
33
33
| Lab settings | Value |
34
34
| ------------ | ------------------ |
35
35
| Virtual machine (VM) size | Medium (Nested Virtualization) |
To configure the template VM, complete the following three tasks:
43
43
44
-
1. Set up the machine for nested virtualization. You enable all the appropriate windows features, like Hyper-V, and set up the networking for the Hyper-V images to be able to communicate with each other and the internet.
44
+
1. Set up the machine for nested virtualization. You enable all the appropriate windows features, like Hyper-V.
45
45
46
46
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.
47
47
48
48
3. Set up the Metasploitable image. For this example, you use the [Metasploitable3](https://github.com/rapid7/metasploitable3) image. This image is created to purposely have security vulnerabilities.
49
49
50
-
You can complete these tasks in either of two ways:
50
+
# [PowerShell](#tab/powershell)
51
51
52
-
- Run the following PowerShell scripts on the template machine: [Lab Services Hyper-V Script](https://aka.ms/azlabs/scripts/hyperV) and [Lab Services Ethical Hacking Script](https://aka.ms/azlabs/scripts/EthicalHacking). Once the scripts have completed, continue to the [Next steps](#next-steps).
52
+
### Prepare template machine for nested virtualization
Kali is a Linux distribution that includes tools for penetration testing and security auditing.
62
+
63
+
The Rapid7 Metasploitable image is an image purposely configured with security vulnerabilities. You use this image to test and find issues. The following instructions show you how to use a precreated Metasploitable image. However, if a newer version of the Metasploitable image is needed, see [https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
64
+
65
+
To install Kali Linux and Metasploitable on the template VM, run the following command:
- Set up the template machine manually by completing the steps outlined below.
72
+
# [Windows tools](#tab/windows)
55
73
56
74
### Prepare template machine for nested virtualization
57
75
@@ -63,51 +81,27 @@ Kali is a Linux distribution that includes tools for penetration testing and sec
63
81
64
82
1. Connect to the template VM by using remote desktop.
65
83
66
-
1. Download the 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.
67
-
1. Download the **Kali Linux VMware 64-Bit (7z)** image for VMware.
68
-
1. Extract the .7z file. If you don’t already have 7zip, 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.
84
+
1. Download the image from [Offensive Security Kali Linux VM images](https://www.kali.org/get-kali/#kali-virtual-machines). Remember the default username and password are noted on the download page.
85
+
1. Download the **Kali Linux Hyper-V 64-Bit (7z)** image for Hyper-V.
86
+
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).
69
87
70
-
1. Convert the extracted vmdk file to a Hyper-V vhdx file with StarWind V2V Converter.
71
-
1. Download and install [StarWind V2V Converter](https://www.starwindsoftware.com/starwind-v2v-converter#download).
72
-
1. Start **StarWind V2V Converter**.
73
-
1. On the **Select location of image to convert** page, choose **Local file**. Select **Next**.
74
-
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**.
75
-
1. On the **Select location of destination image**, choose **Local file**. Select **Next**.
76
-
1. On the **Select destination image format** page, choose **VHD/VHDX**. Select **Next**.
77
-
1. On the **Select option for VHD/VHDX image format** page, choose **VHDX growable image**. Select **Next**.
78
-
1. On the **Select destination file name** page, accept the default file name. Select **Convert**.
79
-
1. On the **Converting** page, wait for the image to be converted. Conversion may take several minutes. Select **Finish** when the conversion is completed.
88
+
1. Follow the instructions to [import premade Kali Linux image(https://www.kali.org/docs/virtualization/import-premade-hyperv/) into Hyper-V.
1. On the **Before You Begin** page of the **New Virtual Machine Wizard**, select **Next**.
85
-
1. On the **Specify Name and Location** page, enter **Kali-Linux** for the **name**, and select **Next**.
86
-
1. On the **Specify Generation** page, accept the defaults, and select **Next**.
87
-
1. On the **Assign Memory** page, enter **2048 MB** for the **startup memory**, and select **Next**.
88
-
1. On the **Configure Networking** page, leave the connection as **Not Connected**. You'll set up the network adapter later.
89
-
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.vhdk** file created in the previous step, and select **Next**.
90
-
1. On the **Completing the New Virtual Machine Wizard** page, and select **Finish**.
91
-
1. Once the virtual machine is created, select it in the Hyper-V Manager. Don't turn on the machine yet.
92
-
1. Choose **Action** -> **Settings**.
93
-
1. On the **Settings for Kali-Linux** dialog for, select **Add Hardware**.
94
-
1. Select **Legacy Network Adapter**, and select **Add**.
95
-
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.
96
-
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`.
90
+
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`.
97
91
98
92
### Set up a nested VM with Metasploitable image
99
93
100
-
The Rapid7 Metasploitable image is an image purposely configured with security vulnerabilities. You 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).
94
+
The Rapid7 Metasploitable image is an image purposely configured with security vulnerabilities. You use this image to test and find issues. The following instructions show you how to use a precreated Metasploitable image. However, if a newer version of the Metasploitable image is needed, see [https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
101
95
102
96
To install the Metasploitable nested VM on the template VM:
103
97
104
98
1. Connect to the template VM by using remote desktop.
105
99
106
100
1. Download the Metasploitable image.
107
101
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.
108
-
102
+
109
103
> [!NOTE]
110
-
> You can check for newer versions of the Metasploitable image on[https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
104
+
> You can check for newer versions of the Metasploitable image at[https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
111
105
112
106
2. Select the **Download Metasploitable Now** button.
113
107
3. When the download finishes, extract the zip file, and remember the location of the *Metasploitable.vmdk* file.
@@ -121,7 +115,7 @@ To install the Metasploitable nested VM on the template VM:
121
115
1. On the **Select destination image format** page, choose **VHD/VHDX**. Select **Next**.
122
116
1. On the **Select option for VHD/VHDX image format** page, choose **VHDX growable image**. Select **Next**.
123
117
1. On the **Select destination file name** page, accept the default file name. Select **Convert**.
124
-
1. On the **Converting** page, wait for the image to be converted. Conversion may take several minutes. Select **Finish** when the conversion is completed.
118
+
1. On the **Converting** page, wait for the image to be converted. Conversion can take several minutes. Select **Finish** when the conversion is completed.
125
119
126
120
1. Create a new Hyper-V virtual machine.
127
121
1. Open **Hyper-V Manager**.
@@ -141,10 +135,12 @@ To install the Metasploitable nested VM on the template VM:
141
135
1. On the **Settings for Metasploitable** dialog for, select **Add Hardware**.
142
136
1. Select **Legacy Network Adapter**, and select **Add**.
143
137
:::image type="content" source="./media/class-type-ethical-hacking/network-adapter-page.png" alt-text="Screenshot of settings dialog for Hyper V VM.":::
144
-
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.
138
+
1. On the **Legacy Network Adapter** page, select **Default Switch** for the **Virtual Switch** setting, and select **OK**.
145
139
:::image type="content" source="./media/class-type-ethical-hacking/legacy-network-adapter-page.png" alt-text="Screenshot of Legacy Network adapter settings page for Hyper V VM.":::
146
140
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`.
147
141
142
+
---
143
+
148
144
The template is now updated and has the nested VM 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. You can now [publish the template VM](how-to-create-manage-template.md#publish-the-template-vm) to the class.
0 commit comments