Chapter 2: Explore the OS and Command Line
Linux vs. Windows: OS Fundamentals 🐧
- Linux: The preferred operating system for many pentesters because of its open-source nature, security, and flexibility. Kali Linux is a Debian-based Linux distribution specifically designed for pentesting.
- Windows: Commonly used in corporate environments, making it important to understand for pentesting. Tools like PowerShell offer powerful scripting capabilities.
- File System Differences:
- Linux: Uses a hierarchical directory structure starting from the root (
/). Files and directories are case-sensitive. - Windows: Uses a drive-letter based structure (e.g.,
C:\). Files and directories are case-insensitive.
- Linux: Uses a hierarchical directory structure starting from the root (
Command Line Essentials 💻
- Linux Commands:
ls: Lists files and directories in the current directory.cd: Changes the current directory.cp: Copies files or directories.mv: Moves or renames files or directories.grep: Searches text using patterns. Extremely useful for filtering output.chmod: Changes file permissions. Essential for securing files.
- Practical Exercise:
- Use
cdto navigate through directories andlsto list contents. - Create, copy, and move files using
touch,cp, andmv. - Use
grepto search for specific text in files, such as finding a specific string in a log file.
- Use
Setting Up Kali Linux 🔧
- Installation: Download the Kali Linux ISO and set it up on a virtual machine using software like VirtualBox or VMware.
- Virtual Machines (VMs): VMs allow you to run multiple operating systems on one physical machine. They’re great for testing without risking your primary OS.
- Exploring Kali:
- Familiarize yourself with the pre-installed tools like Nmap, Metasploit, and Burp Suite.
- Customize your environment by setting up your terminal, installing additional tools, and updating your system.
Command Line Challenges 🧑💻
- Exercises:
- Complete a series of command-line challenges that involve navigating directories, managing files, and using
grepto filter outputs. - Practice using
chmodto modify file permissions and understand how Unix file permissions work (e.g.,chmod 755).
- Complete a series of command-line challenges that involve navigating directories, managing files, and using
Pro Tip: The command line is your gateway to controlling systems like a pro. Get comfortable here—it’s where the magic happens! 🧙♂️