Welcome back, young cyber hero! This is Module 3, the final part of our foundation course.
In Modules 1 and 2, we learned the basics of scripting โ variables, conditions, loops, functions, and more. Now, in Module 3, we will put everything together. We will learn how to build real security tools that can protect computers and networks. We will also learn about networks (how computers talk to each other) and encryption (how to keep messages secret). By the end of this module, you will be able to write a script that can detect a cyber attack and stop it. Are you ready to become a true cyber hero? Letโs go!
After reading this module, you will be able to:
Imagine a village in Nigeria called โCyber Villageโ. In this village, every house has a computer. The computers are all connected to each other by invisible roads called networks. The village has a security team that watches over the roads.
One day, a stranger came to the village. The stranger tried to send a secret message to another house, but the security team had a script that checked all messages. The script looked for bad words and stopped the message. The village was safe because the script protected the network.
Chidi, a boy from the village, wanted to learn how to write such a script. He learned about networks, encryption, and firewalls. And now, you will learn the same things in Module 3!
Definition: A network is a group of computers that are connected to each other, like a family of computers.
Why important: Networks allow computers to share information. But they can also be attacked. Scripts protect networks.
Simple explanation: Think of a network like a telephone system. You can call your friends, but someone might eavesdrop. Scripts stop eavesdroppers.
Real-life example: The internet is a huge network of computers all over the world.
School example: The computers in your school are connected to a network so you can share files.
Home example: Your familyโs computers and phones are connected to a home Wi-Fi network.
Nigerian example: A bank in Lagos has a network that connects all its branches. Scripts protect this network from hackers.
Simple Network Diagram
----------------------
[Computer 1] --- [Switch] --- [Computer 2]
| |
| |
[Computer 3] --- [Router] --- [Internet]
Mini summary: A network is a group of connected computers.
Definition: Network security scripts watch the traffic on a network and block anything suspicious.
Why important: They act like guards at the gate of a village, checking who comes in and out.
Simple explanation: Imagine a security guard at a school gate. The guard checks everyone who enters. A network script does the same for data.
Real-life example: A script can block a computer that tries to send too many requests.
School example: A script can prevent students from accessing games during class.
Home example: A script can block adult content on your home Wi-Fi.
Nigerian example: A script can protect a Nigerian universityโs network from hackers.
Network Security Script Flow
----------------------------
Data enters network โ Script checks data โ If safe, allow through
โ If dangerous, block and log
Mini summary: Scripts protect networks by checking data and blocking bad data.
Definition: An IP address is a unique number that identifies a computer on a network, like a house address.
Why important: Scripts use IP addresses to know where data is coming from and where it is going.
Simple explanation: Just like every house has a street address, every computer on a network has an IP address.
Real-life example: 192.168.1.1 is a common IP address for home routers.
School example: The school server has an IP address that computers use to find it.
Home example: Your phone and laptop have different IP addresses on your home network.
Nigerian example: A bankโs website has an IP address that customers use to access it.
IP Address Example ------------------ 192.168.1.10 โ Computer 1 192.168.1.11 โ Computer 2 192.168.1.1 โ Router
Mini summary: IP addresses are like house addresses for computers.
Definition: A port is a virtual door on a computer. Different services use different ports.
Why important: Scripts can open or close ports to allow or deny access.
Simple explanation: Imagine a building with many doors. Door 80 is for web pages, door 443 is for secure web pages.
Real-life example: Port 80 is used for HTTP (websites), port 443 for HTTPS (secure websites).
School example: The schoolโs file server uses port 21 for file transfers.
Home example: Your game console uses a specific port to connect to online games.
Nigerian example: A bankโs website uses port 443 to keep customer data safe.
Ports Diagram
-------------
[Computer]
|-- Port 80 (Web)
|-- Port 443 (Secure Web)
|-- Port 21 (File Transfer)
|-- Port 22 (Secure Shell)
Mini summary: Ports are virtual doors that scripts can control.
Definition: A firewall is a script or device that controls what data enters or leaves a network.
Why important: Firewalls block bad data from entering your computer.
Simple explanation: Like a bouncer at a club, a firewall decides who gets in and who stays out.
Real-life example: Your home router has a built-in firewall.
School example: The schoolโs firewall blocks social media during class.
Home example: A firewall can block unknown devices from joining your Wi-Fi.
Nigerian example: A Nigerian bank uses a firewall to protect its internal network.
Firewall Rules -------------- Allow: Port 80 (Web) from any IP Allow: Port 443 (HTTPS) from any IP Block: Port 23 (Telnet) from outside Block: Port 21 (FTP) from outside
Mini summary: Firewalls are gatekeepers that control network traffic.
Definition: Encryption is the process of converting information into a secret code to prevent unauthorised access.
Why important: It keeps data safe from hackers who might intercept it.
Simple explanation: Like writing a message in a secret language that only you and your friend understand.
Real-life example: HTTPS uses encryption to secure websites.
School example: You can encrypt your homework folder so no one else can read it.
Home example: Your Wi-Fi password is used to encrypt your internet traffic.
Nigerian example: Banks use encryption to protect customer transactions.
Encryption Process ------------------ "Hello" โ [Encryption] โ "&*^%$#" โ [Decryption] โ "Hello"
Mini summary: Encryption turns readable data into secret code.
Definition: API stands for Application Programming Interface. Itโs a way for scripts to talk to other services.
Why important: APIs allow scripts to get information from other websites or services.
Simple explanation: Like ordering food at a restaurant. You tell the waiter what you want, and the waiter brings it to you.
Real-life example: A script can use the Google Maps API to get directions.
School example: A script can use a weather API to get the forecast for your school.
Home example: A script can use a news API to get the latest headlines.
Nigerian example: A script can use a payment API to process transactions in a Nigerian store.
API Communication ----------------- Script โ Request to API โ API processes โ Script receives response
Mini summary: APIs let scripts talk to other services.
Definition: A security scanner is a script that checks for vulnerabilities in a system.
Why important: It helps find weaknesses before hackers can exploit them.
Simple explanation: Like a doctor checking your body for sickness.
Real-life example: A script can scan a website for common security holes.
School example: A script can check if student passwords are weak.
Home example: A script can check if your home router has default passwords.
Nigerian example: A Nigerian bank can use a scanner to check its website for vulnerabilities.
Scanner Flow ------------ Start โ Check for weak passwords โ Check for open ports โ Report findings
Mini summary: Security scanners find weaknesses before hackers do.
Definition: Logging is recording events. Monitoring is watching these logs to detect problems.
Why important: Logs help you understand what happened during a security incident.
Simple explanation: Like a diary that records everything that happens in a day.
Real-life example: A script logs all login attempts and alerts if there are too many failed attempts.
School example: A script logs when students log in to the school system.
Home example: A script logs when someone tries to access your home computer.
Nigerian example: A bank monitors logs to detect fraud.
Logging Example --------------- 2026-06-27 10:00: User admin logged in from IP 192.168.1.10 2026-06-27 10:05: User admin logged out 2026-06-27 10:10: Failed login attempt from IP 10.0.0.5
Mini summary: Logging records events; monitoring watches for problems.
Definition: Ethical hacking is using hacking skills to find and fix security problems, not to cause harm.
Why important: Ethical hackers help keep people safe.
Simple explanation: Like a superhero who uses their powers to fight crime.
Real-life example: Companies hire ethical hackers to test their systems.
School example: You can be an ethical hacker by finding bugs in school websites and reporting them.
Home example: You can test your home Wi-Fi security.
Nigerian example: Nigerian banks hire ethical hackers to protect customer data.
Ethical Hacking Process ----------------------- 1. Get permission 2. Find vulnerabilities 3. Report them 4. Help fix them
Mini summary: Ethical hackers use their skills to protect, not harm.
Definition: Automation is making scripts do repetitive tasks. Security updates are patches that fix vulnerabilities.
Why important: Automated updates ensure systems are always protected.
Simple explanation: Like a robot that waters your plants every day.
Real-life example: A script that automatically downloads and installs antivirus updates.
School example: A script that updates all school computers every night.
Home example: A script that updates your apps automatically.
Nigerian example: A script that updates a bank's security software after business hours.
Automation Flow --------------- Schedule โ Check for updates โ Download โ Install โ Log success
Mini summary: Automation makes security updates easy and fast.
Definition: An alert is a notification that something suspicious has happened.
Why important: Alerts tell you when to take action.
Simple explanation: Like a fire alarm that rings when there is smoke.
Real-life example: A script sends an email alert when it detects a virus.
School example: A script alerts the IT team when a student tries to access a blocked website.
Home example: A script sends a notification to your phone when someone tries to access your computer.
Nigerian example: A script alerts a bankโs security team about a suspicious transaction.
Alert Handling -------------- Script detects suspicious activity โ Sends alert โ Security team investigates
Mini summary: Alerts notify you when there is a security problem.
Definition: A firewall script controls network traffic based on rules.
Why important: It blocks bad traffic and allows good traffic.
Simple explanation: Like a security guard who checks everyoneโs ID.
Real-life example: A script that blocks all traffic from a specific IP address.
School example: A script that blocks access to social media during school hours.
Home example: A script that blocks devices you donโt recognise.
Nigerian example: A script that blocks traffic from known hacker IP addresses.
Firewall Script (pseudo-code)
-----------------------------
allowed_ips = ["192.168.1.1", "10.0.0.1"]
if ip in allowed_ips:
allow_traffic()
else:
block_traffic()
log_event()
Mini summary: Firewall scripts allow or block traffic based on rules.
Definition: Secure coding means writing scripts that are not vulnerable to attacks.
Why important: If your script has weaknesses, hackers can exploit them.
Simple explanation: Like building a strong house that burglars canโt break into.
Real-life example: Never trust user input directly; always validate it.
School example: When writing a script for students, make sure they canโt access files they shouldnโt.
Home example: When writing a script for home, make sure it doesnโt store passwords in plain text.
Nigerian example: Banks ensure their scripts use secure coding to protect customer data.
Secure Coding Checklist ----------------------- โ Validate all user input โ Use encryption for sensitive data โ Keep secrets out of code โ Test for common vulnerabilities
Mini summary: Secure coding keeps your scripts safe from attacks.
Definition: A security system is a collection of scripts and tools that work together to protect a network.
Why important: A single script is good, but many scripts working together are even better.
Simple explanation: Like a sports team where each player has a different role.
Real-life example: A company uses firewalls, scanners, and monitors together.
School example: A school uses scripts for login, monitoring, and updates.
Home example: You can use scripts for Wi-Fi security, parental controls, and backups.
Nigerian example: A bank uses a suite of scripts to protect its entire network.
Security System Overview ------------------------ [Firewall] โ [Scanner] โ [Monitor] โ [Alert] โ [Respond]
Mini summary: Many scripts working together create a strong security system.
Step 1: Define goal (e.g., block bad IPs) Step 2: Choose Python Step 3: Plan: Read list of bad IPs, block them Step 4: Write code Step 5: Test with sample IPs Step 6: Deploy on the network Step 7: Log events and update the list
Encourage students to think of networks as โcitiesโ and scripts as โsecurity guardsโ. Use the warm-up story to make the concepts relatable. Emphasise the importance of ethical hacking โ using skills for good. Use the Nigerian context to make it relevant. Pair programming and group discussions are highly recommended.
Help your child by discussing how they use networks and the internet at home. Encourage them to think about security โ what would happen if a hacker got into their device? Remind them that scripts are tools, and like any tool, they can be used for good or bad. Always encourage ethical behaviour.
Did you know that the โ@โ symbol was first used in emails in 1971? It was chosen because it was not used much before, so it was perfect for separating the user name from the computer name.
Network with Firewall
---------------------
[Internet] โ [Firewall] โ [Internal Network]
|
[Web Server]
[Email Server]
[User Computers]
Encryption Process
------------------
Plain Text: "HELLO"
โ
Encryption Algorithm
โ
Cipher Text: "KHOOR"
โ
Decryption Algorithm
โ
Plain Text: "HELLO"
API Request Flow
----------------
[Script] โ [API] โ [Service]
| | |
| | V
| | [Returns Data]
| V
| [API Processes]
V
[Script Receives Data]
| Feature | HTTP | HTTPS |
|---|---|---|
| Encryption | No | Yes |
| Security | Not secure | Secure |
| Port | 80 | 443 |
| Use | Old websites | Modern websites, banking |
| Feature | Firewall | Antivirus |
|---|---|---|
| Purpose | Controls network traffic | Detects and removes viruses |
| Scope | Network level | File level |
| Example | Blocks incoming connections | Scans files for malware |
Congratulations! You have completed Module 3 and the entire โFundamentals of Cyber Security Scriptingโ course. You now know:
You are now ready to start your journey as a cyber security expert. Keep learning, keep coding, and always use your skills for good. The world needs more heroes like you!
Match the term with its description:
| Term | Description |
|---|---|
| 1. Network | A. Turns data into secret code |
| 2. Firewall | B. A group of connected computers |
| 3. Encryption | C. Controls network traffic |
| 4. API | D. A way for scripts to talk to services |
| 5. Scanner | E. Checks for vulnerabilities |
Answers: 1-B, 2-C, 3-A, 4-D, 5-E
Scenario 1: You are a security expert at a Nigerian bank. You notice that a lot of traffic is coming from a suspicious IP address. Write a simple script (pseudo-code) that blocks this IP address and logs the event.
Scenario 2: A small business in Lagos wants to protect its website. They want a script that checks if the website is up and sends an alert if itโs down. Write a script (pseudo-code) that does this.
In groups of 3, design a security system for a school. The system should include a firewall, a scanner, a monitor, and an alert system. Draw a diagram and write a description of how each part works. Present your design to the class.
Write a Python script that connects to a public API (like a weather API) and prints the current weather for Lagos. Then, add a condition that prints โItโs hot!โ if the temperature is above 30ยฐC.
Build a simple intrusion detection system. Write a script that monitors a log file for failed login attempts. If there are more than 3 failed attempts from the same IP address in 5 minutes, send an alert (print a message).
Write a script that scans a website for common vulnerabilities. Your script should check if the website uses HTTPS, if it has a valid SSL certificate, and if any common ports (like 21, 22, 23) are open. Print a report with your findings.
Write a script that simulates a simple firewall. The script should read a list of allowed IP addresses from a file. Then, it should check incoming traffic (simulated by user input) and allow or block it based on the list. Log all attempts.
All multiple-choice answers are indicated in the questions above (bold). Fill-in-the-blank answers: 1-network, 2-IP address, 3-port, 4-firewall, 5-Encryption, 6-API, 7-scanner, 8-Logging, 9-Ethical hacking, 10-Automation. True/False: 1-T, 2-F, 3-F, 4-F, 5-T, 6-F, 7-T, 8-F, 9-F, 10-T.
Congratulations on completing all three modules! You have a solid foundation in cyber security scripting. In the next course, we will dive deeper into web security, mobile security, and cloud security. You will learn about SQL injection, cross-site scripting, and more. Keep learning, keep coding, and always stay curious! See you in the next adventure.
End of Module 3 ยท Fundamentals of Cyber Security Scripting
This concludes the three-module foundation course. Well done, cyber hero!