Skip to content

Commit b4f8bb0

Browse files
Merge pull request #263874 from EMaher/enewman/update-ethical-hacking
Enewman/update ethical hacking
2 parents 9604177 + 1e3b551 commit b4f8bb0

File tree

4 files changed

+68
-72
lines changed

4 files changed

+68
-72
lines changed

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

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.date: 01/24/2023
1616

1717
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.
1818

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.
2020

2121
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.
2222

@@ -33,25 +33,43 @@ This article has two main sections. The first section covers how to create the l
3333
| Lab settings | Value |
3434
| ------------ | ------------------ |
3535
| Virtual machine (VM) size | Medium (Nested Virtualization) |
36-
| VM image | Windows Server 2019 Datacenter |
36+
| VM image | Windows 11 |
3737

3838
## Template machine configuration
3939

4040
[!INCLUDE [configure template vm](./includes/lab-services-class-type-template-vm.md)]
4141

4242
To configure the template VM, complete the following three tasks:
4343

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.
4545

4646
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.
4747

4848
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.
4949

50-
You can complete these tasks in either of two ways:
50+
# [PowerShell](#tab/powershell)
5151

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
53+
54+
```powershell
55+
Invoke-WebRequest 'https://aka.ms/azlabs/scripts/hyperV-powershell' -Outfile SetupForNestedVirtualization.ps1
56+
.\SetupForNestedVirtualization.ps1
57+
```
58+
59+
### Set up nested virtual machine images
60+
61+
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:
66+
67+
```powershell
68+
Invoke-WebRequest ' https://aka.ms/azlabs/scripts/EthicalHacking-powershell' -Outfile Setup-EthicalHacking.ps1
69+
.\Setup-EthicalHacking.ps1 -SwitchName 'Default Switch'
70+
```
5371

54-
- Set up the template machine manually by completing the steps outlined below.
72+
# [Windows tools](#tab/windows)
5573

5674
### Prepare template machine for nested virtualization
5775

@@ -63,51 +81,27 @@ Kali is a Linux distribution that includes tools for penetration testing and sec
6381

6482
1. Connect to the template VM by using remote desktop.
6583

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 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.
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).
6987

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.
8089

81-
1. Create a new Hyper-V virtual machine.
82-
1. Open **Hyper-V Manager**.
83-
1. Choose **Action** -> **New** -> **Virtual Machine**.
84-
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`.
9791

9892
### Set up a nested VM with Metasploitable image
9993

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).
10195

10296
To install the Metasploitable nested VM on the template VM:
10397

10498
1. Connect to the template VM by using remote desktop.
10599

106100
1. Download the Metasploitable image.
107101
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+
109103
> [!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).
111105
112106
2. Select the **Download Metasploitable Now** button.
113107
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:
121115
1. On the **Select destination image format** page, choose **VHD/VHDX**. Select **Next**.
122116
1. On the **Select option for VHD/VHDX image format** page, choose **VHDX growable image**. Select **Next**.
123117
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.
125119

126120
1. Create a new Hyper-V virtual machine.
127121
1. Open **Hyper-V Manager**.
@@ -141,10 +135,12 @@ To install the Metasploitable nested VM on the template VM:
141135
1. On the **Settings for Metasploitable** dialog for, select **Add Hardware**.
142136
1. Select **Legacy Network Adapter**, and select **Add**.
143137
:::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**.
145139
:::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.":::
146140
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`.
147141

142+
---
143+
148144
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.
149145

150146
## Cost

0 commit comments

Comments
 (0)