Linux Fundamentals

Why Linux for Hackers

Why offensive tooling is Linux-first, the distros that matter (Kali, Parrot), and how to think in a shell.

Easy 12 minintrokalishell

If you want to hack (ethically), you'll spend most of your career inside a Linux terminal - and that's not arbitrary. The most powerful offensive and defensive tools in existence were built for Linux, run best on Linux, and often only exist on Linux.

Ethics First - Every Lesson, Every Time

Everything you learn here is for authorized testing, CTF competitions, and understanding how to defend systems. Running these techniques against systems you do not own or have explicit written permission to test is illegal under laws like the Computer Fraud and Abuse Act (CFAA) and equivalents worldwide. When in doubt: don't touch it without permission.

Why Hackers Live in Linux

When a penetration tester fires up their machine, they're not opening Windows Explorer. They're dropping into a terminal. Here's why:

The toolchain is there. Nmap, Metasploit, Burp Suite, Wireshark, Gobuster, SQLMap, Hydra, John the Ripper, Hashcat - the entire offensive security ecosystem was built on and for Linux. Many tools exist only as command-line utilities that assume a POSIX environment.

Servers run Linux. The target you're testing almost certainly runs Linux. Web servers, cloud instances, Docker containers, routers, IoT devices - Linux is everywhere in production infrastructure. Understanding the OS you're attacking means understanding how it stores credentials, runs services, manages users, and can be misconfigured.

The shell is a superpower. A Linux shell isn't just a way to run programs. It's a programming environment. You can chain commands, automate recon, parse gigabytes of logs in seconds, and build attack pipelines with a few lines of bash. GUI tools will always lag behind what a skilled shell user can do.

Open source means you can read what's happening. When a tool behaves unexpectedly, you can read the source. When a vulnerability is published, you can read the proof-of-concept. The transparency of Linux is a feature, not a limitation.

The Defender Also Needs This

Blue teamers, SOC analysts, and incident responders need exactly the same Linux skills. Investigating a compromised server, reading auth logs, hunting for persistence mechanisms - all of it happens in a terminal. This isn't just offensive knowledge.

What Is a Shell, Actually?

A shell is a program that reads your text commands and passes them to the operating system kernel to execute. When you type ls and hit enter, the shell interprets that, finds the ls binary, runs it, and shows you the output.

The most common shell on Linux is bash (Bourne Again SHell). You'll also encounter zsh (default on modern macOS and Kali Linux since 2020), fish, and dash. For our purposes, bash and zsh are nearly identical - anything you learn for one works for the other.

A terminal emulator (or just "terminal") is the window that hosts the shell. GNOME Terminal, Konsole, Alacritty, iTerm2 - these are all terminal emulators. The shell lives inside the terminal the way a browser engine lives inside a browser window. You interact with the terminal, but you're really talking to the shell.

You type Terminal Shell (bash/zsh) → Kernel → Hardware

                    This is where
                    the magic is

The command prompt is the text the shell shows before waiting for your input. On a default Kali system it looks like:

kali@vr4cs: ~
 

The ~ means you're in your home directory. The $ means you're a regular user. If you see #, you're root (superuser) - handle with care.

Distros That Matter for Security

A Linux distribution (distro) bundles the Linux kernel with a package manager, desktop environment, and pre-installed software into something you can actually install and use. There are hundreds of distros. For security work, a few dominate:

Kali Linux

The industry standard for offensive security. Maintained by Offensive Security (the folks behind OSCP/PWK). Ships with 600+ pre-installed security tools. The apt package manager gives you access to even more. Almost every tutorial, course, and certification lab assumes Kali.

When to use it: Active pentesting, CTFs, learning attack techniques, certification prep.

Heads up: Kali is a rolling release - tools and the system itself update continuously. It's not meant to be your daily driver for writing code. It's a specialized toolkit OS.

Parrot OS

