You are on page 1of 14

CET324 - Lab session 9

In this lab session you will be guided to set a virtual machine with necessary tools for future
exercises.

Follow the step by step guides to set up a virtual machine on your personal computer.

1. Downloading VMware

download and install a desktop VMware product. VMware Player is available free for personal use
for
Microsoft Windows and Linux operating systems (http://www.vmware.com/products/player/).
VMware also offers VMware Workstation (http://www.vmware.com/products/workstation/) for
Windows and Linux. Do not use VMware workstation because it is not for free; you can only use for
free for 30 days.

Make sure you download the version of VMware that matches your operating system and
architecture (32- or 64-bit). If you are using windows operating system with 64-bit processor then
download the 64-bit windows version of the software.

The following screenshot shows the main page of VMware website. The ‘Download Now’ (circled in
red) button will take you to a new page, as in the in Figure 1.1 below.

Figure 1.1

Next, you should see a page like in Figure 1.2 below. You might need to scroll down the page to see
the download link. The ‘GO TO DOWNLOADS’ (circled in red) link will take to a page to download the
software.
Figure 1.2

From the new page (as in Figure 1.3below) click on the ‘DOWNLAOD NOW’ button (circled in read).
Figure 1.3

You should get a prompt to save the executable file somewhere on your computer. Save the
installation file in a suitable location on your personal computer.

2. Installing VMware

The following screenshots show you the process of the installing VMware player on windows
operating system.

Note: Mac users visit https://www.vmware.com/uk/products/fusion/fusion-evaluation.html and


download the VMware Fusion Player for personal use.

When you first execute the downloaded executable file, you should see a screen like in Figure 2.1.
Click ‘Next’ to proceed.

Figure 2.1
Then, accept the terms and condition by ticking the checkbox, as shown in Figure 2.2 below.

Figure 2.2

Make sure you tick the ‘Add VMware workstation console tools into system PATH’. This is will help
your operating system to recognise the software when it is used by the user.

Figure 2.3

Next, you can optionally add shortcut to your Desktop and start menu by ticking the checkboxes. A
window like the one in Figure 2.4 should be presented to you. After clicking on the ‘Next’ button, the
final window to install the system should appear.
Figure 2.4

Finally, click on the ‘Install’ button to install the software, as shown in Figure 2.5

Figure 2.5

The Figure 2.6 below image shows the expected installation process.

Figure 2.6
Click ‘Finish’ button to complete the installation process.

Figure 2.7

Since a new system is added to the windows operating system environment, you are likely to be
asked to restart your system. It is recommended to do so for the effect to take place.

Figure 2.8
Now you can proceed to install Kali linux.

3. Installing Kali Linux

Kali Linux is a Debian-based Linux distribution that comes with a wide variety of preinstalled security
tools that we’ll use in this module. As time passes, newer versions of Kali will be released. If you
would like, feel free to download the latest version of Kali Linux from http://www.kali.org/. Keep in
mind, though, that many of the tools we’ll use in this module are in active development, so if you
use a newer version of Kali, some of the exercises may differ from the walkthroughs in this module.
If you prefer everything to work as written, I recommend using the version of Kali kali-linux-2020.4-
vmware-i386 (32-bit version) or kali-linux-2020.4-vmware-amd64 (64-bit version)), which is a
prebuilt VMware image compressed with 7-Zip. Download the correct version for your windows
operating system from https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-
download/
Note: You can find 7-Zip programs for Windows and Linux platforms at
http://www.7-zip.org/download.html . For Mac users, I recommend Ez7z from
http://ez7z.en.softonic.com/mac/.
1. Once the 7-Zip archive is decompressed, in VMware click on ‘Open a Virtual Machine’ link, as
shown in Figure 3.1 and direct it to the Kali Linux VMware in the decompressed Kali Linux
folder.

Figure 3.1
Once the virtual machine opens, click the Play virtual machine button. As shown in Figure
3.2

Figure 3.2
When prompted as shown in Figure 3.3, choose I copied it.

Figure 3.3

Once Kali Linux boots, you will be presented with a login screen like the one shown in Figure 3.4.

Figure 3.4

Use the default user ID and password to for log in:


Username: kali
Password: kali

6. You will be presented with a screen like the one shown in Figure 3.5.
Figure 3.5

4. Configuring the Network for Your Virtual Machine


Because we’ll be using Kali Linux to attack our target systems over a network, we need to place all
our virtual machines on the same virtual network VMware offers three options for virtual network
connections: bridged, NAT, and host only. You should choose the bridged
option, but here’s a bit of information about each:
 The bridged network connects the virtual machine directly to the local network using the
same connection as the host system. As far as the local network is concerned, our virtual
machine is just another node on the network with its own IP address.
 NAT, short for network address translation, sets up a private network on the host machine.
The private network translates outgoing traffic from the virtual machine to the local
network. On the local network, traffic from the virtual machine will appear to come from the
host machine’s IP address.
 The host-only network limits the virtual machine to a local private network on the host. The
virtual machine will be able to communicate with other virtual machines in the host-only
network as well as the host machine itself, but it will not be able to send or receive any
traffic with the local network or the Internet.
Note: Because our target virtual machines will have multiple known security vulnerabilities,
use caution when attaching them to your local network because anyone else on that network can
also attack these machines. For this reason, do not work on a public network where you do not trust
the other users.

By default, the Kali Linux virtual machine network adapter is set to NAT. Here’s how to change that
option on both Windows and Mac OS.

5. VMware Player on Microsoft Windows


Edit virtual machine settings, as shown in Figure 5.1. (If you’re still running Kali Linux in VMware
Player, choose Player>Manage>Virtual machine settings.)
Figure 5.1

On the next screen, choose Network Adapter in the Hardware tab and choose the Bridged option in
the Network connection section, as shown in Figure 5.2.

Figure 5.2
Now click the Configure Adapters button and check the network adapter that you’re using with your
host operating system. As you can see in Figure 5.3, I’ve selected only the Realtek wireless adapter.
Once you’ve made your selection, press OK.

Figure 5.3
VMware Fusion on Mac OS. To change the virtual network connection in VMware Fusion, go to
Virtual Machine>Network Adapter and change from NAT to Bridged,

Connecting the Virtual Machine to the Network


Kali Linux should automatically pull an IP address from the Bridged network once you make the
switch. To verify your IP address, open a Linux terminal by clicking the terminal icon(a black
rectangle with the symbols >_) at the top left of the Kali screen (or choose
Applications>Accessories>Terminal).
Then run the command ifconfig to see your network information, as shown in Listing 1.

(kali㉿kali)-[~]
└─$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.29 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::20c:29ff:fe73:982c prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:73:98:2c txqueuelen 1000 (Ethernet)
RX packets 48 bytes 8396 (8.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 35 bytes 4178 (4.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536


inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 16 bytes 712 (712.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 16 bytes 712 (712.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Listing 1: Networking information

The IPv4 address for this virtual machine is 192.168.20.9, as highlighted in bold in Listing 1. (The IP
address for your machine will likely differ.)

Note: The prompt kali@kali:~# is the superuser (root) prompt


Testing Your Internet Access
Now let’s make sure that Kali Linux can connect to the Internet. We’ll use the ping network utility to
see if we can reach Google. Make sure your computer is connected to the Internet, open a Linux
terminal, and enter the following.
root@kali:~# ping www.google.com

If you see something like the following in response, you’re online.


kali㉿kali)-[~]
└─$ ping www.google.com
PING www.google.com (172.217.169.36) 56(84) bytes of data.
64 bytes from lhr48s08-in-f4.1e100.net (172.217.169.36): icmp_seq=1 ttl=115 time=33.9 ms
64 bytes from lhr48s08-in-f4.1e100.net (172.217.169.36): icmp_seq=2 ttl=115 time=30.2 ms
64 bytes from lhr48s08-in-f4.1e100.net (172.217.169.36): icmp_seq=3 ttl=115 time=22.2 ms
64 bytes from lhr48s08-in-f4.1e100.net (172.217.169.36): icmp_seq=4 ttl=115 time=21.5 ms
64 bytes from lhr48s08-in-f4.1e100.net (172.217.169.36): icmp_seq=5 ttl=115 time=28.6 ms
--- www.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4011ms
rtt min/avg/max/mdev = 21.477/27.289/33.893/4.763 ms

If you do not receive a response, make sure that you have set your network adapter to Bridged, that
Kali Linux has an IP address, and, of course, that your host system currently has Internet access.

6. Installing Nessus
Although Kali Linux has just about every tool we’ll need, we do need to install a few additional
programs. First, we’ll install Tenable Security’s Nessus Home vulnerability scanner. This scanner is
free for home use only (you’ll see a description of limitations on the Nessus website). Note that
Nessus is very actively developed, so the current version as well as its GUI may have changed a bit
since this book went to press.

Use the following steps to install Nessus Home from within Kali:
1. Open ApplicationsInternetFirefox ESR and enter http://www.tenable.com/products/nessus-
home/ in the address bar. Complete the Register for an Activation Code information and click
Register. (Use a real email address—you’ll need the activation code later.)
2. Once you reach the Downloads page, choose the latest version of Nessus for the Linux Debian 32-bit
platform (Nessus-5.2.5-debian6_i386.deb as of this writing) and download it to your root directory (the
default download location).
3. Open a Linux terminal (click the terminal icon at the top of the Kali screen) to open a root prompt.
4. Enter ls to see a list of the files in your root directory. You should see the Nessus file that you just
downloaded.
5. Enter sudo dpkg -i followed by the name of the file you downloaded (you can type the first letter of the
filename and press tab to use tab completion) and press enter to begin the install process. Installation may
take a while as Nessus processes various plugins. Progress is shown by a line of hash symbols (#).
(Reading database ... 262025 files and directories currently installed.)
Preparing to unpack Nessus-8.13.1-debian6_amd64.deb ...
Unpacking nessus (8.13.1) over (8.13.1) ...
Setting up nessus (8.13.1) ...
Unpacking Nessus Scanner Core Components...

- You can start Nessus Scanner by typing /bin/systemctl start nessusd.service


- Then go to https://kali:8834/ to configure your scanner

6. Once you’re returned to the root prompt with no errors, Nessus should be installed, and you might be
presented with a message like this.
All plugins loaded
Fetching the newest plugins from nessus.org...
Fetching the newest updates from nessus.org...
Done. The Nessus server will start processing these plugins within a
minute

7. Now enter the following to start Nessus.


root@kali:~# /bin/systemctl start nessusd.service

8. Open the URL https://kali:8834/ in the web browser. You should see a SSL certificate warning, similar
to that in the figure below.

9. Expand I Understand the Risks and click Add Exception. Then click Confirm Security Exception,
as shown
10. Click Get Started at the bottom left of the opening Nessus page and enter a username and password on
the following page. Remember the username and password because we’ll need them later.
11. At the next page, enter the activation code you received via email from Tenable Security.
12. Once registered with Tenable Security, choose the option to download plugins (downloading will take
some time). Once Nessus processes the plugins, it will initialize.

Accessing Nessus
When Nessus finishes downloading plugins and configuring the software, you should see the Nessus login
screen, as shown below. You should be able to use the credentials for the account you created during setup to
log in.
Click Nessus Essentials of the opening Nessus page. At the next page, enter the activation code you
received via email from Tenable Security. You should see the Nessus login screen. You should be able
to use the credentials for the account you created during setup to log in. Choose the option to
download plugins (downloading will take some time). Once Nessus processes the plugins, it will
initialize.

When Nessus finishes downloading plugins and configuring the software, you should see the Nessus
login screen. You should be able to use the credentials for the account you created during setup to
log in.
To close Nessus, just close its tab in the browser.

7. Installing Additional Software


We’re not done yet. Follow these instructions to complete your Kali Linux install.
7.1.The Ming C Compiler
We need to install a cross compiler so we can compile C code to run on Microsoft Windows
systems. The Ming compiler is included in the Kali Linux repositories but is not installed by
default. Install it with this command.
For 32-bit machines do:
root@kali:~# sudo apt-get install mingw32

for 64-bit machine do:

root@kali:~# sudo apt-get install mingw-w64

You might also like