🛡 Kali Linux Command Line Laboratory
This lab provides the most important Kali Linux commands used in cybersecurity, penetration testing, and system administration.
1. Basic Navigation Commands
pwd
ls -la
cd /etc
clear
- pwd – Print working directory
- ls – List files
- cd – Change directory
- clear – Clear terminal screen
Exercise
- Navigate to
/var/log
- List all hidden files
- Return to your home directory
Simulation
kali@kali:~$ cd /var/log
kali@kali:/var/log$ ls -la
kali@kali:/var/log$ cd ~
2. File and Directory Management
mkdir testlab
touch file1.txt
cp file1.txt backup.txt
mv backup.txt /tmp/
rm file1.txt
- mkdir – Create directory
- touch – Create file
- cp – Copy files
- mv – Move/rename files
- rm – Remove files
Exercise
- Create a directory called
pentest
- Create three files inside it
- Delete one file
3. Permissions & Ownership
ls -l
chmod 755 script.sh
chown root:root script.sh
- chmod – Change permissions
- chown – Change ownership
Exercise
- Create a script file
- Make it executable
- Verify permissions
4. User & System Information
whoami
id
uname -a
hostname
- whoami – Current user
- id – User ID info
- uname – System details
Exercise
Identify kernel version and CPU architecture.
5. Networking Commands (Reconnaissance)
ip a
ip route
ping -c 4 google.com
netstat -tulnp
- ip a – Network interfaces
- ping – Connectivity test
- netstat – Open ports
Exercise
- Find your IP address
- Identify listening ports
6. Process Management
ps aux
top
htop
kill -9 PID
- ps – Process status
- top/htop – Live monitoring
- kill – Terminate process
Exercise
Identify the process consuming the most memory.
7. Package Management
apt update
apt upgrade
apt install nmap
- apt – Install and manage tools
Exercise
Search for a password cracking tool.
8. Security & Pentesting Commands
nmap -sV 192.168.1.1
hydra -l admin -P passwords.txt ssh://192.168.1.10
msfconsole
- nmap – Network scanning
- hydra – Brute force attacks
- msfconsole – Metasploit framework
Exercise
Perform a service version scan on a local test VM.