🛡️

Linux Fundamentals for Ethical Hacking

Mar 9, 2025

Linux for Ethical Hackers - Lecture Notes

Instructor Introduction

  • Name: Heath Adams
  • Position: CEO of TCM Security
  • Experience: Ethical hacker, penetration testing, and training organization.
  • Social Media: Follow on social platforms for updates.

Course Overview

  • Focus: Understanding Linux as an ethical hacker.
  • Target Audience: Beginners with no prior Linux experience.
  • Key Topics Covered:
    • Installing and running Kali Linux
    • Navigating the file system
    • Common network commands
    • File operations (create, view, edit)
    • Managing services
    • Writing Bash scripts

Course Updates

  • Previous Course: Taught for FreeCodeCamp two years ago.
  • Current Edition: Using Kali Linux 2022.2, latest tools and materials.
  • TCM Security Academy: Offers comprehensive courses on ethical hacking and Linux.

Virtual Machines (VMs)

  • Definition: A machine on top of another machine (e.g., running Windows 10 on Windows 10).
  • Usage: Building labs without needing extensive hardware.
  • Requirements:
    • Minimum 8GB RAM for basic usage.
    • 16GB RAM recommended for Active Directory portions.
  • Software Options:
    • VMware Workstation Player (Windows/Linux)
    • Oracle VirtualBox (Mac)

Installing Virtual Machine Software

  • VMware Workstation Player: Download from official website.
  • Oracle VirtualBox: Available for Mac users.
    • Install steps: Accept agreements, finish installation, restart if needed.

Installing Kali Linux

  • Download: Access Kali Linux from the official website.
    • Choose the version for VMware or VirtualBox.
    • Extract files using 7-zip.
  • Loading Kali:
    • Open the VM in VMware/VirtualBox.
    • Edit VM settings (RAM, network settings).
    • Login credentials: Username: kali, Password: kali.

Exploring Kali Linux Interface

  • Familiarize with the Kali Linux environment.
  • Navigating applications: Terminal, text editor, web browser, etc.
  • Key utilities for ethical hacking embedded in the OS.

Terminal Commands Overview

Basic Navigation

  • Print Working Directory: pwd
  • Change Directory: cd [directory]
  • List Files: ls
  • Clear Screen: ctrl + l
  • Make Directory: mkdir [directory_name]
  • Remove Directory: rmdir [directory_name]

File Operations

  • View File Contents: cat [filename]
  • Copy Files: cp [source] [destination]
  • Move Files: mv [source] [destination]
  • Remove Files: rm [filename]
  • Edit Files: Use editors like nano or graphical editors like mousepad.

User Management

  • Create User: sudo adduser [username]
  • View Users: Check /etc/passwd.
  • Edit Sudo Privileges: Modify /etc/sudoers.

Networking Commands

  • View IP Configuration: ip a or ifconfig
  • Ping Command: ping [ip_address]
  • Check Routing Table: ip r or route
  • Check ARP Table: arp -a

Services Management

  • Start/Stop Services: sudo service [service_name] start/stop
  • Enable Service on Boot: sudo systemctl enable [service_name]
  • Apache Web Server: Usage for hosting files (test with http://[your_ip_address]).

Tool Installation and Updates

  • Update System: sudo apt update && sudo apt upgrade
  • Install Tool: sudo apt install [tool_name]
  • Using Git: git clone [repository_link] for tools from GitHub.

Bash Scripting Introduction

  • Creating Scripts: Use nano [script_name.sh].
  • Shebang: Include #!/bin/bash at the top of scripts.
  • For Loops: Iterate over IP addresses for ping sweeps or other tasks.

Example: IP Sweep Script

  • Using loops and commands for automation: #!/bin/bash for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ':'; done

Conclusion

  • Course Completion: Thank you for participating in the Linux for Ethical Hackers course.
  • Further Learning: Consider subscribing for more courses and content on ethical hacking and related topics.