Hacker Terminal Cheat Sheet: Essential Commands for Ethical Hacking
The command line interface (CLI) is the fundamental tool in the arsenal of any cybersecurity professional, ethical hacker, or penetration tester. While powerful graphical tools exist, understanding and mastering the terminal allows for greater flexibility, automation, and a deeper understanding of system interactions.
This cheat sheet provides a quick reference to essential commands across different operating systems, categorized by their typical use in a penetration testing lifecycle. Please note: This guide is intended for educational purposes only, for use in authorized penetration testing, security auditing, and learning environments. Misuse of these commands against systems without explicit permission is illegal and unethical.
Linux (Kali Linux, Ubuntu, etc.)
Linux distributions like Kali Linux are the go-to for most cybersecurity professionals due to their robust toolsets and open-source nature.
I. Information Gathering & Reconnaissance
Command
Description
Example Usage
whoami
Displays the current effective username.
whoami
uname -a
Shows detailed Linux kernel information (OS, hostname, kernel).
uname -a
ls / ls -la
List directory contents (-a for hidden, -l for details).
ls -la /home/user/
pwd
Print working directory (shows current location).
pwd
cat <file>
Displays the content of a file.
cat /etc/passwd
grep <pattern> <file>
Searches for patterns in files.
grep "admin" /var/log/auth.log
find <path> -name <name>
Searches for files and directories.
find / -name "config.php"
history
Shows command history of the current user.
history
ps aux
Displays all running processes on the system.
ps aux
crontab -l
Lists scheduled cron jobs for the current user.
crontab -l
df -h
Reports file system disk space usage (-h for human-readable).
Downloads files from the web (may need to be installed via Homebrew).
wget http://example.com/malware
scp <source> <destination>
Securely copies files between hosts.
scp user@remote:/path/file .
Important Ethical Hacking Principles:
Always Get Permission: Never use these commands on systems or networks you do not own or have explicit written permission to test. Unauthorized access is illegal.
Scope Definition: Clearly define the scope of your penetration test before you begin.
Documentation: Document every command, every finding, and every step of your process.
Legal & Ethical Boundaries: Operate strictly within legal and ethical boundaries.
Knowledge is Power (and Responsibility): Understand the impact of each command before you execute it.
This cheat sheet serves as a starting point. The world of ethical hacking is vast and constantly evolving. Continuous learning, practice in controlled environments, and a strong ethical compass are the true keys to becoming a proficient and responsible cybersecurity professional.