Cyberlium

Ethical › Module 12 › Lesson 1

BeginnerModule 12Lesson 1/5

Firewalls as Policy, Not Magic

Allow/deny lists, stateful inspection — configure YOUR lab firewall.

15 min+40 XP4 quiz
Module progress1 of 5

Visual · firewall_policy_allow_deny

A firewall is a written allow/deny policy with memory of conversations (state). You configure a box YOU own. This course does not punch someone else's wall.

Opening

A firewall is a sentence about who may talk. Learning the sentence is literacy. Punching someone else's wall is a crime, not a homework trick.

Modules 1–11 kept every lab on a box you own: RoE, loopback scans, banners, CVE tickets, hashes as defense, malware hygiene, sniffing YOUR wire, humans as a channel to refuse, named exhaustion without floods, session tokens as cookies and flags. Module 12 maps the CEH v13 domain whose catalog title says “evading” IDS, firewalls, and honeypots. Cyberlium will not teach that hunt. In this path the domain is how those devices WORK so you can BUILD them on a lab VM you own. A firewall is not magic. It is an allow list, a deny list, and — on almost every modern host — stateful inspection that remembers an allowed conversation. You will write that policy for YOUR lab. You will not get a fragment recipe, a decoy scan, a timing template to hide, or a “punch the café gateway” one-liner. This is original Cyberlium teaching mapped to the CEH v13 IDS/firewall/honeypot domain — not official EC-Council training, not a cert, not exam dumps. Completing it does not grant CEH. A blog titled with a cert acronym is not this course. Next lesson names IDS and IPS as sensors you tune. Lesson 3 names honeypots as tripwires you will not raid. Lesson 4 is the only firewall lab: inbound allow for SSH/HTTP you actually need on a VM YOU own (or a labeled hypothetical you own), default deny, no needless 0.0.0.0. Here you lock the policy sentences.

1. A firewall is policy with a packet — not a force field

On a wire, a packet arrives with addresses and ports. A firewall is software or an appliance that compares that packet to a written policy and then allows, drops, or rejects it. “Written” is the whole point. If you cannot say who may speak to which port, the device is guessing, and guessing is how leftover SSH faces the café. In Cyberlium wording, you treat a firewall as a policy engine you configure on a host or network YOU administer — the same ownership line Module 1 drew. It is not a costume that makes unauthorized scanning quiet. It is not a puzzle you are assigned to defeat on a school edge. Skill does not create consent. A catalog module named “evading” does not create consent.

Packet filters look at each datagram in isolation: source, destination, protocol, port. That is enough to say “inbound TCP/22 from the world is denied.” It is not enough to say “this inbound packet is the reply to a web request I started.” Stateful inspection keeps a table of conversations it already allowed, so return traffic for YOUR outbound HTTPS can come back without you publishing a hole for every ephemeral port. That memory is why “allow established” is a defender sentence, not an attacker cheat. This lesson names the memory so you can turn it on for a lab you own. It does not teach you to forge state, fragment past the table, or ride an allowed port as a tunnel through someone else’s policy.

Command guide

Firewall is policy with a packet — WHAT/WHY

═══ COMMANDS ═══

Command — copy this

cat >> "$NOTES" << 'EOF'
firewall_means: policy decided, then packets compared
not_magic: a wide allow still fails closed
EOF

2. Allow lists, deny lists, and why default deny wins

An allow list (sometimes called a default-deny posture) says: only these sources, destinations, and ports may pass; everything else is refused. A deny list (default-allow with exceptions) says: block these known-bad things; everything else may pass. Deny lists feel busy and still leak: you cannot name every future abuse. Allow lists feel strict and match how production edges actually survive. For a lab VM you own, default deny inbound is the adult setting. Then you add the two or three inbound services you truly need — often SSH for you, HTTP or HTTPS if you run a teaching listener you started — and you write why each line exists. “I might need it later” is not a why. Module 4 already stopped leftover listeners. This module stops leftover holes.

