"Command Line Isn't Like the Movies" β The Reality of Hacking
In movies, you often see hackers breaking into systems using:
90%+ of hacking is done in text-only terminals
Youβll usually not get access to full desktops (like RDP or VNC)
Instead, you exploit a vulnerability and get a shell (command-line access)
You exploit a vulnerability and get a reverse shell:
nc -lvnp 4444 # Listen for a shell
Then the victim system connects back to you, giving you:
$ whoami
www-data
$ uname -a
No GUI. Just terminal commands.
Linux File System β What You Need to Know as a Hacker
Understanding the Linux file system is critical in pentesting, because after gaining shell access, you need to:
Pivot to other users or systems
Common Directories Explained:
Path
Description & Why It Matters
Home of the root user β check here for flags or secrets
Contains regular usersβ folders (e.g. /home/bob) β look for .ssh keys, history, passwords
Holds config files like passwd (usernames) and shadow (password hashes)
System commands like ls, rm, ifconfig, iptables β often used for privilege escalation
Holds extra software (user-installed) β look here if something custom is installed
Web servers like Apache store files here (/var/www/html) β look for webshells or uploads
Temp files β sometimes reverse shells or scripts are stored here
Device files β usually not useful unless you're exploiting the kernel
Runtime info about processes β great for manual process inspection
If other drives are mounted, check here
Kernel-related stuff β usually not touched in most CTFs or basic pentests
Linux Basics You Must Know for Pentesting
$ = you're a non-root user
# = you're root (admin of the system)
Default Shell in Kali
Newer: zsh with syntax highlighting, autocomplete
Use chsh -s /bin/bash to switch if you prefer bash.
Linux = Everything is a File
In Linux:
Devices (USB, disk) are files (/dev/sda)
Processes are files (/proc/[pid])
Sockets and pipes are also file-like
How to inspect unknown things:
Use:
Example:
Essential Help Commands
Opens the manual page for ls
Shows help/syntax for the command
A common flag for quick help: python3 --help
Navigation & Shortcuts
Stay in the current directory
Show present working directory
List all files, including hidden ones (. files)
Show all previously used commands
πΉ TIP: Use TAB to autocomplete and β to recall last commands.
Creating, Editing, and Managing Files
File/Folder Creation
touch notes.txt β Creates an empty file
mkdir exploits β Makes a new folder
Starts writing a file β press Ctrl+D to save
File/Folder Deletion & Copying
Remove an empty directory
Remove a folder and everything inside
Real-World Pentesting Examples:
After Shell Access:
ls -la β Look for hidden files
cat .bash_history β Find reused passwords
cd /etc β View passwd and shadow
cat /etc/shadow (if root) β Dump password hashes
grep -i password /var/www/html/* β Look for hardcoded credentials in web files
Summary for Learners
You'll use the terminal 90% of the time
Learn where sensitive data is stored
Understand $ vs # and when to sudo
Practice with cd, ls, touch, cat, history
Use man, --help, file, and TAB to learn faster
Last updated