0% found this document useful (0 votes)
481 views10 pages

1.3.7 Lab - Investigate Kali Linux - ILM

Uploaded by

net
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
481 views10 pages

1.3.7 Lab - Investigate Kali Linux - ILM

Uploaded by

net
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Lab - Investigate Kali Linux (Instructor Version)

Instructor Note: Red font color or gray highlights indicate text that appears in the instructor copy only.

Objectives
In this lab, you will complete the following objectives:
 Familiarize yourself with the Kali Linux GUI.
 Familiarize yourself with the Kali Linux shell.

Background / Scenario
Linux is open source, fast, reliable, and small. It requires very little hardware resources to run and is highly
customizable. Unlike other operating systems such as Windows and Mac OS X, Linux was created, and is
currently maintained by, a community of programmers. Linux is part of several platforms and can be found on
devices anywhere from “wristwatches to supercomputers”. Because Linux is open source, any person or
company can get the kernel’s source code, inspect it, modify it, and re-compile it at will. They are also allowed
to redistribute the program with or without charges.
Linux distributions are packages created by different organizations. Linux distributions (or distros) include the
Linux kernel with customized tools and software packages. While some of these organizations may charge for
their Linux distribution support (geared towards Linux-based businesses), most of them also offer their
distribution for free without support. Debian, Red Hat, Ubuntu, CentOS, and SUSE are just a few examples of
Linux distributions.
Kali Linux is a special version of Linux designed specifically for security auditing and penetration testing.
Many changes have been implemented to ensure security, system integrity, and security-specific capabilities.
It is not recommended to use Kali for standard uses, such as gaming, development, and other day-to-day
uses. As a security and pentesting expert, it is very important for you to know how to get around in Kali, both
in the GUI and at the terminal. You need to be able to find the tools that you need to perform your job and
manipulate files in the file system.

Required Resources
 Kali VM customized for Ethical Hacker course
 Internet access

Instructions

Part 1: Familiarize Yourself with the Kali Linux GUI.

Step 1: Start the VM and learn about the Kali GUI.


Modern operating systems use an interface that most people are familiar with, but there are things that can
only be completed from the command line. It is still very important for you to know your way around the GUI.
a. Log into the Kali system with the username kali and the password kali. You are presented with the Kali
desktop.
Like the Windows desktop, Kali has icons representing things like the trash, file explorer, and other links.
There are also several icons across the top, like the Windows taskbar. In addition, icons for running
applications will appear there. This is called the panel. From here, you can launch the Firefox web
browser, terminals and also set up additional desktops using the numbered buttons. Each desktop can be
configured differently with specific links and files on it. This is useful if you commonly have sets of tools

ã 2023 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 10
Lab - Investigate Kali Linux

and files that you use for specific tasks. You can switch to the desktop that has the items you need when
you are working on a certain job.
b. Right-click the panel, click Panel, and then + Add New Items…
Here you can add many items to the panel to help you get to the tools and configurations that you use the
most. Close the Add New Items window.
c. Right-click the panel, click Panel, and then Panel Preferences…
Here you can modify many settings to customize how the panel works and what it looks like. Additional
panels can be added as well, to accommodate more items.
d. Investigate the settings and change the settings if you desire.
e. Close both configuration windows when you are finished.
The top-right corner shows some settings and information, such as network connection, audio, time and
date, and the power button. You can add additional items to this area using the panel configuration if you
wish. This is a good place to look for useful information.

Step 2: Navigate the Applications menu.


a. Click the first icon on the left side of the panel.
This opens the Applications menu. Like the Start button in Windows, this menu contains shortcuts to the
applications and settings in the operating system. From here, you can navigate to any of the tools that
have been installed, find the operating system settings, and search for anything you are looking for. All
the tools in this VM are arranged by type, such as wireless attacks or vulnerability analysis. These groups
make it easier to find an application specific to a functionality.
b. Navigate through the folders and look at all the different tools. Open a few if you would like to see them.
Note that some of the tools have GUIs, but most open in a terminal window.
c. Close any open windows.

Part 2: Familiarize Yourself with the Kali Linux Shell.


The shell is the term used to refer to the command interpreter in Linux. Also known as the terminal, command
line, or command prompt, the shell is a very powerful way to interact with a Linux computer.
Linux commands are programs created to perform specific tasks. Use the man command (short for manual)
to obtain detailed documentation about commands. As an example, man ls provides documentation about
the ls command from the user manual.

Step 1: Command documentation


a. Click the square black and white icon in the panel. This will open a terminal emulator
window.
b. To learn more about the man page, open a terminal, and type:
┌──(kali㉿Kali)-[~]
└─$ man man
Questions:

Scroll through the output and name a few sections that are included in a man page.
Type your answers here.
A few sections in a man page are: Name, Synopsis, Configuration, Description, Options, Exit
status, Return value, Errors, Environment, Files, Versions, Conforming to, Notes, Bugs, Example,
Authors, and See Also.
c. Type q to exit the man page.

ã 2023 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 10
Lab - Investigate Kali Linux

To invoke a command via the shell, simply type its name. The shell will try to find it in the system path and
execute it.
The table lists some basic Linux commands and their functions.

Command Description

mv Moves or renames files and directories.


chmod Modifies file permissions.
chown Changes the ownership of a file.
dd Copies data from an input to an output.
pwd Displays the name of the current directory.
ps Lists the processes that are currently running in the system.
su Simulates a login as another user or to become a superuser.
sudo Runs a command as a super user, by default, or another named user.
grep Used to search for specific strings of characters within a file or other command outputs.
Used to display or configure network card related information. If issued without
ifconfig parameters, ifconfig will display the current network card(s) configuration.
Note: While still widely in use, this command is deprecated. Use ip address instead.
apt-get Used to install, configure, and remove packages on Debian and its derivatives.
iwconfig Used to display or configure wireless network card related information.
Shuts down the computer. shutdown can be instructed to perform several shut down
shutdown related tasks, including restart, halt, put to sleep, or kick out all currently connected
users.
Used to change the password. If no parameters are provided, passwd changes the
passwd
password for the current user.
cat Used to list the contents of a file and expects the file name as the parameter.
man Used to display the documentation for a specific command.

Many command line tools are included in Linux by default. To adjust the command operation, users can
pass parameters and switches along with the command. The table lists a few of the most common
commands related to files and directories.

Command Description

Is Displays the files inside a directory.


cd Changes the current directory.
mkdir Creates directories.
cp Copies files and directories from source to destination.
mv Moves or renames files and directories.
rm Removes files or directories.
grep Searches for specific strings of characters within a file or other commands outputs.

ã 2023 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 10
Lab - Investigate Kali Linux

Command Description

cat Lists the contents of a file and expects the file name as the parameter.

For complete help on everything Kali Linux, open the Firefox web browser and go to
https://www.kali.org/docs/.
Here, you can perform a search by typing keywords in the search box or use the categories to find an
answer by subject.

Step 2: Create and change directories.


In this step, you will use the change directory (cd), make directory (mkdir), and list directory (ls) commands.
Note: A directory is another word for folder. The terms directory and folder are used interchangeably
throughout this lab.
Note: There may be times when a command will not work because the user that is currently logged on does
not have permission to perform it. To temporarily gain permission for the command, proceed the command
with sudo, which stands for super user "do". You may need to provide the password of a user that has
permission to perform the command. Alternatively, you can use a terminal that has a higher permission level.
This terminal is called Root Terminal Emulator and can be found in the panel by using the drop-down menu
next to the terminal icon.
a. In a terminal, enter pwd at the prompt. This command will print the current working directory to the
terminal.
┌──(kali㉿Kali)-[~]
└─$ pwd
Question:

What is the current directory?


Type your answers here.
Answers may vary. The current directory is /home/kali in this example.
b. Navigate to the /home/kali directory if it is not your current directory. Type cd /home/kali to change the
working directory.
┌──(kali㉿Kali)-[~]
└─$ cd /home/kali
c. Type ls -l at the command prompt to list the files and folders that are in the current working directory. The
ls command stands for list. The -l option displays the file size, permissions, ownership, date of creation
and more for the files and folders.
┌──(kali㉿Kali)-[~]
└─$ ls -l
total 36
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Desktop
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Documents
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Downloads
-rw-r--r-- 1 kali kali 142 Apr 10 14:51 gvm_admin_passwd.txt
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Music
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Pictures
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Public
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Templates
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Videos

ã 2023 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 10
Lab - Investigate Kali Linux

d. In the current directory, use the mkdir command to create three new folders: kali_folder1, kali_folder2,
and kali_folder3. Type mkdir kali_folder1 and press Enter. Repeat these steps to create kali_folder2
and kali_folder3.
┌──(kali㉿Kali)-[~]
└─$ mkdir kali_folder1
┌──(kali㉿Kali)-[~]
└─$ mkdir kali_folder2
┌──(kali㉿Kali)-[~]
└─$ mkdir kali_folder3
You can also specify multiple folders as in:
┌──(kali㉿Kali)-[~]
└─$ mkdir kali_folder1 kali_folder2 kali_folder3
e. Type ls -l to verify that the folders have been created and navigate to a new folder:
┌──(kali㉿Kali)-[~]
└─$ ls -l
total 48
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Desktop
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Documents
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Downloads
drwxr-xr-x 2 kali kali 4096 Apr 21 15:09 kali_folder1
drwxr-xr-x 2 kali kali 4096 Apr 21 15:09 kali_folder2
drwxr-xr-x 2 kali kali 4096 Apr 21 15:09 kali_folder3
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Music
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Pictures
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Public
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Templates
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Videos
┌──(kali㉿Kali)-[~]
└─$ cd /home/kali/kali_folder3
┌──(kali㉿Kali)-[~/kali_folder3]
└─$
Question:

Which folder are you in now?


Type your answers here.
In this example, the current directory is /home/kali/kali_folder3 as indicated by kali_folder3 at the
prompt.
Note: In the [kali@kali ~]$ prompt above: The tilde symbol ~ represents the current user’s home
directory. In this example, the current user’s home directory is /home/kali. After the cd
/home/kali/kali_folder3 command, the current working directory is now /home/kali/kali_folder3.
Note: $ (dollar sign) indicates regular user privilege. If a ‘#’ (hashtag or pound sign) is displayed at the
prompt, it indicates elevated privilege (root user).
Note: While these symbols, conventions and main concepts remain the same, the terminal window
prompt is highly customizable in Linux. Therefore, the prompt structure seen in this VM will likely differ
from the prompt in other Linux installations.

ã 2023 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 10
Lab - Investigate Kali Linux

Question:

Challenge: Type the command cd ~ and describe what happens. Why did this happen?
Type your answers here.
The directory is changed to the home directory. Because the shell interprets the ~ as a shortcut
for the current user’s home directory, cd ~ changes to the current user’s home.
f. Use the mkdir command to create a new folder named kali_folder4 inside the kali_folder3 folder:
┌──(kali㉿Kali)-[~]
└─$ mkdir /home/kali/kali_folder3/kali_folder4
1) Use the ls -l command to verify the folder creation.
┌──(kali㉿Kali)-[~]
└─$ ls -l /home/kali/kali_folder3
total 4
drwxr-xr-x 2 kali kali 4096 Apr 21 15:19 kali_folder4
2) Up to this point, we have been using full paths. Full path is the term used when referring to paths
that always start at the root (/) directory. It is also possible to work with relative paths. Relative paths
reduce the amount of text to be typed. To understand relative paths, we must understand the . and ..
(dot and double dots) directories. From the kali_folder3 directory, issue ls –la:
┌──(kali㉿Kali)-[~/kali_folder3]
└─$ ls -la
total 12
drwxr-xr-x 3 kali kali 4096 Apr 21 15:09 .
drwx------ 20 kali kali 4096 Apr 21 15:07 ..
drwxr-xr-x 2 kali kali 4096 Apr 21 15:19 kali_folder4
The -a option tells ls to show all files. Notice the . and .. listings shown by ls. These listings are used
by the operating system to track the current directory (.) and the parent directory (..) You can use .
and .. with the cd command to change directories. Using the cd command to change the directory to
the . directory incurs no visible directory change as the . points to the current directory itself.
3) Change the current directory to /home/kali/kali_folder3:
┌──(kali㉿Kali)-[~]
└─$ cd /home/kali/kali_folder3
4) Type cd .
┌──(kali㉿Kali)-[~/kali_folder3]
└─$ cd .
Question:

What happens?
Type your answers here.
Apparently, nothing, but the command interpreter has changed the directory to the current
directory itself.
5) Changing the directory to the .. directory, will change to the directory that is one level up the path.
This directory is also known as parent directory. Type cd ..
┌──(kali㉿Kali)-[~/kali_folder3]
└─$ cd ..
Question:

What happens?
Type your answers here.

ã 2023 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 10
Lab - Investigate Kali Linux

The directory was changed to /home/kali, which is the directory immediately above
kali_folder3, also known as parent directory.
If you issued the cd .. command at
┌──(kali㉿Kali)-[~]
└─$
Question:

what would be the current directory?


Type your answers here.
/home
If you issued the cd .. command at
┌──(kali㉿Kali)-[/home]
└─$
Question:

what would be the current directory?


Type your answers here.
/ (backslash), the root of the filesystem
If you issued the cd .. command at
┌──(kali㉿Kali)-[/]
└─$
Question:

what would be the current directory?


Type your answers here.
/ (backslash), the root of the filesystem. Because this is the highest level, no upward change is
done as the root directory has no parent directory.
6) Try using the ~ to change back to the user home directory. Verify your location with the command that
is used to display the current working directory.
Question:

Where are you?


Type your answers here.
/home/kali

Step 3: Redirect output.


Another powerful command line operator in Linux is known as redirect. Represented by the > symbol, this
operator allows the output of a command to be redirected to some location other the current terminal window
(the default).
a. Use the cd command to change to the /home/kali/ (~) directory:
┌──(kali㉿Kali)-[/]
└─$ cd /home/kali/
┌──(kali㉿Kali)-[~]
└─$
b. Use the echo command to echo a message. Because no output was defined, echo will output to the
current terminal window:
┌──(kali㉿Kali)-[~]
└─$ echo echo this message
echo this message

