🌐 Network Basics

Before learning hacking or Capture The Flag (CTF), you need to understand how computer networks work. Almost every CTF challenge involves communication between computers over a network.


What is a Network?

A computer network is a collection of two or more devices connected together so they can exchange information.

Examples include:

  • Your home Wi-Fi
  • Your school's computer lab
  • The Internet

When you open Google in your browser, your computer sends a request across the network to Google's server, and Google's server sends the website back to you.

Types of Networks

Type Description
LAN Local Area Network (Home, School, Office)
WAN Wide Area Network (Internet)
MAN Metropolitan Area Network
PAN Personal Area Network (Bluetooth)

How Computers Communicate

Every device connected to a network has an IP Address. Think of an IP address as a house address. Without it, other computers would not know where to send data.

Example
  • Your Computer → 192.168.1.10
  • Router → 192.168.1.1
  • Google Server → 142.250.xxx.xxx

What is a Packet?

Information sent across a network is broken into small pieces called packets. Each packet contains:

  • Source IP
  • Destination IP
  • Protocol
  • Data

Wireshark is commonly used to inspect packets during CTF competitions.

Common Protocols

Protocol Port Purpose
HTTP 80 Web Traffic
HTTPS 443 Secure Web
SSH 22 Remote Login
FTP 21 File Transfer
DNS 53 Domain Name Resolution

Useful Networking Commands

ipconfig ping google.com tracert google.com nslookup google.com netstat -ano

These commands are frequently used during networking and CTF challenges to gather information about systems and troubleshoot connectivity.

Summary

  • ✔ A network connects multiple devices.
  • ✔ Every device has an IP address.
  • ✔ Data travels in packets.
  • ✔ Protocols define communication rules.
  • ✔ Ports identify services running on a device.