Direction matters. Inbound is traffic someone sends toward a port on YOUR box. Outbound is traffic YOUR box starts. Many host firewalls allow outbound by default so your browser works, and still default-deny inbound so the café cannot knock on 22. That split is literacy. It is not a recipe for sneaking outbound callbacks past someone else’s wall. If you administer a VM, write inbound and outbound as separate columns. If you do not own a VM today, you still complete this lesson with a labeled hypothetical you own: “lab-vm-01 I would create,” ports you would allow, default deny. Do not “borrow” a campus edge because a hypothetical felt too small.

3. Stateful inspection: the firewall remembers the conversation

Stateless filtering is a bouncer who checks each guest’s badge and forgets them at the next door. Stateful inspection is a bouncer with a clipboard of who already came in with a ticket. After you (the host) start an outbound TCP handshake that the policy allows, the reply packets belong to that flow. The engine should not require you to publish inbound “any high port” just so HTTPS can complete. UDP and ICMP have shorter or different memory; the exact timers are vendor details you read in YOUR product’s docs when you own the box — not a timing-evasion lab. The teaching sentence is: state exists so legitimate replies can return without a wide inbound hole.

Host firewalls (Windows Defender Firewall, nftables/ufw on a Linux VM you created, pf on a BSD lab you own) and network firewalls (a hypervisor virtual switch ACL, a home-lab router you administer) both implement some mix of packet filter plus state. Application-layer gateways and web application firewalls sit higher and are named so you know they exist — Topic 10 and later web modules own app input. This lesson stays on ports and conversations. You will not get a “bypass stateful inspection with fragmented overlapping TCP” cookbook. If a sentence would help someone hide from a wall they do not own, it does not belong in your notes.

4. Configure YOUR lab — host firewall, hypervisor ACL, or a labeled hypothetical

Allowed surface for Module 12: a computer you own, a VM you created, a home-lab router whose admin you are, or a hypothetical labeled as yours. You may read the current host-firewall status on THAT box (Windows firewall profiles, ufw status, nft list on a machine you administer) as inventory — the same “settings you may change” rule as Module 6 hardening. You may write intended rules before you apply them. Lesson 4 is where you document the inbound allow list. You may not reconfigure a school firewall, a café gateway, a cloud tenant you do not own, or a roommate’s router “because they probably would not mind.” Written RoE from Module 1 still wins.

Binding and firewalling are cousins. Module 4 bound python http.server to 127.0.0.1 so the café could not enum you by accident. A host firewall that default-denies inbound is the same idea at the packet layer: even if a daemon binds 0.0.0.0, the policy can still refuse WAN clients. Prefer both: bind loopback or a lab LAN when you can, and still default-deny inbound from untrusted networks. Publishing SSH to 0.0.0.0/0 “so Discord can grade my lab” is how teaching VMs become botnets (Module 10). If you need SSH, name the source: your admin IP, a VPN you run, or a host-only hypervisor network. Needless any-source allow is the failure this heading exists to kill.

5. What you record: policy sentences and a refuse line — not a punch plan

A firewall-policy note is boring on purpose. Date (UTC). Legal line: original Cyberlium teaching mapped to the CEH v13 IDS/firewall/honeypot domain — not official EC-Council training, not a cert, not exam dumps. Definitions in your words: allow list, deny list, default deny, stateful inspection. Surface: machine you own or hypothetical you own. Intended inbound services (names, not a bypass). Ethics: no IDS evasion steps, no nmap decoys/fragments/timing to hide, no firewall punch of others, no attacking someone else’s honeypot. Path: $HOME/cyberlium-lab/firewall-policy-notes.txt, chmod 600. Empty files fail. Files that list campus rule IDs or café gateway tricks fail even if you “only planned.” World-readable 777 fails.