ã 2023 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 10
Lab - Investigate Kali Linux

c. Use the > operator to redirect the output of echo to a text file instead of to the screen:
┌──(kali㉿Kali)-[~]
└─$ echo redirect this to a file > text_file.txt
Questions:

No output was shown. Is that expected?


Type your answers here.
Yes, because the output was redirected to the text_file.txt file.
d. Notice that even though the text_file.txt file did not exist, it was automatically created to receive the
output generated by echo. Use the cat command to display the contents of the text_file.txt file:
┌──(kali㉿Kali)-[~]
└─$ cat text_file.txt
redirect this to a file

Step 4: Redirect and append to a text file.


a. Similar to the > operator, the >> operator also allows for redirecting data to files. The difference is that >>
appends data to the end of the referred file, keeping the current contents intact. To append a message to
the text_file.txt, issue command below:
┌──(kali㉿Kali)-[~]
└─$ echo this text will be appended to the text file >> text_file.txt
b. Use the cat command to display the contents of the text_file.txt text file again.
Question:

What happened to the text file? Explain.


Type your answers here.
The new message was appended to the end of the file, keeping the original contents intact.

Step 5: Delete files and directories.


a. Use the rm command to remove files or directories. Issue the command below to remove the file
text_file.txt from the home directory. The ls command can be used to show that the file text_file.txt has
been removed from the home directory:
┌──(kali㉿Kali)-[~]
└─$ rm text_file.txt
b. In Linux, directories are seen as a type of file. Therefore, the rm command is also used to delete
directories but the -r (recursive) option must be used. Notice that all files and other directories inside a
given directory are also deleted when deleting a parent directory. Issue the command below to delete the
kali_folder1 folder and its contents:
┌──(kali㉿Kali)-[~]
└─$ rm -r kali_folder1

Step 6: Move files and directories.


a. Moving files works similarly to copying files. The difference is that moving a file removes it from its original
location. Use the mv commands to move files around the local filesystem. Like the cp command, the mv
command also requires source and destination parameters.
b. Create a new text_file.txt file in the kali_folder2 folder by redirecting some text to it.
c. Return to the /home/kali/ folder.

ã 2023 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 10
Lab - Investigate Kali Linux

d. Issue the command below to move the text_file.txt from /home/kali/kali_folder2 to the home directory.
Note: There is a dot at the end of command.
┌──(kali㉿Kali)-[~]
└─$ mv kali_folder2/text_file.txt .
┌──(kali㉿Kali)-[~]
└─$ ls -l
total 48
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Desktop
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Documents
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Downloads
drwxr-xr-x 2 kali kali 4096 Apr 21 15:25 kali_folder2
drwxr-xr-x 3 kali kali 4096 Apr 21 15:25 kali_folder3
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Music
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Pictures
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Public
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Templates
-rw-r--r-- 1 kali kali 18 Apr 21 15:49 text_file.txt
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Videos
Question:

Why was the dot (“.”) used as the destination parameter for mv?
Type your answers here.
The dot (“.”) means that mv should move the file to the current directory. Because the current
directory was already /home/kali/ (the directory where the file should be moved), using the dot “.”
represents just that.
e. The mv command can also be used to move entire directories and the files they contain. To move the
kali_folder3 (and all the files and directories it contains) into kali_folder2, use the command below:
┌──(kali㉿Kali)-[~]
└─$ mv kali_folder3/ kali_folder2/
┌──(kali㉿Kali)-[~]
└─$ ls -l /home/kali
total 44
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Desktop
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Documents
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Downloads
drwxr-xr-x 3 kali kali 4096 Apr 21 16:03 kali_folder2
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Music
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Pictures
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Public
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Templates
-rw-r--r-- 1 kali kali 18 Apr 21 15:49 text_file.txt
drwxr-xr-x 2 kali kali 4096 Apr 10 14:51 Videos
f. Use the ls command to verify that the kali_folder3 directory was correctly moved to kali_folder2.
┌──(kali㉿Kali)-[~]
└─$ ls -l kali_folder2/
total 4

ã 2023 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 10
Lab - Investigate Kali Linux

drwxr-xr-x 3 kali kali 4096 Apr 21 15:25 kali_folder3

Reflection
You have learned some basic ways to use Kali Linux in this lab. You learned how to use the Kali GUI and
terminal with some basic Linux commands. The strength of Kali is in its collection of tools. We will cover some
of those tools in labs to come.
How can you learn more about Kali command line tools?
Type your answers here.
Each tool has man pages and help text to help guide the usage of the tools. In addition, the internet
has many resources for learning the tools specifically, and Linux in general, including text and video
demonstrations and question and answer forums.
End of document

ã 2023 - 2023 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 10

You might also like