A lighter-weight alternative to Kali with a focus on anonymity tools (Tor, AnonSurf) alongside the standard pentest suite. Ships with a friendlier default desktop. Growing in popularity for learners who find Kali's raw environment intimidating.

When to use it: Same scenarios as Kali, or when you want a more polished experience without sacrificing tooling.

Ubuntu (and Debian)

The most widely deployed Linux family in the world. Ubuntu is what most production servers, cloud instances, and Docker containers run. Learning Ubuntu means learning the environment you'll actually encounter as a target or as a sysadmin/developer who needs to harden systems.

When to use it: Understanding how real servers are configured, learning system administration, building your own tools.

Start with Kali, but Learn Ubuntu Too

For this course, Kali is your primary environment. But pay attention to how things differ on a standard Ubuntu server - that's what you'll be testing in the real world.

The Hacker Mindset with Linux

This is subtle but important: good Linux security practitioners don't just memorize commands. They develop a mental model of how the system works so they can reason about what they don't know.

When you see a new system, you ask:

  • What users exist? What can each do?
  • What processes are running? What network connections are open?
  • What files are world-readable or world-writable?
  • What's running as root that shouldn't be?
  • What configurations might have been left at insecure defaults?

Every Linux fundamental you learn in this module is something you'll use both to understand a target and to protect a system you're responsible for. Attack and defense are two sides of the same coin. The attacker who understands /etc/sudoers is the defender who knows how to lock it down.

Getting a Linux Environment

You need a Linux box to practice. Here are your real options:

Run Kali inside a VM on your Windows or macOS machine. The hypervisor acts as a layer between your host OS and the VM.

VirtualBox (free) or VMware Workstation Player (free for personal use) are both solid choices. Offensive Security provides official Kali Linux VM images - pre-built, just import and run.

Advantages:

  • Isolated: mistakes in the VM don't affect your host
  • Snapshots: break something? Roll back instantly
  • Network control: you can simulate isolated lab networks

Option 2: WSL2 (Windows Subsystem for Linux)

If you're on Windows and want to get started right now, WSL2 gives you a real Linux kernel running inside Windows. Install Kali from the Microsoft Store:

wsl --install -d kali-linux

WSL2 is excellent for learning commands and writing scripts. Its limitations show up with advanced networking tasks (raw sockets, monitor mode WiFi) - you'll want a full VM for those later.

Option 3: Dual Boot

Install Linux alongside Windows on the same machine. Maximum performance, full hardware access. Most disruptive to set up. Fine once you're committed, but a VM is better for beginners who might want to recover easily.

Option 4: Cloud VPS

Spin up a $5/month DigitalOcean or Linode Ubuntu instance. Great for practicing server administration. Not ideal as your primary attack machine (egress traffic restrictions, terms of service), but excellent for understanding what a real server looks like from the inside.

This Course Assumes Kali or Any Debian-Based Distro

All examples use Kali/Ubuntu/Debian conventions - apt for packages, bash/zsh for shell, systemd for services. The concepts transfer to any Linux, but flag names and paths can differ slightly on Red Hat-based systems (Fedora, CentOS, RHEL) which use dnf and sometimes different config locations.

Your First Terminal Session

Once you have Linux running, open a terminal and try these to verify everything is working:

kali@vr4cs: ~
 

Don't worry if you don't understand all of that output yet. By the end of this module, every part of it will make sense.

Key Takeaways

  • Linux dominates servers, networking infrastructure, and security tooling - learning it is non-negotiable for both offensive and defensive security work.
  • A shell (bash/zsh) interprets your commands and talks to the OS kernel. A terminal is the window that hosts the shell.
  • Kali Linux is the standard offensive security distro; Ubuntu represents the servers you'll actually be targeting or defending.
  • Get Linux running via VM (best for security labs), WSL2 (best for quick start on Windows), or a cloud VPS.
  • The mindset matters: use your Linux knowledge to reason about how systems can be misconfigured, not just to memorize commands.