Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
← Fundamentals Of Cyber Security Scripting Β· Lesson 5 of 9

Module Four

πŸ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
5
πŸ“˜ Module 4: Fundamentals of Cyber Security Scripting

πŸ›‘οΈ Module 4: Fundamentals of Cyber Security Scripting

Welcome, young cyber hero! This is Module 4, the next step in our exciting journey.

πŸ“– Module Introduction

In Modules 1, 2, and 3, we learned the basics of scripting, networks, and security tools. Now, in Module 4, we will go even further. We will learn about web security (how to protect websites), database security (how to keep data safe), and mobile security (how to protect phones). We will also learn about social engineering (how hackers trick people) and how to defend against it. By the end of this module, you will be able to write scripts that can protect websites, apps, and even your friends from cyber attacks. Let’s become the ultimate cyber heroes!

🎯 Learning Objectives

After reading this module, you will be able to:

  • Understand what web security is and why it is important.
  • Write a script that checks for common web vulnerabilities.
  • Protect databases from SQL injection attacks.
  • Secure mobile devices and apps.
  • Recognise social engineering tricks.
  • Write scripts that defend against social engineering.
  • Build a simple web security scanner.
  • Understand the importance of secure coding in web apps.

πŸ“– Warm‑up Story: The Website Invasion

There was a small online store in Lagos called β€œBisi’s Bakery”. Bisi sold cakes and pastries online. One day, a hacker tried to break into her website. The hacker used a trick called SQL injection to try and steal Bisi’s customer list.

But Bisi had a clever friend, Chidi, who had learned about web security. Chidi wrote a script that checked every visitor’s input. If the input looked dangerous, the script blocked it. The hacker was stopped, and Bisi’s bakery was safe. Chidi became a local hero!

In this module, you will learn how to write scripts like Chidi’s to protect websites and apps from bad people.

πŸ“˜ Lesson 1: What is Web Security?

Definition: Web security is the practice of protecting websites and web applications from attacks.

Why important: Websites contain lots of personal information. Web security keeps that information safe.

Simple explanation: Imagine your website is a house. Web security is like locking the doors and windows to keep burglars out.

Real-life example: Banks use web security to protect customer accounts.

School example: Your school’s website uses security to protect student records.

Home example: Your family’s online shopping accounts need web security.

Nigerian example: Nigerian banks and online stores use web security to protect customers.

  Web Security Layers
  -------------------
  [User] β†’ [Firewall] β†’ [Web Server] β†’ [Database]
      |          |            |             |
      |          |            |             V
      |          |            |     [Encryption]
      |          |            V
      |          |     [Input Validation]
      |          V
      |     [SSL/HTTPS]
      V
  [Secure Website]

Mini summary: Web security protects websites from attacks.


πŸ“˜ Lesson 2: Common Web Attacks – SQL Injection

Definition: SQL injection is an attack where a hacker sends bad SQL code to a website’s database to steal or change data.

Why important: It is one of the most common and dangerous attacks.

Simple explanation: Imagine you are at a restaurant. The waiter asks, β€œWhat would you like?” You say, β€œI want the menu AND I want to see the kitchen’s secret recipes!” That is like SQL injection.

Real-life example: In 2009, hackers used SQL injection to steal millions of credit card numbers from a major company.

School example: A hacker could use SQL injection to change their grades in the school database.

Home example: A hacker could use SQL injection to steal your family’s online shopping data.

Nigerian example: Nigerian banks have been targets of SQL injection attacks.

  SQL Injection Example
  ---------------------
  Normal input:  "John"
  Malicious input: "John' OR '1'='1' -- "
  This could trick the database into showing all records.

Mini summary: SQL injection is a dangerous attack that sends bad code to a database.


πŸ“˜ Lesson 3: Defending Against SQL Injection

Definition: Defending against SQL injection means using secure coding techniques to stop bad SQL code from reaching the database.

Why important: It prevents hackers from stealing data.

Simple explanation: Like having a bouncer at a club who checks IDs before letting anyone in.

Real-life example: Using prepared statements (a secure way to talk to databases).

School example: A school website can validate all user input to prevent attacks.

Home example: A home router can block suspicious queries.

