Introduction
Kali Linux is a Debian-based Linux distribution specifically designed for penetration testing, ethical hacking, and cybersecurity research. Developed by Offensive Security, it comes pre-installed with over 600 security tools for various cyber-related tasks.
If you’re new to Kali Linux, this guide will help you understand its installation, basic commands, and essential tools to get started with penetration testing and ethical hacking.
1. Installing Kali Linux
There are multiple ways to install and use Kali Linux, depending on your needs.
a) Installation Methods
Bare Metal Installation – Install Kali Linux as the primary OS.
Dual Boot with Windows – Install Kali alongside Windows.
Virtual Machine (VM) – Run Kali inside a VM (using VMware or VirtualBox).
Live Boot (USB/DVD) – Run Kali without installation.
Windows Subsystem for Linux (WSL) – Use Kali inside Windows.
b) System Requirements
- Minimum: 2GB RAM, 20GB storage, Dual-core processor.
- Recommended: 4GB+ RAM, 50GB+ storage, Quad-core processor.
2. Kali Linux Interface & Basic Commands
Once installed, Kali Linux provides a GUI (Graphical User Interface) or CLI (Command Line Interface) depending on your preference.
a) Switching Between GUI & CLI
- To start GUI from CLI:
startx
- To switch to CLI from GUI: Press
Ctrl + Alt + F1
(orF2
toF6
).
b) Essential Linux Commands
Here are some essential terminal commands you’ll use in Kali Linux:
✅ Update and Upgrade System:
sudo apt update && sudo apt upgrade -y
✅ Check System Info:
uname -a
✅ List Files & Directories:
ls -la
✅ Navigate Through Directories:
cd /path/to/directory
✅ Create & Remove Files:
touch filename.txt # Create a file
rm filename.txt # Remove a file
✅ Create & Remove Directories:
mkdir newfolder # Create a directory
rmdir newfolder # Remove an empty directory
rm -rf newfolder # Remove a directory with contents
✅ Find IP Address:
ifconfig # Older command
ip a # Newer alternative
✅ Check Open Ports:
netstat -tulnp
✅ Kill a Process by ID:
kill -9 <PID>
✅ Change File Permissions:
chmod 777 filename # Full permissions for all
3. Essential Kali Linux Tools
Kali Linux is loaded with penetration testing tools for different security tasks.
a) Information Gathering Tools
🔹 Nmap – Network scanning and port scanning.
nmap -A target_ip
🔹 Maltego – Visual link analysis for intelligence gathering.
🔹 theHarvester – Collects emails, subdomains, and public info.
theHarvester -d example.com -l 100 -b google
b) Vulnerability Scanning Tools
🔹 Nikto – Web server vulnerability scanner.
nikto -h target_ip
🔹 OpenVAS – Full vulnerability assessment tool.
c) Password Cracking Tools
🔹 John the Ripper – Fast password cracker.
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
🔹 Hydra – Brute-force attack tool for login credentials.
hydra -L users.txt -P passwords.txt target_ip ssh
🔹 Hashcat – GPU-based password recovery tool.
d) Exploitation Tools
🔹 Metasploit Framework – Most powerful tool for exploitation.
msfconsole
🔹 sqlmap – Automated SQL injection tool.
sqlmap -u "http://target.com/page.php?id=1" --dbs
e) Wireless Hacking Tools
🔹 Aircrack-ng – Wi-Fi network penetration testing.
airmon-ng start wlan0
airodump-ng wlan0mon
🔹 Wifite – Automated Wi-Fi cracking tool.
4. Managing Users & Privileges
a) Creating a New User
sudo adduser username
b) Adding a User to the Sudo Group
sudo usermod -aG sudo username
c) Changing Password
passwd
d) Switch to Root User
sudo su
e) List All Users
cut -d: -f1 /etc/passwd
5. Network Security & Firewalls
a) Enable/Disable Firewall
sudo ufw enable
sudo ufw disable
b) Allow Specific Ports
sudo ufw allow 22/tcp # Allow SSH
sudo ufw allow 80/tcp # Allow HTTP
c) Check Firewall Status
sudo ufw status
6. File & Process Management
a) Check Running Processes
ps aux
top
htop # More interactive
b) Copy & Move Files
cp sourcefile destination
mv sourcefile destination
c) Securely Delete Files
shred -u filename
7. Customizing Kali Linux
a) Change Terminal Theme
Use Kali Tweaks:
kali-tweaks
b) Install Additional Software
Example: Install VS Code
sudo apt install code -y
Example: Install Google Chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
8. Updating & Maintaining Kali Linux
To keep Kali secure and up-to-date, run the following commands regularly:
sudo apt update && sudo apt upgrade -y
sudo apt autoremove -y
To update Kali’s hacking tools, run:
sudo apt install kali-linux-large -y
To check the current version of Kali Linux:
cat /etc/os-release