Day 3 - Exploring Kali Linux
This slide will guide you through a few essential steps to get started with Kali Linux. Secure your user account, explore the menu, and discover the tools that best suit your needs.

by Birzu Adrian

Linux Filesystem Hierarchy
/bin and /sbin
These directories contain essential programs like ls, cd, cat, fdisk, and mkfs. They are necessary for basic system functionality.
/etc and /tmp
The /etc directory stores configuration files, while /tmp holds temporary files that are typically deleted on system startup.
/usr/bin and /usr/share
Applications like apt, nmap, and supporting data files are found in these directories. /usr/bin houses executable programs, while /usr/share contains data that is shared by multiple applications.
Familiarity is Key
Understanding the Linux filesystem layout can significantly improve your efficiency and workflow.
Basic Linux Commands
Manuals
Use man to read the manual for a command. For example, man ls or man -k passwd.
Listing Files
The ls command lists files in the current directory. Use ls -al for a detailed view.
Navigating Directories
Use cd to move between directories. For example, cd /usr/share/metasploit-framework or cd ~ to go home.
Creating Directories
The mkdir command creates new directories. For example, mkdir notes or mkdir -p test/{recon,exploit,report}.
Starting Services
SSH
Start the SSH service using systemctl and check if it's running.
HTTP
Start the Apache HTTP service using systemctl and verify it's listening on port 80.
Enable Services
Enable the SSH and Apache services to automatically start on boot.
Exercise 1
1
2
3
4
1
Explore man pages
Learn how to use the `man` command to view command documentation.
2
Search for keywords
Find commands related to file compression.
3
Locate commands
Find the location of the `pwd` command on your system.
4
Search for files
Identify files that were modified within the last day and are not owned by the root user.
Complete the steps of Exercise 1. This involves exploring command documentation using `man`, searching for keywords related to file compression, locating the `pwd` command, and finding files modified in the last day that are not owned by the root user.
Package Management Commands
1
apt update
Updates the APT package database with the latest available package information.
2
apt upgrade
Upgrades all installed packages to their latest available versions.
3
apt install
Installs a new package on the system, such as pure-ftpd.
4
apt remove --purge
Completely removes a package, including any leftover configuration files.
Exercise 2: Installing and Removing Tools
1
Search for a Tool
Identify a tool that's not currently installed in Kali Linux and could be helpful for your work.
2
Install the Tool
Use package management commands to download and install the tool you've chosen on your Kali system.
3
Remove the Tool
After testing the tool, remove it from your Kali installation using the appropriate package management commands.
Environment Variables
Accessing Variables
You can view environment variables using the echo command and the $ prefix. For example, to see the value of the PATH variable, you would type echo $PATH.
Setting Variables
The export command makes environment variables accessible to subprocesses. For example, to set a variable called MY_VAR to the value 'hello', you would type export MY_VAR='hello'.
Tab Completion
Bash's auto-complete feature can speed up your shell usage by automatically completing file and directory paths. Just start typing a file or directory name, press the Tab key, and Bash will attempt to complete the path for you.
Bash History
Bash maintains a history of commands that you can access and reuse. This is useful for quickly repeating commands or recalling previous actions. To view your command history, use the history command.
Redirecting to a New File
1
2
3
1
Standard Output
Display output on the screen.
2
Redirect to File
Redirect output to a file.
3
Append to File
Append output to an existing file.
Redirecting output to a file allows you to save the results for future reference or manipulation, rather than just printing to the screen.
Redirecting Output to a File
1
View the /etc/passwd File
Use the cat command to display the contents of the /etc/passwd file.
2
Sort the File Contents
Pipe the output of the cat command through the sort command to rearrange the content in alphabetical order.
3
Save the Sorted Output to a File
Redirect the sorted output to a file in your home directory using the '>' symbol.
Whois Enumeration and Google Hacking
Whois Lookup
The whois tool can be used to retrieve information about a domain name, including the name server and registrar.
Google Hacking
Google search operators can be leveraged to discover critical information, vulnerabilities, and misconfigured websites related to a target domain.
Reconnaissance Techniques
Whois enumeration and Google hacking are powerful reconnaissance techniques that can be employed to gather information about a target organization.