Post Page Advertisement [Top]



Click here to send WhatsApp On Unsaved Mobile Numbers For Free

Ethical Hacking: Linux, Windows & macOS Fundamentals for Ethical Hackers | Day 3
Ethical Hacking

🛡️ Ethical Hacking — Day 3

Linux, Windows & macOS Fundamentals for Ethical Hackers

⚠️ LEARNING PURPOSE ONLY: This tutorial is strictly for educational and defensive cybersecurity learning. Perform practical exercises only on computers, virtual machines, applications, networks, or labs that you own or have explicit permission to test. Never use these commands to access or disrupt unauthorized systems.

Welcome to Day 3 of the Ethical Hacking Learning Series.

On Day 2, we learned how devices communicate through IP addresses, ports, DNS, TCP/UDP, and gateways. Today, we'll learn how to work with the three major operating-system environments you'll encounter in cybersecurity: Linux, Windows, and macOS.


🎯 Day 3 Learning Objectives

Today you'll learn:

  • Operating-system fundamentals

  • Files and directories

  • Users and groups

  • File permissions

  • Processes

  • Services

  • Environment variables

  • Command-line navigation

  • System information commands

  • Basic security-oriented commands

  • Equivalent commands across Linux, Windows, and macOS

By the end of today, you should be comfortable opening a terminal and investigating your own computer.


1. Why Operating Systems Matter in Ethical Hacking

An ethical hacker needs to understand how operating systems work because vulnerabilities often depend on:

  • Users

  • Permissions

  • Processes

  • Services

  • Files

  • Network connections

  • Installed software

  • System configurations

For example:

Application
     ↓
Operating System
     ↓
Kernel
     ↓
Hardware

Understanding this structure helps you understand where security problems can occur.


2. Linux vs Windows vs macOS

FeatureLinuxWindowsmacOS
Command line    Terminal    CMD / PowerShell            Terminal
Common shell    Bash/Zsh    PowerShell            Zsh
Filesystem root  /  C:\      /
User management    Users/Groups    Users/Groups            Users/Groups
Process tools  ps, top  Get-Process, tasklist      ps, top
Network tools  ip, ss  ipconfig, netstat      ifconfig, netstat
Package ecosystem    apt/dnf/pacman etc.    winget            Homebrew commonly used

The commands differ, but the concepts are very similar.


3. Understanding the File System

A file system organizes information on your computer.

Linux/macOS

The filesystem begins at:

/

Example:

/
├── home
├── etc
├── var
├── tmp
└── usr

Windows

Windows commonly uses drive letters:

C:\
├── Users
├── Windows
├── Program Files
└── ProgramData

The important security concept is:

Where a file is located and who can access it matters.


🐧 Linux Practical

Open your Terminal.

Step 1 — Find your current directory

pwd

Example:

/home/user

pwd means Print Working Directory.


Step 2 — List files

ls

For detailed information:

ls -la

You may see:

drwxr-xr-x
-rw-r--r--

We'll learn exactly what these permissions mean shortly.


Step 3 — Move between directories

cd /tmp

Then:

pwd

Return to your home directory:

cd ~

Go one level up:

cd ..

Step 4 — Create a practice directory

mkdir ethical-hacking-day3

Enter it:

cd ethical-hacking-day3

Create a file:

touch notes.txt

Check it:

ls -l

🪟 Windows Practical

Open PowerShell.

Step 1 — Find your current directory

Get-Location

Short form:

pwd

Step 2 — List files

Get-ChildItem

Short form:

ls

Step 3 — Change directory

Set-Location $env:TEMP

or:

cd $env:TEMP

Step 4 — Create a practice directory

New-Item -ItemType Directory ethical-hacking-day3

Enter it:

cd ethical-hacking-day3

Create a file:

New-Item notes.txt

Check it:

Get-ChildItem

🍎 macOS Practical

Open Terminal.

Step 1 — Current directory

pwd

Step 2 — List files

ls -la

Step 3 — Navigate

cd /tmp

Then:

pwd

Return home:

cd ~

Step 4 — Create a practice directory

mkdir ethical-hacking-day3

Enter it:

cd ethical-hacking-day3

Create a file:

touch notes.txt

Check:

ls -l

🔐 4. Understanding Users

Operating systems use user accounts to control access.

A computer may have:

Administrator / Root
       │
       ├── User A
       ├── User B
       └── Service Accounts

An important security principle is:

Principle of Least Privilege

Users and applications should have only the permissions they actually need.

For example, a normal application generally shouldn't require unrestricted administrator/root privileges.


🐧 Linux: Who Am I?

Run:

whoami

Find user and group information:

id

You may see:

uid=1000(user) gid=1000(user)

🪟 Windows: Who Am I?

PowerShell:

whoami

You can also inspect your current user:

$env:USERNAME

🍎 macOS: Who Am I?

Terminal:

whoami

And:

id

🔐 5. File Permissions

File permissions are extremely important in cybersecurity.

Linux/macOS commonly use:

r = read
w = write
x = execute

Example:

-rwxr-xr--

Conceptually:

Owner       Group       Others
rwx         r-x         r--

This means:

  • Owner → read/write/execute

  • Group → read/execute

  • Others → read

Understanding permissions will become especially important when we study Linux privilege escalation later.


🐧 Linux Permission Practical

Inside your Day 3 directory:

ls -l notes.txt

Change permissions on your practice file:

chmod 600 notes.txt

Check again:

ls -l notes.txt

The file should now be accessible only to your user under the normal Unix permission model.

