Technology and Security

Tag: Kali

installing metasploitable on hyper-v

Installing Metasploitable on Hyper-V

Metasploitable is an intentionally vulnerable Linux virtual machine that can be used to conduct security training, test security tools, and practice penetration testing. This article will look at the steps required for installing Metasploitable on Hyper-V.

Downloading Metasploitable

There are a number of versions available for download. We will be using the download available directly from Rapid7 found here. Note that you will need to register an email address before receiving the free download link.

Converting the Image

Metasploitable is packaged in a VMware format. We must first convert it to be Hyper-V compatible. As of 2022, there are a lot of online links to documentation using Microsoft Virtual Machine Converter for this task. Unfortunately, Microsoft abandoned that utility and it is no longer available. We will instead use the free StarWind Converter found here. First unzip the Metasploitable download; Then use the following options for the wizard and finally press “Convert”:

  • Local File
  • Provide Source Image
  • Local File
  • Microsoft Virtual Hard Disk (VHD/VHDX)
  • VHD Growable Image
  • Destination File
StarWind Converter
StarWind Converter

This conversion will generate an image which can be directly imported into Hyper-V in the next step.

Installing Metasploitable on Hyper-V

Following the previous section should result in an image ready to be installed.

Converted VHD Image
Converted VHD Image

In the Hyper-V application, right click and choose “Import Virtual Machines”. Use the following settings in the wizard:

  • Specify Name and Location
  • Specify Generation 1
  • Assign Memory 2048MB
  • Configure Networking: Default Switch
  • Connect Virtual Hard Disk: Choose Existing
Choose Existing VHD
Choose Existing VHD

For the last step in the wizard, select the VHD that you previously converted. Finally press “Finish” on the summary page to create the virtual machine.

Changing the VM Network Adapter

The virtual machine will start but will not connect to a network as configured by default. The setup process creates a network adapter which is not compatible with Metasploitable. To resolve this problem, open the virtual machine settings. First remove the default network adapter and then create a “Legacy Network Adapter” as seen in the images below.

Remove VM Network Adapter
Remove VM Network Adapter
Create Legacy Network Adapter
Create Legacy Network Adapter

Verifying the Metasploitable Hyper-V VM

Now that your VM is fully configured, start it from Hyper-V. Once the Linux instance has launched, the username and password are both msfadmin.

Starting MetaSploitable
Starting MetaSploitable

After login you can issue a ping to google to ensure that networking is working correctly.

Ping Google from MetaSploitable
Ping Google from MetaSploitable

Your VM is now complete and ready to hack. Rapid7 maintains an exploitation guide found here. Finally, read our guide on installing Kali Linux to build a VM for attacking Metasploitable.

updating kali linux vm 2022.1

How to Upgrade Kali Linux to 2022.1

In this brief article we will upgrade Kali Linux to release 2022.1. This upgrade demonstration is on a Hyper-V virtual machine. The steps, however, are not specific to Hyper-V VMs and will work on other platforms. Kali 2022.1 was released on Feburary 14th 2022 with the full release notes located here. If you would like to create a Kali VM on Hyper-V please follow the process documented here.

Verifying the Virtual Machine

Start by opening a terminal window. Then issue the following command:

grep VERSION /etc/os-release

As you can see below, we are running the previous release from 2021 and need to upgrade.

kali linux old version
kali linux old version

Upgrading Kali Linux to 2022.1

Start by opening a terminal window. Then issue the following commands:

$ echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" | sudo tee /etc/apt/sources.list
$ sudo apt update && sudo apt -y full-upgrade
$ cp -rbi /etc/skel/. ~
$ [ -f /var/run/reboot-required ] && sudo reboot -f

If prompted, accept and details and make sure the vm reboots at the end.

Verifying the Upgrade

Start by opening a terminal window. Then issue the following command:

grep VERSION /etc/os-release

The virtual machine’s version is now up-to-date.

kali linux upgraded version
kali linux upgraded version
Kali Hyper-V

How to Install Kali Linux on Hyper-V

This article documents the process of installing Kali Linux as a virtual machine running on a Windows 10 workstation using Hyper-V. The installation has numerous steps but most of them involve accepting default values. Rather than include all of the screenshots inline (which will become unwieldy), this article will be broken into several pages. An overview will be discussed and the full series of screenshots will be included as appendix pages.

What is Kali Linux

Kali Linux (formerly known as BackTrack Linux) is an open-source, Debian-based Linux distribution aimed at advanced Penetration Testing and Security Auditing.

Kali linux documentation

What is Hyper-V

Hyper-V is Microsoft’s hardware virtualization product. It lets you create and run a software version of a computer, called a virtual machine. Each virtual machine acts like a complete computer, running an operating system and programs. When you need computing resources, virtual machines give you more flexibility, help save time and money, and are a more efficient way to use hardware than just running one operating system on physical hardware.

microsoft hyper-v overview

Installation Overview

Installing Kali Linux on a Windows 10 workstation using Hyper-V involves the following steps:

  • Download the Kali Linux ISO image
  • Configure a new Hyper-V Virtual Machine
  • Install and Configure Kali Linux Operating System
  • Login to the Kali Linux VM

Downloading Kali Linux

Kali Linux is an open-source Linux distribution that has several installation options. For our purposes, we will be pulling the ISO image of the most recent stable build from the Kali Linux Download page.

There are several preconfigured virtual machines provided by Kali, but unfortunately Hyper-V is not one of them. We will instead select the recommended option for the “Bare Metal” installer.

download kali linux bare metal option
Download Kali Linux Bare Metal Option

Configure a new Hyper-V Virtual Machine

We assume you already have Hyper-V installed and running on your workstation. If not, please follow the Microsoft documentation for enabling the software.

Run the Hyper-V application, then right-click your workstation and select “New | Virtual Machine.”

create new hyper-v vm
Creating a new Hyper-V VM

You must complete several screens of options in order to configure the VM. Several steps worth noting include:

  • Assign Memory: change the default from 1024 to 2048
  • Connect Virtual Hard Disk: default is too large, 20GB is more than adequate for a starter Linux VM
  • Installation Options: configure to use the downloaded ISO image

There is a full listing of screenshots included in the Hyper-V Screenshot Appendix. After creating the VM by pressing Finish, you can begin the Kali Linux installation.

Install and Configure Kali Linux

Right-click on the newly created VM and select Connect:

connecting to a kali linux vm using hyper-v
Connecting to a Kali Linux VM using Hyper-V

There are almost two dozen configuration screens for the OS installation. Fortunately most of the steps can use default values. There is a full listing of screenshots included in the Kali Linux Screenshot Appendix. Fill out each configuration page and make sure to remember your username and password.

Login to the Kali Linux VM

After the last battery of questions, the VM will reboot itself and be ready for use with the login credentials you provided during setup.

Kali Linux Login Screen
Kali Linux Login Screen

Enter the username and password to login to the desktop:

Kali Linux Desktop
Kali Linux Desktop

Note that the initial user is an account with root user privileges. To verify this, open a terminal window and sudo up:

Kali Linux Root User
Kali Linux Root User

At this point your Kali Linux VM is complete. See the following pages for a complete listing of screenshots from the installation process. Note that you must be in the full-page mode for this article to see the additional pages.

Powered by WordPress & Theme by Anders Norén