Skip to content

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.

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 cd to navigate through directories and ls to list contents.
    • Create, copy, and move files using touch, cp, and mv.
    • Use grep to search for specific text in files, such as finding a specific string in a log file.

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 grep to filter outputs.
    • Practice using chmod to modify file permissions and understand how Unix file permissions work (e.g., chmod 755).

Pro Tip: The command line is your gateway to controlling systems like a pro. Get comfortable here—it’s where the magic happens! 🧙‍♂️