Week 3: Commander of the Console

Path: Security Fundamentals | Module: 3 of 4

Leaving the Mouse Behind

Graphical User Interfaces (GUIs) are easy, but Command Line Interfaces (CLIs) are powerful. In security, you will often work on servers that have no screen, or write scripts to automate tasks across thousands of machines. You must know the shell.

1. Navigation

How to move around without clicking folders.

  • pwd (Print Working Directory): Where am I?
  • ls (List): What files are here? (Windows: dir)
  • cd (Change Directory): Go to a folder. e.g., cd /home/user/Documents

2. File Manipulation

  • touch filename.txt: Create an empty file.
  • cp file newfile: Copy a file.
  • mv file folder/: Move (or rename) a file.
  • rm file: Remove (delete) a file. Warning: There is no Recycle Bin in the CLI. Deleted is gone forever.

3. Permissions (Linux)

Who is allowed to touch this file?

  • Read (r): View contents.
  • Write (w): Edit contents.
  • Execute (x): Run as a program.
  • chmod: Change permissions. e.g., chmod 700 secret.txt (User can do everything, everyone else can do nothing).

🔬 Lab Exercise: Bandit Wargame

Objective: Practice your skills in a gamified environment.

  1. Go to OverTheWire.org and find the "Bandit" wargame.
  2. It connects via SSH (Secure Shell).
  3. Use your terminal to login: ssh bandit0@bandit.labs.overthewire.org -p 2220
  4. Password is bandit0.
  5. Your goal: finding the password for the next level hidden in the file system. Try to reach Level 5!