A useful feeling: the lesson is “too small” because you did not sneak a packet past a filter. That feeling is how people graduate into unauthorized access dressed as CEH homework. The skill is stopping at policy. Lesson 4 will let you write inbound allow for SSH/HTTP you need on a box you own — still default deny, still no 0.0.0.0 theater. Until then, a filled definition file is a complete Lesson 1. Do not add nmap -D, -f, or timing templates as “research.” Do not paste fragmentation one-liners into the notes.

6. Wrong vs right: punching others vs allow/deny and stateful policy on YOUR lab

Worked failure — same word “firewall,” opposite job. Right never treats a café, campus edge, or roommate router as a punch lab.

  • Wrong

    nmap decoys, fragments, or timing templates to hide from an IDS/firewall you do not own. Fragment-overlap “bypass” blogs. Punch the café gateway or school edge. Tunnel through someone else's allow list. Call it CEH homework. Save world-readable notes with victim rule IDs. This course is not official CEH training and does not give you that hunt.

  • Right

    Name allow lists, deny lists, default deny, and stateful inspection so you can BUILD policy on a box YOU own. Write firewall-policy-notes.txt under $HOME/cyberlium-lab, chmod 600. No punch recipes. No decoys. Next: IDS/IPS: Signatures vs Anomalies — alerts are clues; tuning beats “turn it off.”

7. Hands-on: lock firewall-policy-notes.txt — policy literacy, not a bypass kit

On a computer you own, create cyberlium-lab if needed. Fill the template in your own words. Run the checker; it only reads YOUR file. chmod 600. Do not add a campus firewall because the file felt short. Windows without chmod: WSL/Git Bash, or restrict the files in your profile.

Command guide

Stateful inspection named — WHAT/WHY then lock

═══ COMMANDS ═══

Command — copy this

cat >> "$NOTES" << 'EOF'
stateful: remember established conversations
why_it_matters: inbound replies without opening all ports
EOF

Mission: firewall-policy-notes.txt in cyberlium-lab (mode 600)

1) In your own words, define allow list, deny list, default deny, and stateful inspection — policy you would BUILD on a box YOU own. 2) Fill $HOME/cyberlium-lab/firewall-policy-notes.txt; run the checker; chmod 600. 3) Ethics: no IDS evasion, no nmap decoys/fragments/timing to hide, no punching others, no raiding honeypots.

Stuck? Ask Cyberlium AI Mentor

If “the CEH domain is named evading so I must sneak past a filter” still feels true, ask for a hint — not a punch line. Try: "Hint only: why a firewall is allow/deny plus state, why default deny is the lab posture, why notes live at $HOME/cyberlium-lab chmod 600, and why this path is not a bypass cookbook?" You still fill firewall-policy-notes.txt. No decoys. No fragments. No café gateway.

You now treat a firewall as a written policy — allow lists, deny lists, default deny, stateful memory of conversations — that you configure on a lab you own. Punch recipes, decoys, fragments, and “evade the school edge” drills are out of this course. Notes are locked in cyberlium-lab. This is original Cyberlium teaching mapped to the CEH v13 IDS/firewall/honeypot domain — not official EC-Council training, not a cert, not exam dumps. Next — IDS/IPS: Signatures vs Anomalies — names how sensors fire, why alerts are clues, and why tuning beats turning detection off.

Knowledge Check

1

APPLY: A classmate wants nmap decoys and fragments “to evade the campus firewall for CEH Module 12.” What is a firewall here, and what do you do?

Multiple choice

Knowledge Check

2

APPLY: True or False: Default-allow plus a deny list of “known bad ports” is enough, so you should publish SSH to 0.0.0.0/0 to make the lab gradeable.

True or False

Knowledge Check

3

APPLY: You are filling firewall-policy-notes.txt. Which pairing matches allowed surface and hygiene?

Multiple choice

Knowledge Check

4

APPLY: curl of http://192.168.0.1/ shows a home router login (TP-Link / Netgear / Huawei / "Router Admin"). Is that DEMO in scope as a hacking target?

Multiple choice

← Previous

Answer all 4 knowledge checks to continue. (0/4 answered)