M 108: Kali Virtual Machine (15 pts)

What You Need for This Project

Task 1: Preparing your Host Machine

The physical computer you use is called a "Host". The virtual machines that run on it are called "Guests".

Installing VMware

If you are working in S214, the lab machines should already have VMware installed.

If you are using your own PC, you can get the free VMware Player here:

https://my.vmware.com/en/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/14_0

If you are using a Mac, you can get a free copy of VMware Fusion from the college as explained by your instructor, or use VirtualBox.

Install VMware with the default options.

Task 2: Preparing a Kali Virtual Machine

Downloading a Kali VM File

In a Web browser, go to:

https://www.offensive-security.com/kali-linux-vmware-virtualbox-image-download/

Click "Kali Linux 64 bit VM 7z", as shown below.

Installing 7-Zip

If you are using Windows, downoad and install 7-Zip.

Then right-click the Kali .7z file and use the "7-Zip" item to unzip it.

If you are using a Mac, unzip the file with The Unarchiver.

Starting your Kali Virtual Machine

In VMware Player, at the top left, click Player, File, Open..., as shown below.

Navigate to the Kali VM you unzipped and start it.

Troubleshooting: Number of Processors

If you see a message saying the virtual machine is configured to use four processors, adjust it with these steps:
  • On the left side of the VMware Player window, click Kali once to select it.
  • On the lower right side of the VMware Player window, click "Edit virtual machine settings".
  • On the left side of the Virtual Machine Settings window, click Processors
  • On the right side of the Virtual Machine Settings window, adjust the number to 1 and click OK

Troubleshooting: Slow Performance

If your virtual machines run very slowly, your host machine may be low on RAM.
You can adjust the RAM using the Virtual Machine Settings window, as explained in the previous Troubleshooting box.

Try lowering the RAM on the Kali VM to 1024 MB.

Log in to Kali with the username root and a password of toor

You should see the Kali Linux desktop as shown below:

Testing your Kali Linux Networking

At the top left of the Kali Linux desktop, click the rectangular black icon to open a Terminal window.

In the Terminal window, type in this command to find your IP address, and then press the Enter key:

ping google.com
You should see replies, as shown below. Press Ctrl+C to stop the pings.

Task 3: Fixing Kali Annoyances

Fixing VMware Tools

VMware Tools is needed to allow copy-and-paste into and out of a virtual machine. Unfortunately it works very poorly on Kali. You can try these fixes, or just abandon it and install SSH.

I recommend just using SSH, with these instructions:

Installing SSH on Kali

If you want to try to get VMware Tools working, proceed with the steps below.

On your host Windows system, in your Web browser, use the mouse to highlight and copy this command:

echo "Copy and paste works!"
On your Kali Linux system, in a Terminal window, right-click and click Paste. If VMware tools is working, the command appears, as shown below.

If the command did not appear, perform these steps to fix VMware Tools.

Removing open-vm-tools

In a Terminal window, execute these commands:
apt purge open-vm-tools-desktop -y
apt purge open-vm-tools -y
rm -rf /etc/vmware-tools

Installing VMware's Version

From the VMware menu bar, click "Virtual Machine", "Install VMware Tools".

Click Install.

A CD icon appears on your Kali desktop, as shown below.

Double-click the CD icon. Right-click VMwareTools...tar.gz and click "Copy to...", as shown below.

In the "Select Copy Destination" box, on the left side, click Downloads.

At the top right, click Select, as shown below.

Close the VMware Tools window.

In a Terminal window, execute these commands:

cd
cd Downloads
tar xzf VMwareTools*
cd vmware-tools-distrib
./vmware-install.pl

The installer asks many questions. Accept the default directories, but make sure the answer to every yes/no question is yes, including this one, which is "no" by default:

Reboot your virtual machine.

Execute this command to start VMware tools:

service vmware-tools start
Now you can copy and paste text and files between the Kali VM and the Mac host!

Making VMware Tools Start Automatically

This is a very old-fashioned way to do it, but it works.

Execute this command to make a Bash script:

nano /usr/local/bin/startvm
Paste in the code below:
#!/bin/bash
if [ $(/usr/sbin/service vmware-tools status | grep Active: | grep inactive | wc -l) -gt 0 ]
then
  /usr/sbin/service vmware-tools start
fi

Press Ctrl+X, Y, Enter to save the file.

Execute this command to make the script executable:

chmod +x /usr/local/bin/startvm
Execute this command to create a cron job:
crontab -e
Press Enter to use nano.

Add this line at the end of the file, as shown below.

* * * * * /usr/local/bin/startvm

Press Ctrl+X, Y, Enter to save the file.

Now VMware Tools will start automatically :)

Power Saving

By default, Kali 2.0 will keep locking the screen after a few seconds of inactivity, which is irritating. To fix this, on the left side of the Kali 2.0 desktop, click the bottom button to "Show Applications", as shown below.

On the right side of the Kali 2.0 desktop, click the lowest circle to show the bottom screen.

Then click Settings, as shown below.

In the "All Settings" window, click Power.

Set "Blank screen" to Never, as shown below.

Task 4: Finding the Linux Version

In the Terminal window, type in this command and then press the Enter key:
uname -a
You should see information about your Linux version, as shown below.


M 108: Version (15 pts)

Find the text covered by a gray box in the image above. That's the flag.


Shutting Down your Virtual Machine

In the VMware Player window, in the upper right corner, click the X. A box pops up, offering three choices, as shown below.

Suspend freezes your VM in its current state. This is usually the best choice.

Power Off is only for emergencies, when the guest operating system has crashed. It's the equivalent of pulling out the power plug on a real computer.

Click Suspend.

Integrated with Canvas 6-27-18
SSH link fixed incorrectly 9-10-18
SSH link restored 9-11-18
Adapted for 128 1-14-19
Converted to a CTF 2-28-19