Introduction

We are going give you a introduction on how to setup your own hacking lab. Sounds crazy! right? Well it is.

Understanding the basics

What is Virtualization?

Virtualization is basically creating your own virtual based real life computer resource like servers, storage and networks.

What are Virtual Machine (VM)?

These are machines created in your own computer which have same properties as your main machine but also have some additional properties and advantages too.
Each VM runs its own operating system so you can basically have linux (VM) running on your windows pc (Main machine). It behaves as a separate machine even though it is working in your main machine.

What are Hypervisors aka Virtualization software?

VMs access hardware through Hypervisor.
Hypervisor creates virtual physical resources from borrowing physical resources from your own pc (main machine) and allocates it to the VM. So the VMs can use only the allocated physical resources( like RAM, CPU, Storage).

Installing Virtualization software

There are many Virtualization software but for todays event we would be using Oracle Virtual Box.
The installation is shown in the prerequisite of the event.

Image of a OS

What is an image of a OS?

An image is a preconfigured operating system that you can use to create VMs. You don’t have to do any configuration as everything is ready for you. To understand this we can use the analogy of cup noodles, as everything is ready for you and you just have to pour hot water for it to get ready. In the same way you just need to install it and add it to your Hypervisor without any additional setup/Configuration.

Downloading an image

An image of an operating system can be downloaded using there official website or directly from command line.
For steps on downloading an image refer to the prerequisite of the event.
Any OS image is fine but for todays event we would be using Kali Linux image file.

Importing VM into virtualization platform

Configuring Virtual box

The networking settings

While you are configuring your hypervisor, you might come across networking settings.

(Tch!)What is Networking settings?

Network settings define the connectivity between VMs (interconnectivity of VMs).

You can access this in Virtual box by clicking on `Settings`>> `Network`>> Required `Adapter X`>> Select required networking options through the drop menu from `Attached  to`>> Click on `ok`.

Understanding the two main networking options available on Virtual Box

  1. NAT (Network Address Translation) mode: It creates a isolated network for your VMs. So any other device like other pcs, phone, tablets cannot have the same IP address as your VMs. For example, consider a router with the IP address 10.10.10.190 and a main machine which has VMs with access to the internet through the router. Now if the hypervisor is in NAT mode, consider the VMs access the internet through the hypervisor that is the hypervisor acts like a router with a IP address other than 10.10.10.190 and each VM with separate private IP address. Thus, the IP address used by the VMs is completely different from the main machine and any other device.
  2. Bridged adapter mode: In this mode, a VM appears on the same network as the host machine, as if it were a separate physical device connected to the local network. So whatever devices which are connected to your switch or router can access the VMs because they now have a real IP address which is connected to the router directly. This network option helps in learning and understanding about the commands and stuff as it provides a vulnerable machine (with preexisting exploits) to practice with.

For beginners, it is suggested to use NAT mode as it creates a private network for you work with and even if you mess up somewhere, it only affects your VM and not any other device connected to the router.

WSL (Windows Subsystem for Linux)

Installing wsl

The following steps will tell you how to install wsl version 2 (latest version).

Using MS Store
Using Windows PowerShell/Command Prompt

For windows 10 and older:

wsl --install

For windows version below 10, refer here.

Installing Ubuntu

wsl --install

again to install the default Linux distribution (Ubuntu) after wsl is installed.

or

wsl

Runs the default distro (by default its ubuntu).

wsl --set-default <distribution_name>

If you have more than one linux distribution on your pc, you can set your desired distro as default using the above command.

wsl  --list --online

used to available linux distribution which can be installed for wsl.

wsl --install -d <Distribution_name>

installs the mentioned linux distribution for example

wsl --install -d Debian 

will install debian distribution.

wsl --list --verbose

lists the name of all the distributions available and their active status (Running/Stopped) along with the version of wsl on which they are installed.

wsl -t <Distribution name>

will terminate the distro session.
These are the basic commands to get you started. To know more you can refer the official documentation from microsoft website.

Note: To terminate session in wsl you can use exit command.

PS: In cybersecurity, for learning, you need a vulnerable machine which can be exploited and that is just not possible with wsl as it is a part of your system. So VMs are a much much better way to get into cybersecurity rather than wsl as you can explore/experiment/discard without risking your main machine. So while wsl acts like a subsystem of your main machine but VMs act like different machines virtually hosted on your machine.

In future sessions

Doubts

In case of any doubts/problem occurred during the setup at any step or after the setup any time, you are free to contact secuRIT on our telegram channel.
In case of any mistakes in any part of the above session please contact any of the admins of our telegram channel.

(Not) The End.

Credits: secuRIT Core :)

Edit this page