Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kali Linux Cookbook

You're reading from   Kali Linux Cookbook Effective penetration testing solutions

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher
ISBN-13 9781784390303
Length 438 pages
Edition 2nd Edition
Arrow right icon
Authors (2):
Arrow left icon
Corey Schultz Corey Schultz
Author Profile Icon Corey Schultz
Corey Schultz
Bob Perciaccante Bob Perciaccante
Author Profile Icon Bob Perciaccante
Bob Perciaccante
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Installing Kali and the Lab Setup FREE CHAPTER 2. Reconnaissance and Scanning 3. Vulnerability Analysis 4. Finding Exploits in the Target 5. Social Engineering 6. Password Cracking 7. Privilege Escalation 8. Wireless Specific Recipes 9. Web and Database Specific Recipes 10. Maintaining Access

Installing Kali on VirtualBox

In this section, we will install Kali Linux into a virtual host in the VirtualBox environment, as we described in the previous section.

Kali Linux (Kali) is based on the Debian operating system; and it is a self-contained environment that includes hundreds of tools that can be used for security auditing and testing purposes. It provides a platform, which you can use to build your penetration testing skills. It is one of the most widely used platforms for this purpose.

Kali comes in a variety of different flavors – we will be using the full Kali install using the Gnome windows manager, inside an Oracle VirtualBox environment. However, Kali can be installed on any hypervisor; it can be non-destructively run from a USB or CD drive, on Raspberry Pi's, or other similar single board computers. It supports installation on both the Intel and Arm processors.

When you first go to the Kali website and look at the downloads section (www.kali.org/downloads), it may be a bit overwhelming with all the options at first, so let's run through some of them, so you understand the differences.

With reference to the following image, you will note that the top two entries, the Kali 64 bit and the Kali 32 bit, are the default full install of the operating system using the Gnome windows manager.

The next two entries denoted by lightare a minimal install of Kali with the Gnome Windows manager for some space constrained systems. You can use this along with manually installing only the needed tools for your specific purposes.

The next four entries denoted with e17, Mate, Xfce, and LXDE are full installs of the Kali operating system, each using a different graphical windows manager for its desktop interface. If you happen to have an older device, consider running Kali with the XFCE interface, as it requires less resources than Gnome. I would only suggest these if you are familiar with them, and opt not to use the default Gnome windows manager or have a specific purpose to do so such as resource constraints.

The last two entries, armhf and armel, are for those two flavors of the arm architecture with armhf supporting the older ARMv4 instruction set, and the armel supporting the new version 7 instruction set.

Please also note that the sha256 value is displayed. This allows you to validate that you have downloaded an unaltered version of the image:

Kali.org download page, image section, as of May 2017

If you scroll down the page a bit more, you will see the section that allows you to download pre-prepared images that can automatically run without going through the setup process; in addition, it supports various hypervisors, or, in the case of ARM, has images and scripts for popular arm-based computers, such as Raspberry Pi's or other popular arm-based devices.

We will not be using these images as we want to walk you through a full installation and setup of Kali, so you have a better understanding of the process.
Kali.org download page, hypervisor and arm section, as of May 2017

Getting ready

Before installing Kali Linux, we need to ensure the minimum requirements are met:

  • Your computer is connected to the internet
  • You have a minimum of 4 GB of RAM (8 GB is recommended)
  • You have a minimum of 25 GB hard drive space available (80 GB is recommended for Chapter 3, Vulnerability Analysis)
  • VirtualBox installation is complete and currently running
  • Download the appropriate Kali disk image from https://www.kali.org/downloads/

For our purposes, we will be using the Kali 64 bit version. Please refer to the recipe introduction for more details about these options.

How to do it...

Let's begin the process of installing Kali:

  1. Click on New in the upper left-hand corner of the screen:
Main VirtualBox screen
  1. Name your virtual machine Kali Linux, select type as Linux, and select the version as Linux 2.6 / 3.x / 4.x (64-bit). Press the Continue button when complete:
Name and operating system selection screen
  1. Memory size: You will be presented with a slider for memory size, with the ability to manually enter a value: in the box type in 4096. The 4 GB of memory will provide a smooth and responsive Kali install. Click on Continue.
  2. Hard disk: select Create a virtual hard disk now and press on Create.
You will note that on this screen, it will refer to a recommended hard disk size of 8 GB. Please note that this is not sufficient for a full Kali install, and we will be allowed to change it in a future step.
  1. Hard disk file type: take the default file type of VDI (VirtualBox Disk Image). Select Continue.
If you are interested in having easy compatibility with other hypervisors, you can select one of the other types available. Virtual Hard Disk (VHD) is widely used for Windows HyperV. Virtual Machine Disk (VMD) is widely used for VMware deployments.
  1. Regarding the storage on physical hard disk, leave the default of Dynamically allocated and click on Continue.
If you are running an older spinning disk versus a solid state drive and have the available space on the disk, the recommendation would be to use Fixed size.
  1. File location and size: leave the name and location with the default, and either move the slider or enter 25.00 GB directly into the box. Click on Create.
