Network Security — Protocols, Packet Analysis & Firewalls
Press Next → or use ← → arrow keys
Network Security Basics
Confidentiality — only the right eyes. Integrity — nothing silently altered. Availability — up when needed.
Common Network Threats You're Defending Against
Defence in Depth — Layered Rings
An attacker has to defeat every layer to reach the data. Perimeter (firewalls) → Network (segmentation, IDS/IPS) → Endpoint (EDR/AV) → Application (WAF, auth) → Data (encryption, DLP). Assume every layer will fail eventually — the next ring is there when it does.
Secure Communication Protocols — the Map
| Protocol | OSI Layer | Protects | Typical use |
|---|---|---|---|
| TLS / SSL | 6 · Presentation | Web, email, APIs | Wraps HTTP → HTTPS, SMTP → SMTPS |
| HTTPS | 7 · Application (over TLS) | Web traffic | Every modern website |
| SSH | 7 · Application | Remote shell + tunnels | Admin access to servers |
| IPsec | 3 · Network | Site-to-site & remote VPNs | Encrypts entire IP payload |
| OpenVPN · WireGuard | App-level VPN | Remote access | Encrypted tunnel to corp network |
| WPA2 · WPA3 | 2 · Data Link | Wi-Fi | Home + enterprise Wi-Fi |
| SFTP · SCP | 7 (over SSH) | File transfer | Replace legacy FTP |
| DoH · DoT | 7 (DNS over TLS/HTTPS) | DNS queries | Encrypt DNS from ISP snooping |
| Kerberos | 5–7 | Authentication | Windows Active Directory |
| SPF · DKIM · DMARC | 7 (email) | Email spoofing | Anti-phishing |
TLS / SSL — the Backbone of HTTPS
🔒 Confidentiality — symmetric encryption (AES-GCM, ChaCha20)
🪪 Authentication — X.509 certificate signed by a trusted CA
✅ Integrity — MACs verify nothing was tampered with in transit
The TLS Handshake — Step by Step
Hello ➜ Certificate ➜ verify + key ➜ change cipher ➜ Finished. From then on every byte — HTTP, email, whatever — is encrypted with the shared symmetric key. TLS 1.3 collapses this into 1 round trip.
HTTPS & SSH — TLS in Action
ssh-keygen -t ed25519 generates a modern keypair.IPsec & VPN — Encrypting the Network Layer
| Protocol | Where | Notes |
|---|---|---|
| IPsec (ESP) | L3 tunnel | Classic site-to-site VPN · encryption + integrity |
| IPsec (AH) | L3 tunnel | Authentication only (rarely used alone) |
| IKEv2 | L3 control plane | Sets up IPsec keys and policies |
| OpenVPN | App-level (TLS-based) | Popular open-source SSL VPN · TCP/UDP |
| WireGuard | L3 · modern | Small codebase · very fast · ChaCha20 crypto |
| L2TP / PPTP | Legacy | PPTP is broken — don't use |
Wi-Fi Security — WEP → WPA → WPA2 → WPA3
| Standard | Year | Encryption | Status |
|---|---|---|---|
| WEP | 1997 | RC4 (40/104-bit key) | ❌ Broken — crackable in minutes |
| WPA | 2003 | TKIP + RC4 | ❌ Deprecated |
| WPA2 | 2004 | AES-CCMP (128-bit) | ⚠ Still common but KRACK-vulnerable |
| WPA3 | 2018 | AES-GCMP + SAE handshake | ✅ Current standard |
WPA2/3-Personal (PSK) — shared password. Fine for home. WPA2/3-Enterprise (802.1X) — each user has their own credentials via a RADIUS server. Standard in offices and universities.
Turn off WPS (weak). Change the default admin password on the router. Prefer WPA3 if all your devices support it. Hide/disable "guest" networks that aren't isolated.
Email Security — SPF · DKIM · DMARC
none, quarantine, or reject — and sends you reports.Packet Analysis — the Doctor's Stethoscope
The industry-standard tool is Wireshark (GUI) —
tcpdump (CLI) is the terminal cousin.
Anatomy of a Captured Packet
Wireshark takes each frame and decodes it top-down: Ethernet → IP → TCP → TLS → HTTP. When TLS is used, the last two layers are encrypted — you can see the headers but not the message body.
Wireshark Filters — the 10 You'll Use Daily
Attacks You Can Spot in a Packet Capture
| Attack | Tell-tale signature in the capture |
|---|---|
| Port scanning | Many SYN packets to different ports from one IP · very few ACKs |
| SYN flood (DoS) | Huge burst of half-open SYNs from many IPs · no completions |
| ARP spoofing | Sudden ARP replies changing an IP → MAC mapping |
| DNS tunneling | Unusually long or high-frequency DNS TXT queries |
| Cleartext credentials | HTTP POSTs to /login, FTP PASS, Telnet payloads |
| C2 beaconing | Regular-interval HTTPS connections to unusual domains — same size, same timing |
| Data exfiltration | Large upload/outbound bytes on non-business hours or to strange geos |
"Is this traffic normal for this host at this time?" — the answer tells you if you have an incident. Baselining normal traffic patterns is what turns a packet capture into a security signal.
Firewalls — What They Actually Do
Five Major Firewall Types by Depth of Inspection
Deeper inspection = more security but more CPU and higher latency. Modern networks typically layer several types together (perimeter NGFW + host firewall + WAF for web apps).
Packet-Filtering & Stateful Firewalls
Examples: classic Cisco ACLs, iptables in stateless mode.
Examples: Linux
iptables/nftables with conntrack, pfSense, Windows Defender FW.Example: SOCKS proxy.
Almost every modern firewall is stateful by default. Stateless filtering is still used on router ACLs where CPU is limited or where session state doesn't matter (e.g. blocking RFC1918 spoofing at the ISP edge).
NGFW · UTM · WAF — Deep Inspection
Vendors: Palo Alto, Fortinet FortiGate, Cisco Firepower, Check Point.
Vendors: Sophos XG, WatchGuard, SonicWall.
Vendors: Cloudflare, AWS WAF, F5, Akamai, ModSecurity.
Examples: Windows Defender FW,
iptables/ufw, macOS PF firewall.Examples: Zscaler, Cloudflare Magic Firewall, Prisma Access.
Firewall Rules — Real Syntax Examples
Most specific first, broad deny last. Every firewall matches top-down and stops at the first hit. A wide "allow all" rule above your specific denies will silently break your whole policy.
Where Firewalls Sit — Perimeter, DMZ & Internal
Untrusted (internet) → DMZ (public-facing servers like web/mail — reachable but isolated) → Trusted (internal LAN). Two firewalls sandwich the DMZ so a compromised web server cannot pivot to the internal database.
Firewall Rule Design — Best Practices
Network Security Golden Rules — 1 to 4
Network Security Golden Rules — 5 to 8
You Now Have the Network Security Toolkit
Choose the right secure protocol for the job, read a packet capture and spot common attacks, design a firewall rule set that's default-deny + least-privilege, and place firewalls in a proper 3-zone topology with a DMZ. That's the working vocabulary of a network defender.
Fire up Wireshark on your own laptop and analyse real traffic. Build a pfSense / OPNsense home lab and write your own rules. Practise TryHackMe and HackTheBox network rooms. Study NIST SP 800-41 for firewall guidelines.
🛡️ End of tutorial · Press ← to review, or click Restart