Restore a more common permission example

chmod 644 notes.txt

Check:

ls -l notes.txt

⚠️ Only modify permissions on files you own or are authorized to administer.


🍎 macOS Permission Practical

macOS also uses Unix-style permissions.

Run:

ls -l notes.txt

Then:

chmod 600 notes.txt

Check:

ls -l notes.txt

Restore:

chmod 644 notes.txt

🪟 Windows Permissions

Windows uses a different permissions model based heavily on NTFS Access Control Lists (ACLs).

View permissions for your practice file/directory:

Get-Acl .\notes.txt

You can also inspect the directory:

Get-Acl .

Don't modify permissions yet. Today we're learning to observe and understand them.


⚙️ 6. Processes

A process is a running instance of a program.

For example:

Browser
   ↓
Process
   ↓
Operating System
   ↓
CPU / Memory

Security professionals need to understand processes because malicious software, vulnerable applications, and legitimate services all run as processes.


🐧 Linux Processes

Run:

ps

For a broader view:

ps aux

You can also use:

top

Exit top with:

q

🪟 Windows Processes

PowerShell:

Get-Process

Find a specific process:

Get-Process | Where-Object {$_.ProcessName -like "*chrome*"}

You can also use:

tasklist

🍎 macOS Processes

Terminal:

ps aux

Interactive process view:

top

Exit with:

q

🛠️ 7. Services

A service is a background program that performs a specific function.

Examples:

Web server
Database server
SSH server
Print service
Update service

Services are important to security because an unnecessary or vulnerable service can increase the attack surface.


🐧 Linux Services

On many systemd-based distributions:

systemctl --type=service --state=running

You can inspect a specific service if you know its name:

systemctl status <service-name>

Don't stop or modify services during this exercise.


🪟 Windows Services

PowerShell:

Get-Service

To see running services:

Get-Service | Where-Object {$_.Status -eq "Running"}

🍎 macOS Services

macOS service management differs from Linux.

You can inspect running processes:

ps aux

You can also inspect launch services with:

launchctl list

Today we're only observing the configuration.


🌎 8. Environment Variables

Environment variables store configuration information used by applications and the operating system.

Examples include:

PATH
HOME
USER
TEMP

They are particularly important when working with:

  • Programming

  • Shell scripts

  • Application configuration

  • Development environments

  • Security testing


🐧 Linux

echo $PATH

View all environment variables:

env

🪟 Windows PowerShell

$env:Path

View environment variables:

Get-ChildItem Env:

🍎 macOS

echo $PATH

And:

env

🧪 Day 3 Cross-Platform Practical Lab

Create a directory called:

ethical-hacking-day3

Inside it, create:

system-info.txt

Then collect basic information about your own machine.

Linux

uname -a
whoami
pwd
ip addr
ps

Windows PowerShell

Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion
whoami
Get-Location
ipconfig
Get-Process

macOS

sw_vers
whoami
pwd
ifconfig
ps aux

The purpose is to learn how to inspect your own operating system.


🔍 Day 3 Security Mindset

When looking at a system, start asking:

Users

Who has access?

Files

Who can read or modify this?

Processes

What is currently running?

Services

What network-facing or background services exist?

Permissions

Does this application have more privileges than necessary?

Configuration

Are important settings exposed or misconfigured?

These questions form the foundation of security assessment.


📝 Day 3 Assignment

Answer these questions:

1.

What is the difference between a process and a service?

2.

What does the principle of least privilege mean?

3.

What do r, w, and x represent in Unix permissions?

4.

What command displays your current username on Linux, Windows, and macOS?

5.

What command can you use to view running processes on each operating system?

6.

What is an environment variable?

7.

Why are file permissions important for cybersecurity?

8.

What is the difference between Linux/macOS permissions and Windows ACLs?


🧪 Day 3 Challenge

On your own computer, find:

✅ Current username
✅ Operating system version
✅ Current working directory
✅ Network interface
✅ At least 5 running processes
✅ At least 3 running services
✅ PATH environment variable

Then write down what each item means.

Do not publish your complete system information, usernames, IP addresses, process lists, or other potentially sensitive information online.


⚠️ Ethical Hacking Reminder

LEARNING PURPOSE ONLY: Today's commands are intended for learning and authorized system administration/security practice. Use them only on systems you own or are explicitly authorized to administer or test. Never use administrative commands, permission changes, process manipulation, or service controls against unauthorized systems.


✅ Day 3 Summary

Today you learned:

  • Operating-system fundamentals

  • Linux filesystem

  • Windows filesystem

  • macOS filesystem

  • Users and groups

  • File permissions

  • Windows ACLs

  • Processes

  • Services

  • Environment variables

  • Basic system investigation

  • Equivalent commands across Linux, Windows, and macOS

The goal isn't to memorize hundreds of commands.

Understand what the command is doing, why you're running it, and what the result tells you.


🔜 Day 4 — Command Line & Shell Fundamentals

Tomorrow we'll go deeper into:

🐧 Linux: Bash commands and shell navigation
🪟 Windows: PowerShell fundamentals
🍎 macOS: Zsh/Terminal fundamentals

We'll cover:

  • cd, ls, pwd

  • Files and directories

  • Searching for files

  • Viewing file contents

  • Pipes |

  • Redirection >, >>

  • Command chaining

  • Searching command output

  • Basic shell scripting

  • Practical exercises on all three operating systems

🔐 Learn → Practice → Understand → Secure.

No comments:

Post a Comment

Bottom Ad [Post Page]

rrkksinha.