25 GB is a nice size for the install plus some extras. If you have limited space requirements please see our discussions of the various Kali image and installation options for more guidance in the introduction section of this recipe.
  1. Click on Kali Linux to highlight it; then click on Settings:
VirtualBox main screen - with Kali Linux VM shown
  1. From here, we will select the Storage option. Originally under Controller: IDE it will say Empty. Click to highlight Empty. Click on the circular disk icon to the right of IDE Secondary Master. An option dialog will be brought up, and select Choose Virtual Optical Disk File. This will bring up a file manager dialog, which will allow you to find and select the Kali image you downloaded previously. Once completed, your screen should look similar to the following:
Kali Linux VirtualBox settings storage option
  1. Click on Network and verify that Adapter 1 shows attached to NAT Network with the name NatNetwork:
Kali Linux - network adapter 1
  1. Click on Adapter 2 and for Attached to select Host-only Adapter with the Name as vboxnet0, then click on OK:
Kali Linux - network adapter 2
  1. We are brought back to the main manager screen. Let's click on Kali Linux to highlight it, and then click on Start:
VirtualBox manager screen
  1. We will now be brought to the main Kali installation screen. Let's click on Graphical install:
Kali main installation screen
  1. Select an appropriate language; for our use, we will select English and click on Continue:
Select a language screen
You may click on X on the boxes at the top, if any, as they are only informational.
  1. Select the proper keymap for your region. For our purposes, we will select American English. Then, click on Continue. The VM will then start by loading installer components. This should only take a moment or two based on the performance of your device. It will also detect and connect to your network automatically.
  2. You will be brought to a screen where you must enter the hostname. Let's simply call our install Kali and click on Continue:
Kali configure network screen
  1. The next screen will ask for your domain name. We will leave this blank, and simply click on Continue.
  2. Our next screen will ask us to enter a root password. Select a strong password. Enter it for a second time to validate it, and click on Continue. The install will continue through some further steps.
  3. Once completed, you will be brought to a configure clock screen. Select the appropriate time zone; for our purposes, we will select Eastern, then click on Continue:
Configure clock screen
  1. Partitioning disks: for simplicity, we will select Guided - use entire disk, and click on Continue:
Partition disks
It's important to note that, for our example here, we want to just keep it straightforward. When actually setting this up for production testing, I have a dedicated laptop and use a fully encrypted LVM. This would be a recommendation when you move from working in a sandbox and go to actual engagements; as a pen tester, you need to protect your work as well as your client's information. Encryption, in that case, is paramount.

You may also want to keep in mind crossing borders with encrypted laptops and what the border security rights are. In the US, even for US citizens, they can ask for your passwords to get into the machines, remove them from your immediate control, and confiscate them. You may want to take situations like this into consideration; you can ship that encrypted laptop to and from the destination as needed, or complete your reports prior to leaving, and wipe the hard drive. Remember that deleting files is not securely wiping information - you can use a tool such as Darik's Boot and Nuke (DBAN) https://dban.org/ and use 5220.22-m wipe methods.
  1. You will be brought to a partition disks screen for confirmation. Click on the disk to highlight it, and click on Continue:
Partition disks
Please note that as you are inside a virtual machine when it references, your disk will be erased; it is only talking about the virtual partition and not your disk. If you have decided to load this on your PC as the native operating system, it will erase the entire drive.
  1. Select All files in one partition (recommended for new users) and click on Continue:
Partition disks - screen 2
  1. Select Finish partitioning and write changes to disk. Click on Continue:
Partition disks - screen 3
  1. Click on Yes to write changes to disk. Click on Continue:
Partition disks - screen 4
Your system will begin installing further. This process will take several minutes, so please be patient.
  1. Upon the completion of the install, you will be asked whether you want to use a Network Mirror for your package manager. Select Yes and click on Continue.
  1. You will be asked to enter a proxy server if needed. Please enter any required information (for most installs, you will leave this blank). Click on Continue. Kali will continue to install packages.
  2. Select Yes to install the GRUB boot loader and click on Continue.
  3. Select the single drive listed to highlight it, and then click on Continue. This will finish the installation:
Install GRUB boot loader
  1. After a short time, you will be brought back to the Finish the Installation screen. This will ask to boot your computer to ensure that you have removed the installation media. Under most circumstances, VirtualBox or other hypervisors will honor the disk eject command issued when Kali finishes installation, but we need to be sure. At this point in time, do nothing:
Kali Linux: finish the installation
  1. Move the installation windows to the side to expose the main VirtualBox manager screen. Click on to highlight the Kali Linux VM. Click on Settings, and next click on Storage. If under Controller: IDE, you do not see Empty, click on the install media shown to highlight it. Click on the icon at the far right that looks like a disk, and select Remove Disk from Virtual Drive. Click on OK:
VirtualBox manager
  1. Go back to the Kali Installation screen, and now click on Continue. It will finish a couple items up, and reboot the virtual machine bringing you to the login screen:
Kali Linux finish the installation
Remember that when logging into the system, your username is root and the password that you created during installation.
You have been reading a chapter from
Kali Linux Cookbook - Second Edition
Published in: Sep 2017
Publisher:
ISBN-13: 9781784390303
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime