Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kali Linux 2018: Assuring Security by Penetration Testing

You're reading from   Kali Linux 2018: Assuring Security by Penetration Testing Unleash the full potential of Kali Linux 2018, now with updated tools

Arrow left icon
Product type Paperback
Published in Oct 2018
Publisher
ISBN-13 9781789341768
Length 528 pages
Edition 4th Edition
Languages
Arrow right icon
Authors (7):
Arrow left icon
Alex Samm Alex Samm
Author Profile Icon Alex Samm
Alex Samm
Damian Boodoo Damian Boodoo
Author Profile Icon Damian Boodoo
Damian Boodoo
Tedi Heriyanto Tedi Heriyanto
Author Profile Icon Tedi Heriyanto
Tedi Heriyanto
Gerard Johansen Gerard Johansen
Author Profile Icon Gerard Johansen
Gerard Johansen
Shakeel Ali Shakeel Ali
Author Profile Icon Shakeel Ali
Shakeel Ali
Shiva V. N. Parasram Shiva V. N. Parasram
Author Profile Icon Shiva V. N. Parasram
Shiva V. N. Parasram
Lee Allen Lee Allen
Author Profile Icon Lee Allen
Lee Allen
+3 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Installing and Configuring Kali Linux FREE CHAPTER 2. Setting Up Your Test Lab 3. Penetration Testing Methodology 4. Footprinting and Information Gathering 5. Scanning and Evasion Techniques 6. Vulnerability Scanning 7. Social Engineering 8. Target Exploitation 9. Privilege Escalation and Maintaining Access 10. Web Application Testing 11. Wireless Penetration Testing 12. Mobile Penetration Testing with Kali NetHunter 13. PCI DSS Scanning and Penetration Testing 14. Tools for Penetration Testing Reporting 15. Assessments 16. Other Books You May Enjoy

Configuring the virtual machine

Once installed, there are several configuration steps necessary for the Kali Linux virtual machine. These steps allow for greater functionality and usability.

VirtualBox guest additions

It is recommended that after you have successfully created the Kali Linux virtual machine using VirtualBox, you install VirtualBox guest additions. This add-on will provide you with the following additional features:

  • It will enable the virtual machine to be viewed in full screen
  • It will make the mouse move faster in the virtual machine
  • It will enable you to copy and paste the text between the host and guest machine
  • It will enable the guest and host machines to share folders

To install the guest additions, perform the following steps:

  1. From the VirtualBox menu, navigate to Devices | Install Guest Additions. You will then see that the VirtualBox guest addition file is mounted as a disk.
  2. The VirtualBox will then display the following message. Click on Cancel to close the window:
  1. Open the Terminal console and change the VirtualBox guest additions CD ROM mount point (/media/cdrom0):
  1. Execute VBoxLinuxAdditions.run to run the VirtualBox guest additions installer by typing sh ./VBoxLinuxAdditions.run, as seen here:

You may need to wait for several minutes until all of the required modules are successfully built and installed. Follow these steps to switch the VM to full-screen mode:

  1. Change to the root home directory.
  2. Eject the VBoxAdditions CD image by right-clicking on the icon and selecting Eject from the menu. If successful, the VBoxAdditions icon will disappear from the desktop.
  1. Reboot the virtual machine by typing the reboot command in the terminal console.
  2. After the reboot, you can switch to full screen (View | Switch to fullscreen) from the VirtualBox menu.

Setting up networking

In the following section, we will discuss how to set up networking in Kali Linux for a wired and wireless network.

Setting up a wired connection

In the default Kali Linux VMware image or ISO configuration, Kali Linux uses Network Address Translation (NAT) as the network's connection type. In this connection mode, the Kali Linux machine will be able to connect to the outside world through the host operating system, whereas the outside world, including the host operating system, will not be able to connect to the Kali Linux virtual machine.

For the penetration testing task, you might need to change this networking method to Bridged Adapter. The following are the steps to change it:

  1. First, make sure you have already powered off the virtual machine.
  2. Then, open up the VirtualBox Manager, select the appropriate virtual machine—in this case we are using the Kali Linux virtual machine—and then click on the Network icon on the right-hand side and change the Attached to drop-down box from NAT to Bridged Adapter in Adapter 1. In the Name field, you can select the network interface that is connected to the network you want to test, as shown in the following screenshot:

To be able to use the bridge network connection, the host machine needs to connect to a network device that can give you an IP address via DHCP, such as a router or a switch.

As you may be aware, a DHCP IP address is not a permanent IP address; it's just a lease IP address. After several times (as defined in the DHCP lease time), the Kali Linux virtual machine will need to get a lease IP address again. This IP address might be the same as the previous one or might be a different one.

If you want to make the IP address permanent, you can do so by saving the IP address in the /etc/network/interfaces file.

The following is the default content of this file in Kali Linux:

  • auto lo
  • iface lo inet loopback

In the default configuration, all of the network cards are set to use DHCP to get the IP address. To make a network card bind to an IP address permanently, we have to edit that file and change the content to the following:

  • auto eth0
  • iface eth0 inet static
  • address 10.0.2.15
  • netmask 255.255.255.0
  • network 10.0.2.0
  • broadcast 10.0.2.255
  • gateway 10.0.2.2

Here, we set the first network card (eth0) to bind to the IP address of 10.0.2.15. You may need to adjust this configuration according to the network environment you want to test.

Setting up a wireless connection

By running Kali Linux as a virtual machine, you cannot use the wireless card that is embedded in your host OS. Fortunately, you can use an external USB-based wireless card.

For this demonstration, we are using the USB Ralink wireless card/external antenna (there will be an in-depth discussion of wireless antenna selection later on in the section concerning wireless penetration testing):

  1. To activate your USB-based wireless card in the Kali virtual machine, plug in the wireless card to a USB port, navigate to Devices | USB Devices, and select your wireless card from the VirtualBox menu:

In this screenshot, we can see the USB device listed.

  1. If your USB wireless card has been successfully recognized by Kali, you can use the dmesg program to see the wireless card's information. Another option to determine whether your wireless device is properly connected is to open a Terminal and run this command:
    ifconfig

If the wireless connection is properly configured, you should see a listing under the output with WLAN0 or WLAN1 listed:

  1. The output should include a listing for a WLAN. This is the wireless network connection.
  2. In the top-right section of the Kali menu, you will see the Network Connections icon. You can click on it to display your network information.
  3. You will see several networks' names, wired or wireless, available for your machine:
  1. To connect to the wireless network, just select the particular SSID you want by double-clicking on its name. If the wireless network requires authentication, you will be prompted to enter the password. Only after you give the correct password will you be allowed to connect to that wireless network.
You have been reading a chapter from
Kali Linux 2018: Assuring Security by Penetration Testing - Fourth Edition
Published in: Oct 2018
Publisher:
ISBN-13: 9781789341768
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
Banner background image