Nigerian example: A Nigerian fintech company uses input validation to protect customer data.

  Input Validation Example
  ------------------------
  user_input = "John"
  if "OR" in user_input or "--" in user_input:
      print("Suspicious input blocked!")
  else:
      print("Input is safe.")

Mini summary: Input validation and prepared statements stop SQL injection.


πŸ“˜ Lesson 4: Cross-Site Scripting (XSS)

Definition: Cross-Site Scripting (XSS) is an attack where a hacker injects malicious scripts into a website.

Why important: XSS can steal cookies, session tokens, and other sensitive data.

Simple explanation: Imagine you post a comment on a website. The hacker writes a comment that contains a hidden script. When someone views the comment, the script runs and steals their info.

Real-life example: In 2018, British Airways suffered an XSS attack that stole customer data.

School example: A hacker could use XSS to steal students’ login cookies.

Home example: A hacker could use XSS to take over your social media account.

Nigerian example: Nigerian e-commerce sites must protect against XSS.

  XSS Attack Example
  ------------------
  User input: 
  If the website doesn't escape this, the script will run in the browser.

Mini summary: XSS injects malicious scripts into websites.


πŸ“˜ Lesson 5: Defending Against XSS

Definition: Defending against XSS means escaping or filtering user input so that scripts don't run.

Why important: It protects users from having their data stolen.

Simple explanation: Like turning off the microphone so no one can secretly record you.

Real-life example: Using libraries that automatically escape user input.

School example: A school forum can filter out HTML tags.

Home example: A blog can escape comments before displaying them.

Nigerian example: Nigerian news websites escape comments to prevent XSS.

  Escaping Example
  ----------------
  user_input = ""
  safe_input = user_input.replace("<", "<").replace(">", ">")
  print(safe_input)  # Output: <script>alert('Hacked!');</script>

Mini summary: Escaping user input prevents XSS attacks.


πŸ“˜ Lesson 6: Database Security

Definition: Database security is the practice of protecting the database (where data is stored) from attacks.

Why important: Databases contain valuable information like passwords, credit card numbers, and personal details.

Simple explanation: Imagine a bank vault. The vault has locks, cameras, and alarms. Database security is like that for your data.

Real-life example: Banks encrypt database backups and limit access to only authorised users.

School example: A school database stores student records and must be protected.

Home example: Your family’s password manager stores passwords in a secure database.

Nigerian example: A Nigerian hospital’s database contains patient records and must be secure.

  Database Security Measures
  --------------------------
  [Encryption] β†’ [Access Control] β†’ [Monitoring] β†’ [Backups]

Mini summary: Database security protects stored data from unauthorised access.


πŸ“˜ Lesson 7: Mobile Security – Protecting Phones

Definition: Mobile security is the practice of protecting smartphones and tablets from attacks.

Why important: Phones contain a lot of personal information, and they are often less secure than computers.

Simple explanation: Like putting a case on your phone to protect it from drops, but for digital threats.

Real-life example: Banks use mobile apps with security features like biometric authentication.

School example: A school can use mobile security to prevent students from installing unauthorised apps.

Home example: Using a screen lock and not installing unknown apps.

Nigerian example: Many Nigerians use mobile banking, so mobile security is very important.

  Mobile Security Checklist
  -------------------------
  β˜‘ Use a strong screen lock
  β˜‘ Only install apps from official stores
  β˜‘ Keep your phone updated
  β˜‘ Be careful with app permissions

Mini summary: Mobile security protects phones and the data on them.


πŸ“˜ Lesson 8: Social Engineering – How Hackers Trick People

Definition: Social engineering is when hackers trick people into giving away sensitive information.

Why important: It is often easier to trick a person than to hack a computer.

Simple explanation: Imagine a stranger calls you and pretends to be your friend to get your password. That is social engineering.

Real-life example: Phishing emails that look like they are from your bank asking for your password.

School example: A hacker might call a school and pretend to be a parent to get a student’s grades.

Home example: A hacker might send a text message saying, β€œI need your password for security reasons.”

Nigerian example: Nigerians receive many phishing emails and SMS scams.

  Social Engineering Flow
  -----------------------
  Hacker β†’ Tricks Person β†’ Gets Information β†’ Uses Information

