Penetration Testing with Kali Linux
PWK - Copyright © 2023 OffSec Services Limited. All rights reserved.
18
Remember that the information provided by the Student Mentors will be based on the amount of
detail you are able to provide. The more detail you can give about what you’ve already tried and
the outcomes you’ve been able to observe, the more they will be able to help you.
2.1.3
Setting up Kali
The Module Exercises and Challenge Labs are to be completed using virtual machines (VMs)
operating in our lab environment. When we refer to a
lab environment
, we mean the combination
of the following components:
•
Your Kali Linux VM
•
The OffSec Learning Portal
•
A lab containing deployable target machines
•
A VPN connection between your Kali VM and the lab
Let’s look at these components individually.
Kali Linux
2
is an operating system (like Windows or macOS) that comes with a curated set of
tools that are specifically useful for penetration testing and other information security activities.
Kali Linux is open source and free to use.
If you’re already familiar with cybersecurity, you may have Kali Linux installed and can skip ahead
to the next section.
If not, we
strongly
recommend
installing Kali on a VM, which provides the functionality of a
physical computer system running another operating system (OS)
within a program called a
hypervisor. The benefit of using a VM is that it allows us to run a guest OS within a host OS.
Although we could physically install Kali on a dedicated machine, it is more convenient, safe, and
efficient to install Kali
within
our host system. Among other reasons, this ensures that we have
easy access to all the tools available to both.
For example, we may be using a desktop computer running Windows or a laptop running macOS.
We could install VMware Workstation Player on our Windows machine or VMware Fusion on our
Mac to install the Kali Linux
VMware image
. When this
virtual image is installed, Kali will run
alongside our primary
operating system in a window, or full-screen if we like. If configured
properly, Kali Linux will have access to the network with its own IP address and will behave as if
it’s installed on a dedicated machine for the most part.
From a terminology standpoint, we call the physical system running Windows or
macOS our host machine and we call the Kali VM a guest machine.
The VMware image that we recommend is a default 64-bit build of Kali Linux. We recommended
using the latest VMware image available on the OffSec VM image download page.
3
Note that
2
(OffSec, 2023), https://help.offsec.com/hc/en-us/articles/360049796792-Kali-Linux-Virtual-Machine
3
(OffSec, 2023), https://help.offsec.com/hc/en-us/articles/360049796792-Kali-Linux-Virtual-Machine
Penetration Testing with Kali Linux
PWK - Copyright © 2023 OffSec Services Limited. All rights reserved.
19
although the VirtualBox image, the Hyper-V image, or a dedicated installation of Kali should work,
we can only provide support for the indicated VMware images.
In the next section, we’ll set up the VPN connection that will connect us to the lab.
2.1.4
Connecting to the PWK Lab
Many of the Module exercises and all of the lab machines will require you to connect to a
Virtual
Private Network
(VPN).
A VPN essentially creates an encrypted tunnel that allows your data to traverse an open network
such as the public Internet, and connect to another otherwise isolated network securely.
We’ll connect to the VPN from our Kali machine, granting us access to the lab. When a learner
connects to the lab, the specific segment of the network they connect to is private to them. In
other words, each connection is to a unique environment in which the learner can work at their
own pace without worrying about interrupting, or being interrupted by, other learners.
Even though each lab is private, it is prudent to consider the labs as a
hostile environment
and you
should not store sensitive information on the Kali Linux virtual machine used to connect to the
VPN. Client-to-client VPN traffic is strictly forbidden and could result
in termination of access
from the course and its materials.
Fortunately, connecting to a VPN is a quick and easy process. If you’re using Kali as a VM, go
ahead and start the machine. Then on the Kali machine, open up a browser and navigate to the
OffSec Learning Portal and sign in.
Next, let’s navigate to the Course drop-down menu and select the PEN200 course. This will take
us to the main course page. At the top right corner of the page but to the left of your account
name, you’ll see the download drop-down menu for VPN. Clicking this option will generate a VPN
pack for this course and download it in the form of a .ovpn text file. Be sure to note the location of
the download.
Next, let’s use the Kali Linux
terminal
to connect to the VPN. Clicking the black terminal icon at the
top-left of the Kali VM will present a window like this:
┌──
(kali
㉿
kali)-[~]
└─
$
Listing 2 - The kali terminal
If we chose a different
username during setup, our prompt will include that name:
┌──
(ArtVandelay
㉿
kali)-[~]
└─
$
Listing 3 - The kali terminal with a different username
In some cases, your screen may differ from what’s shown in the course material.
This is rarely problematic, but we will often point out these potential
inconsistencies.
Penetration Testing with Kali Linux
PWK - Copyright © 2023 OffSec Services Limited. All rights reserved.
20
This is the
command prompt
, which accepts our user commands. For simplicity we will switch to
a less-complex version of the terminal with
C
+
p
as shown in Listing 4.
kali@kali:~$
Listing 4 - Switching to the one-line command prompt
Next, we’ll focus on the VPN pack (i.e., the .ovpn file we downloaded). We should have
downloaded it to the Kali VM, but if it was downloaded to the host machine, we should either copy
it over or re-download it from Kali. Let’s use updatedb and locate to find the file.
kali@kali:~$
Yüklə
Dostları ilə paylaş: