Home β€Ί Defend Your Digital Castle!
πŸ”₯ Module 01 Β· Advanced

🏰 Defend Your Digital Castle!

Your computer is a castle filled with treasureβ€”your photos, games, and secret projects. The internet is a wild forest full of goblins and dragons (viruses and hackers). Your mission, should you choose to accept it, is to build the ultimate defense to keep your treasure safe. Ready to raise the drawbridge? Let's go!

πŸ›‘οΈ WHITE HAT OATH: A true hacker protects the realm. Never test, scan, or attack networks you do not own. Never search for, track, or post personal information about real people. We build shields, not weapons!
πŸ—ΊοΈ

Map Your Defenses

A single lock is easy to pick. A great castle has layers of defense: a moat, a strong outer wall, and a guarded inner keep. Your digital world works the same way! Click on each part of the castle below to see how it protects your data.

CHALLENGE: A sneaky goblin is trying to steal your treasure! Where should you stop him first?

Heads up, pro: We're using a castle to make these ideas easy to picture. In the real world, security pros call this "Network Architecture" and "Defense in Depth." The model is a game, but the tools and concepts you're about to use are 100% real.

You might be wondering: "Why not just keep the drawbridge up all the time?" Great question! You need to let friendly messengers (like website traffic) and supply carts (like game updates) in. The secret is letting the good guys in while keeping the bad guys out. That's where a Firewall comes in.

πŸ“Ί Byte Sized β€” "Firewall as a Security Guard" β€” A super clear, animated guide to how a firewall works, in under 2 minutes!

Warm-Up: Guard the Gate!

Time for a game! A firewall's job is to decide who to let in. For each visitor below, you drag them to the correct box. Are they a friend or a foe?

Visitors

πŸ“œ Messenger
🍎 Supply Cart
πŸ‘Ί Goblin

Allow In βœ…

Keep Out ❌

Making those choices? You just created "allow" and "deny" rules. That's exactly what you're about to do with real commands!

You've learned the theory of the castle defenses. Now, let's learn the real-life magic spells (commands) that network guards use to control the digital drawbridge!

πŸ’» Sandbox Challenge: The Command Tower

Your mission, should you choose to accept it:
  • βœ… ALLOW: Your friend needs to connect to your game server on port `25565`.
  • ❌ DENY: A known hacking group from IP address `123.45.67.89` is trying to get in!
Use the Uncomplicated Firewall (`ufw`) syntax in the box below to write the two rules that will save the day.
⭐ Expert Challenge: A bot is trying to guess your server's password thousands of times a second (a 'brute-force attack'). Security pros use rate-limiting to stop this. Find the `ufw` command to `limit` incoming connections on port `22` (the port for remote logins) and add it as your third rule.
Waiting for execution...

⚑ Your First Real Tools: Send a Scout!

Ready to send your first real network packet? The `ping` command is like sending a scout out from your castle to see if another castle is reachable. Ever wonder if your game is lagging because of *your* internet, or because the game's server is having a problem? `ping` is how you find out!

On most computers (Windows, Mac, Linux), you can open a special app called the Terminal or Command Prompt. Type `ping 1.1.1.1` and press Enter. This sends a small "hello!" packet to a very fast, safe server and sees how long it takes to get a "hello!" back. You just did what network engineers do every single day!

πŸ•΅οΈ Time to Investigate! Which server is closer to you? Ask a parent for help opening your Terminal, then try `ping google.com` and `ping u-tokyo.ac.jp` (a university in Japan!). Compare the `time=__ms` values. A lower number means a faster, closer connection! Why do you think one is so much faster?

πŸ”­ Level Up: From Scout to Spyglass with `traceroute`

If `ping` sends a scout to see *if* the other castle is there, `traceroute` (or `tracert` on Windows) is like giving your scout a map. It shows you the *exact path* your scout takes, hopping from server to server across the world. Each line is a 'hop'β€”like your scout jumping from one rock to another to cross a river. Try `traceroute 8.8.8.8` to see the incredible journey your data takes!

traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 my-home-router (192.168.1.1) 1.234 ms <-- Hop 1: Your router
2 some-isp-server.com (96.120.88.157) 9.876 ms <-- Hop 2: Your Internet Provider
3 ... lots of other servers ...
10 google-dns (8.8.8.8) 15.123 ms <-- Destination Reached!

πŸš€ Final Form: The All-Seeing Eye with `nmap`

This is a tool the real pros use. If `ping` sees if the castle exists and `traceroute` shows you the path, `nmap` is like a spy who sneaks up to the walls and checks for any unlocked doors or windows (open ports). It's incredibly powerful for seeing how a server is configured.

πŸ›‘οΈ CRITICAL SAFETY CHECK: Think of `nmap` like a laser pointer. It's an amazing tool, but pointing it at people (or servers you don't own) is a huge no-no. **NEVER run `nmap` on a website or IP address without permission.** It's seen as a hostile act. To practice safely, security pros use a special website made for scanning: `scanme.nmap.org`. ONLY use that address to test this tool with a parent's permission.

πŸš€ Your Turn: Architect a Network

You've been hired to design the network for a top-secret spy agency! Real Cloud Architects and Security Engineers draw maps before they build anything. Your mission is to create a blueprint.

Use a free tool like diagrams.net to design a network map that includes:

Show your network blueprint to your parents. Explain why you designed it that way! This is what real security pros do every day.

πŸ“š Go Pro: The Hacker Training Ground

Ready to use your skills in a real competition? These are the places where the next generation of cybersecurity heroes train.

πŸ‘¨β€πŸ‘©β€πŸ‘§ Parent Corner: Your Home's Digital Moat

Did you know your home already has a digital moat? It's your Wi-Fi router! Take a moment with your child to find your router. Look at the blinking lightsβ€”that's the traffic it's managing right now. Explain that it's acting like a digital guard for your whole family, using its built-in firewall to keep your devices safe from the wild forest of the internet.