Mini summary: Social engineering is tricking people to get their secrets.


πŸ“˜ Lesson 9: Defending Against Social Engineering

Definition: Defending against social engineering means being aware of tricks and verifying identities.

Why important: It stops hackers from getting your information through lies.

Simple explanation: Like never giving your house keys to a stranger, no matter what they say.

Real-life example: Always verify the identity of someone asking for sensitive information.

School example: Teach students not to share passwords with anyone.

Home example: Talk to your family about not giving personal information over the phone.

Nigerian example: Nigerian banks educate customers about phishing and social engineering.

  Social Engineering Defense Checklist
  ------------------------------------
  β˜‘ Be suspicious of unsolicited requests
  β˜‘ Verify identities through official channels
  β˜‘ Never share passwords or OTPs
  β˜‘ Educate yourself and others

Mini summary: Awareness and verification defeat social engineering.


πŸ“˜ Lesson 10: Web Security Scanners

Definition: A web security scanner is a script that automatically checks a website for vulnerabilities.

Why important: It helps find weaknesses before hackers do.

Simple explanation: Like a health check-up for your website.

Real-life example: Tools like OWASP ZAP and Burp Suite are used to scan websites.

School example: A school can scan its website for vulnerabilities before launching it.

Home example: A blogger can scan their blog for security issues.

Nigerian example: Nigerian companies use scanners to test their e-commerce sites.

  Scanner Flow
  ------------
  Start β†’ Check for SQL Injection β†’ Check for XSS β†’ Check for open ports β†’ Report findings

Mini summary: Web security scanners find vulnerabilities automatically.


πŸ“˜ Lesson 11: Building a Simple Web Scanner

Definition: We can build a simple scanner that checks for common vulnerabilities like SQL injection and XSS.

Why important: It helps us understand how scanners work and how to defend against attacks.

Simple explanation: Like building a robot that checks every door in a building to see if it’s locked.

Real-life example: Security researchers build custom scanners for their specific needs.

School example: Students can build a scanner for their school’s website as a project.

Home example: You can build a scanner to test your own website.

Nigerian example: A Nigerian startup can build a custom scanner to test their app.

  Simple Scanner Pseudo-code
  --------------------------
  function check_sql_injection(url):
      send request with "' OR '1'='1"
      if response shows error or all data:
          return "Vulnerable to SQL injection"
      else:
          return "Safe"

Mini summary: Building a scanner helps understand web security.


πŸ“˜ Lesson 12: Secure Coding for Web Apps

Definition: Secure coding for web apps means writing code that is resistant to attacks.

Why important: It is the first line of defence against hackers.

Simple explanation: Like building a house with strong walls so burglars can’t break in.

Real-life example: Using frameworks like Django or Flask that have built-in security features.

School example: A school web project must follow secure coding practices.

Home example: A personal website should validate all user input.

Nigerian example: Nigerian developers must follow secure coding to protect user data.

  Secure Coding Checklist for Web Apps
  ------------------------------------
  β˜‘ Validate all user input
  β˜‘ Use prepared statements for databases
  β˜‘ Escape output to prevent XSS
  β˜‘ Use HTTPS for all pages
  β˜‘ Keep libraries and frameworks updated

Mini summary: Secure coding prevents many web vulnerabilities.


πŸ“˜ Lesson 13: Password Security

Definition: Password security is the practice of creating and managing strong passwords.

Why important: Weak passwords are the easiest way for hackers to break into accounts.

Simple explanation: Like having a strong lock on your front door.

Real-life example: Using a password manager to generate and store strong passwords.

School example: Students should use strong passwords for their school accounts.

Home example: Using a different password for each online service.

Nigerian example: Nigerian banks encourage customers to use strong passwords and OTPs.

  Password Strength Checklist
  ---------------------------
  β˜‘ At least 12 characters long
  β˜‘ Mix of uppercase, lowercase, numbers, and symbols
  β˜‘ Not based on personal information
  β˜‘ Different for every service

Mini summary: Strong passwords protect your accounts from being hacked.


πŸ“˜ Lesson 14: Two-Factor Authentication (2FA)

Definition: Two-factor authentication (2FA) adds a second step to log in, like a code sent to your phone.

Why important: Even if someone steals your password, they can’t log in without the second factor.

Simple explanation: Like needing both a key and a fingerprint to open a safe.

Real-life example: Many websites offer 2FA via SMS or authenticator apps.

School example: A school can use 2FA for teacher accounts.

Home example: You can enable 2FA on your email and social media accounts.

Nigerian example: Nigerian banks use 2FA for online banking.

  2FA Process
  -----------
  1. User enters password
  2. User receives a code on their phone
  3. User enters the code
  4. Access granted

Mini summary: 2FA adds an extra layer of security to your accounts.


πŸ“˜ Lesson 15: Bringing It All Together – A Web Security System

Definition: A web security system combines multiple tools and scripts to protect a website.

Why important: A single tool is not enough; you need layers of defence.

Simple explanation: Like having locks, alarms, and security cameras all working together.

Real-life example: A company uses a firewall, a scanner, a monitor, and a response team.

School example: A school uses a firewall, antivirus, and security training.

Home example: You can use a firewall, a password manager, and 2FA.

Nigerian example: A Nigerian bank uses all these layers to protect customer data.

  Web Security System
  -------------------
  [Firewall] β†’ [Scanner] β†’ [Monitor] β†’ [Alert] β†’ [Response]
       |            |          |          |          |
       |            |          |          |          V
       |            |          |          |   [Fix Vulnerability]
       |            |          |          V
       |            |          |   [Notify Admin]
       |            |          V
       |            |   [Log Event]
       |            V
       |   [Generate Report]
       V
  [Block Bad Traffic]

Mini summary: A web security system uses multiple layers to protect a website.


πŸ“š Key Vocabulary

  • Web Security: Protecting websites and web apps.
  • SQL Injection: An attack that sends bad SQL code.
  • XSS: An attack that injects malicious scripts.
  • Database Security: Protecting stored data.
  • Mobile Security: Protecting smartphones.
  • Social Engineering: Tricking people to get secrets.
  • Web Scanner: A script that finds vulnerabilities.
  • Secure Coding: Writing code that is safe.
  • Password Security: Creating and managing strong passwords.
  • Two-Factor Authentication (2FA): Adding a second login step.

🧠 Important Concepts

  • Web security protects websites from attacks.
  • SQL injection and XSS are common web attacks.
  • Defending against attacks requires input validation and escaping.
  • Database security protects stored data.
  • Mobile security protects phones.
  • Social engineering tricks people.
  • Web scanners find vulnerabilities.
  • Secure coding prevents attacks.
  • Strong passwords and 2FA protect accounts.

🧩 Step‑by‑Step: Building a Web Scanner

  1. Define the goal – What vulnerabilities do you want to check? (e.g., SQL injection)
  2. Choose a language – Python is a great choice.
  3. Plan the script – Write down the steps.
  4. Write the code – Use functions, conditions, and loops.
  5. Test the script – Try it on a test website.
  6. Improve the script – Add more checks and error handling.
  7. Deploy the script – Use it on your own websites.
  Step 1: Goal – Check for SQL injection
  Step 2: Python
  Step 3: Plan – Send test payloads, check responses
  Step 4: Code – Write the script
  Step 5: Test – Use on a safe test site
  Step 6: Improve – Add XSS checks
  Step 7: Deploy – Run on your site

🌍 Real‑life Examples

  • Google uses web security to protect its search engine.
  • Facebook uses security scanners to find vulnerabilities.
  • Amazon uses encryption and secure coding to protect customer data.
  • Microsoft uses 2FA for employee accounts.

πŸ‡³πŸ‡¬ Nigerian Examples

  • Nigerian banks use web security to protect online banking.
  • Nigerian e-commerce sites use scanners to test their websites.
  • Nigerian fintech companies use secure coding for their apps.
  • Nigerian schools use firewalls and scanners to protect student data.
  • Nigerian telecom companies use mobile security to protect customer data.

πŸŽ‰ Fun Examples Children Relate To

  • A script that checks if your friend’s website is safe to visit.
  • A script that tells you if a password is strong enough.
  • A script that blocks rude comments on a blog.
  • A script that sends a reminder to change passwords.

🏠 Everyday Examples

  • Your email provider uses web security to block spam.
  • Your bank uses 2FA for online banking.
  • Your school uses a firewall to block unsafe websites.
  • Your phone uses mobile security to block malware.

πŸ§‘β€πŸ« Teacher Notes

Encourage students to think about how they use websites and apps every day. Discuss real-world security incidents. Use the warm-up story to introduce concepts. Emphasise the importance of ethical behaviour – using security skills to protect, not harm. Use group projects to build teamwork.

πŸ‘¨β€πŸ‘©β€πŸ‘¦ Parent Tips

Help your child by discussing online safety at home. Encourage them to use strong passwords and 2FA. Talk about social engineering and how to recognise phishing attempts. Celebrate their learning by helping them test their scripts on safe websites.

πŸ’‘ Interesting Facts

  • The first SQL injection attack was reported in 1998.
  • XSS attacks have been around since the early 2000s.
  • More than 80% of data breaches involve weak or stolen passwords.
  • 2FA can block 99.9% of account hacks.
  • Social engineering is used in over 70% of cyber attacks.

πŸ€” Did You Know?

Did you know that the world's largest data breach happened in 2019, exposing 4 billion records? It was caused by a combination of SQL injection and social engineering. That's why learning web security is so important!

🧾 Remember This

  • Web security protects websites.
  • SQL injection and XSS are common attacks.
  • Always validate user input.
  • Use strong passwords and 2FA.
  • Be aware of social engineering tricks.
  • Test your websites for vulnerabilities.
  • Write secure code.

❌ Common Mistakes

  • Not validating user input – leads to SQL injection and XSS.
  • Using weak passwords – easy for hackers to guess.
  • Not using 2FA – accounts are less secure.
  • Falling for social engineering – giving away secrets.
  • Not updating software – vulnerabilities remain unpatched.
  • Storing passwords in plain text – not secure.

βœ… Best Practices

  • Always validate and escape user input.
  • Use prepared statements for database queries.
  • Encrypt sensitive data.
  • Use 2FA for all important accounts.
  • Educate yourself and others about social engineering.
  • Keep software and libraries updated.
  • Test your applications regularly.

πŸ“Ÿ ASCII Diagrams

  SQL Injection Defense
  ---------------------
  User Input β†’ Validate β†’ Escape β†’ Safe Query β†’ Database
  XSS Defense
  -----------
  User Input β†’ Escape β†’ Safe Output β†’ Browser
  Web Security Layers
  -------------------
  [Internet] β†’ [Firewall] β†’ [Web App] β†’ [Database]
       |            |            |           |
       |            |            |           V
       |            |            |     [Encryption]
       |            |            V
       |            |     [Input Validation]
       |            V
       |     [HTTPS]
       V
  [Secure Website]

πŸ“Š Comparison: SQL Injection vs XSS

FeatureSQL InjectionXSS
TargetDatabaseBrowser
ImpactData theft, data lossSession hijacking, data theft
DefenseInput validation, prepared statementsInput escaping, output encoding

πŸ“Š Comparison: Password vs 2FA

FeaturePassword OnlyPassword + 2FA
Security LevelLowHigh
Ease of UseEasyModerate
Risk of CompromiseHigh (if weak or stolen)Low (needs both factors)

πŸ“ End‑of‑Module Summary

Congratulations! You have completed Module 4. You now have a deep understanding of web security, including:

  • What web security is and why it is important.
  • How to defend against SQL injection and XSS attacks.
  • How to secure databases and mobile devices.
  • How to recognise and defend against social engineering.
  • How to build a simple web security scanner.
  • The importance of secure coding, strong passwords, and 2FA.

You are now equipped to protect websites and apps from many common attacks. Keep learning, keep coding, and always use your skills for good. The digital world needs more heroes like you!

❓ Frequently Asked Questions

  1. What is the most common web attack? SQL injection and XSS are among the most common.
  2. How can I protect my website from SQL injection? Use input validation and prepared statements.
  3. What is the difference between XSS and SQL injection? XSS targets the browser, SQL injection targets the database.
  4. How do I create a strong password? Use at least 12 characters with a mix of letters, numbers, and symbols.
  5. What is 2FA and why should I use it? 2FA adds a second login step and blocks 99.9% of account hacks.
  6. How do I recognise social engineering? Be suspicious of unsolicited requests for personal information.
  7. What is a web security scanner? It's a script that checks a website for vulnerabilities.
  8. Is mobile security important? Yes, phones contain a lot of personal data.
  9. How can I learn more about web security? Practice, read about vulnerabilities, and use security tools.
  10. What should I do if I find a vulnerability? Report it to the website owner ethically.

πŸ“‹ Review Questions

  1. What is web security?
  2. What is SQL injection?
  3. How can you defend against SQL injection?
  4. What is XSS?
  5. How can you defend against XSS?
  6. What is database security?
  7. What is mobile security?
  8. What is social engineering?
  9. How can you defend against social engineering?
  10. What is a web security scanner?
  11. Why is secure coding important?
  12. What makes a password strong?
  13. What is 2FA?
  14. Give one Nigerian example of web security in action.
  15. How can you protect your online accounts?

✏️ Fill‑in‑the‑Blank

  1. __________ is the practice of protecting websites. (Web security)
  2. __________ is an attack that sends bad SQL code. (SQL injection)
  3. __________ is an attack that injects malicious scripts. (XSS)
  4. __________ protects stored data. (Database security)
  5. __________ protects smartphones. (Mobile security)
  6. __________ is tricking people to get secrets. (Social engineering)
  7. A __________ is a script that finds vulnerabilities. (web security scanner)
  8. __________ is writing code that is safe. (Secure coding)
  9. __________ adds a second login step. (Two-factor authentication / 2FA)
  10. __________ is creating and managing strong passwords. (Password security)

βœ”οΈ True or False

  1. Web security protects websites. (True)
  2. SQL injection is a type of social engineering. (False)
  3. XSS attacks target the browser. (True)
  4. Database security is not important. (False)
  5. Mobile security is only for phones. (True)
  6. Social engineering is a technical attack. (False)
  7. A web scanner finds vulnerabilities. (True)
  8. Secure coding prevents attacks. (True)
  9. Passwords should be shared with friends. (False)
  10. 2FA is optional and not necessary. (False)

πŸ”˜ Multiple Choice Questions

  1. What is web security?
    A) Protecting websites B) Protecting phones C) Protecting networks D) Protecting files
    Answer: A
  2. What is SQL injection?
    A) An attack on the database B) An attack on the browser C) An attack on the network D) An attack on the phone
    Answer: A
  3. What is XSS?
    A) An attack on the database B) An attack on the browser C) An attack on the network D) An attack on the phone
    Answer: B
  4. How can you defend against SQL injection?
    A) Use prepared statements B) Use escaping C) Use firewalls D) Use passwords
    Answer: A
  5. How can you defend against XSS?
    A) Use prepared statements B) Use escaping C) Use firewalls D) Use passwords
    Answer: B
  6. What is social engineering?
    A) Tricking people B) Hacking computers C) Writing scripts D) Using firewalls
    Answer: A
  7. What is a web scanner?
    A) A script that finds vulnerabilities B) A script that deletes files C) A script that plays games D) A script that sends emails
    Answer: A
  8. Why is secure coding important?
    A) To prevent attacks B) To make code faster C) To make code shorter D) To make code colourful
    Answer: A
  9. What makes a password strong?
    A) Length and complexity B) Short and simple C) Based on name D) Based on birthday
    Answer: A
  10. What is 2FA?
    A) Two-factor authentication B) Two-file access C) Two-fold algorithm D) Two-frame application
    Answer: A
  11. Which of these is a common web attack?
    A) SQL injection B) Phishing C) Malware D) All of the above
    Answer: D
  12. What is the best defense against social engineering?
    A) Awareness and verification B) Firewalls C) Antivirus D) Encryption
    Answer: A
  13. Which of these is a best practice for web security?
    A) Validating input B) Hardcoding passwords C) Ignoring errors D) Not testing
    Answer: A
  14. What is the first step in building a web scanner?
    A) Define the goal B) Write the code C) Test the script D) Deploy the script
    Answer: A
  15. Which of these is a Nigerian example of web security?
    A) Bank using encryption B) School using firewalls C) E-commerce site using scanners D) All of the above
    Answer: D

πŸ”— Matching Exercises

Match the term with its description:

TermDescription
1. SQL InjectionA. Adds a second login step
2. XSSB. An attack on the database
3. 2FAC. Tricking people to get secrets
4. Social EngineeringD. An attack on the browser
5. Web ScannerE. A script that finds vulnerabilities

Answers: 1-B, 2-D, 3-A, 4-C, 5-E

✍️ Short Answer Questions

  1. Explain what web security is in your own words.
  2. What is the difference between SQL injection and XSS?
  3. How can you defend against social engineering?
  4. Why is secure coding important for web apps?
  5. What is the purpose of a web security scanner?
  6. How can you create a strong password?
  7. What is 2FA and why is it important?
  8. Give an example of a Nigerian company that uses web security.
  9. What is the most important thing you learned in this module?
  10. How can you apply what you learned to protect yourself online?

🎭 Scenario‑based Exercises

Scenario 1: You have built a website for your school. A student tells you they saw a strange pop-up on the site. You suspect XSS. Write a script (pseudo-code) that checks for XSS vulnerabilities on your site.

Scenario 2: You are working for a Nigerian bank. The bank wants to protect its customers from social engineering attacks. Write a script (pseudo-code) that sends an educational message to customers about phishing.

πŸ‘₯ Group Activity

In groups of 3, create a presentation about a real-world cyber security incident. Discuss how the attack happened and what could have been done to prevent it. Include a demonstration of a security script that could have helped.

πŸ§‘β€πŸŽ“ Individual Activity

Write a Python script that checks if a website has HTTPS enabled. The script should connect to the website and check if it uses port 443. Print a message indicating whether the connection is secure.

πŸ’¬ Classroom Discussion Questions

  1. How can web security be improved in Nigerian schools?
  2. What are the ethical responsibilities of a security professional?
  3. How do you think social engineering will evolve in the future?

πŸ› οΈ Mini Project

Build a simple web vulnerability scanner. Write a script that checks for SQL injection and XSS vulnerabilities on a given URL. Use the requests library in Python. Test it on a safe test site like "https://testphp.vulnweb.com".

πŸ“‚ Practical Assignment

Write a script that scans a given website for common security headers (like Content-Security-Policy, X-Frame-Options, etc.). Print a report of which headers are present and which are missing. Include recommendations for improvement.

πŸ† Challenge Exercise

Write a script that simulates a social engineering defense system. The script should prompt the user for a secret code. If the user tries to give the code to an unauthorised person (simulated by input), the script should reject it and alert the user about social engineering.

βœ… Quiz Answers

All multiple-choice answers are indicated in the questions above (bold). Fill-in-the-blank answers: 1-Web security, 2-SQL injection, 3-XSS, 4-Database security, 5-Mobile security, 6-Social engineering, 7-web security scanner, 8-Secure coding, 9-Two-factor authentication, 10-Password security. True/False: 1-T, 2-F, 3-T, 4-F, 5-T, 6-F, 7-T, 8-T, 9-F, 10-F.

πŸ”‘ Key Takeaways

  • Web security protects websites and apps.
  • SQL injection and XSS are common threats.
  • Defend against attacks with input validation and escaping.
  • Database and mobile security are essential.
  • Social engineering tricks people – be aware.
  • Use strong passwords and 2FA.
  • Web scanners help find vulnerabilities.
  • Secure coding is the first line of defense.

πŸš€ Preparation for Next Module

Congratulations on completing Module 4! You now have a solid understanding of web, database, and mobile security. In the next course, we will dive into advanced topics like network penetration testing, cloud security, and incident response. You will learn how to think like a hacker to better defend against them. Keep learning, keep coding, and always stay curious! See you in the next adventure.


End of Module 4 Β· Fundamentals of Cyber Security Scripting

This concludes the four-module foundation course. Well done, cyber hero!

πŸ† Get Certified

πŸ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (₦2,000 or 20,000 coins), and get a verified certificate with your name on it.

πŸŽ“ Sign Up to Get Certified
πŸ› οΈ Practice Tools
Hands-on simulators & labs - subscription required.
β†’
🎯 Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
β†’