Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Security Operation Center Analyst Level Three ยท Lesson 7 of 11

Module Six

๐Ÿ“– 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.
7
Security Operation Centre Analyst โ€“ Module 6 (MySQL Security)

๐Ÿ›ก๏ธ Module Six: MySQL for Security โ€“ Threat Hunting

Hello, security detective! You have learned the basics of MySQL, advanced queries, and how to combine tables. Now, in Module Six, we will use MySQL to hunt for threats! Threat hunting means actively searching for hidden dangers in your data. We will learn how to use MySQL to find suspicious patterns, detect attacks, and protect our systems.


๐Ÿ“– Module Introduction

In Module Four, you learned the basics of MySQL โ€“ how to create tables, add data, read data, update data, and delete data. In Module Five, you learned advanced skills like JOIN, GROUP BY, HAVING, subqueries, LIKE, and LIMIT. Now, in Module Six, we will put all of these skills together to hunt for threats.

Threat hunting is like being a detective. Instead of waiting for an alarm to go off, you actively search for clues that something is wrong. MySQL is a powerful tool for threat hunting because it can search through millions of records quickly. By the end of this module, you will be able to use MySQL to find suspicious activities, investigate incidents, and keep systems safe.

Remember: The best hunters are always looking for clues. Let's start hunting!


๐ŸŽฏ Learning Objectives

After this module, you will be able to:

  • Define threat hunting.
  • Use MySQL to find suspicious login patterns.
  • Detect unusual access times.
  • Identify failed login attempts.
  • Find suspicious IP addresses.
  • Use advanced MySQL queries for threat hunting.
  • Apply your skills to real-world security scenarios.

๐Ÿ“š Warm-up Story: Ade's Midnight Mystery

Ade is 10 years old and lives in Ibadan. His father works at a bank. One morning, Ade's father told him that someone had been trying to log into the bank's system late at night. The security team was worried, but they couldn't find the culprit.

Ade had just learned MySQL in his SOC Analyst course. He asked his father, "Can I see the login logs?" His father gave him a copy of the logs. Ade opened MySQL and started writing queries. He searched for failed logins after 10 PM. He found dozens of failed attempts โ€“ all from the same IP address!

He then used a JOIN to combine the login logs with the user table. He found that the IP address belonged to a former employee who had left the company. The security team blocked the IP address and improved their security. Ade's father was so proud of him.

Ade said, "MySQL is like a superpower! It helped me find the bad guy."

Question for you: What would you do if you found suspicious activity in a system?


๐Ÿงฉ Main Lessons

Lesson 1: What is Threat Hunting?

Definition: Threat hunting is actively searching for hidden threats in a system. It's not waiting for an alarm โ€“ it's looking for clues.

Why it is important: Many attacks go unnoticed for months. Threat hunting helps us find them early.

Simple explanation: It's like being a detective who looks for clues before a crime happens.

Real-life example: A security team searches for unusual logins every day.

School example: A teacher checks who is accessing the school's computer system late at night.

Home example: A parent checks who is using their smart devices at odd hours.

Nigerian example: A bank searches for suspicious transactions.

Threat Hunting = Active Search
- Look for patterns
- Find anomalies
- Investigate suspicious activities

Mini summary: Threat hunting is actively searching for hidden dangers.


Lesson 2: Setting Up a Security Database

Definition: A security database is a collection of security-related data, like login logs, access logs, and system events.

Why it is important: We need a place to store and organise security data so we can search it.

Simple explanation: It's like having a detective's notebook to write down all the clues.

Real-life example: A company creates a table to store all login attempts.

School example: A school creates a table to track who uses the computer lab.

Home example: A family creates a table to track who logs into their smart devices.

Nigerian example: A bank creates a table to track all transactions.

Security Database Tables:
- login_logs (id, user_id, login_time, success, ip_address)
- users (id, name, email, role)
- system_events (id, event_type, description, time)

Mini summary: A security database helps us store and organise security data.


Lesson 3: Finding Failed Login Attempts

Definition: Failed login attempts are times when someone tries to log in but gets the password wrong. This can be a sign of an attack.

Why it is important: Many failed attempts might mean someone is trying to break into the system.

Simple explanation: It's like someone trying to open a locked door with the wrong key again and again.

Real-life example: A hacker tries 100 different passwords to get into a system.

School example: A student tries to guess a teacher's password.

Home example: Someone tries to guess your smart device password.

Nigerian example: A fraudster tries to guess a customer's bank password.

Query for failed logins:
SELECT * FROM login_logs WHERE success = false;

Mini summary: Failed login attempts can indicate an attack.


Lesson 4: Finding Failed Logins After Hours

Definition: Logins that happen after normal working hours can be suspicious.

Why it is important: Most employees don't log in at 2 AM. If someone does, it might be an attacker.

Simple explanation: It's like hearing someone in your house at midnight โ€“ it's not normal.

Real-life example: An employee logs in at 3 AM from a different country.

School example: A student logs into the school system at 1 AM.

Home example: A family member logs into a streaming service at 4 AM.

Nigerian example: A bank employee logs in at 2 AM from an unusual location.

Query for after-hours failed logins:
SELECT * FROM login_logs
WHERE success = false AND TIME(login_time) > '22:00:00';

Mini summary: After-hours logins can be a sign of an attack.


Lesson 5: Finding Suspicious IP Addresses

Definition: An IP address is a unique number that identifies a device on the internet. Suspicious IP addresses are those from unknown or suspicious locations.

Why it is important: Attackers often use IP addresses from other countries to hide their identity.

Simple explanation: It's like a stranger coming to your house โ€“ you don't know who they are.

Real-life example: An IP address from a country where the company doesn't operate.

School example: An IP address from a different city accessing the school system.

Home example: An unknown device connecting to your Wi-Fi.

Nigerian example: A transaction from an IP address outside Nigeria.

Query for suspicious IPs:
SELECT * FROM login_logs
WHERE ip_address NOT LIKE '192.168.%' AND ip_address NOT LIKE '10.%';

Mini summary: Suspicious IP addresses can indicate an attack.


Lesson 6: Finding Unusual User Behaviour

Definition: Unusual behaviour means a user is doing something they don't normally do, like logging in at odd times or from different locations.

Why it is important: Unusual behaviour can mean an account has been hacked.

Simple explanation: It's like your friend suddenly acting differently โ€“ something might be wrong.

Real-life example: An employee who always logs in from Lagos suddenly logs in from London.

School example: A student who always logs in during school hours suddenly logs in at midnight.

Home example: A family member who never uses the TV suddenly starts streaming at 3 AM.

Nigerian example: A bank customer who always uses a specific branch suddenly uses a branch in another state.

Query for unusual behaviour:
SELECT user_id, COUNT(*) AS login_count
FROM login_logs
WHERE login_time BETWEEN '00:00:00' AND '05:00:00'
GROUP BY user_id
HAVING login_count > 3;

Mini summary: Unusual behaviour can mean an account is compromised.


Lesson 7: Finding Brute Force Attacks

Definition: A brute force attack is when an attacker tries many passwords in a short time to guess the right one.

Why it is important: Brute force attacks are very common. They can break into systems if the passwords are weak.

Simple explanation: It's like trying every key in a keyring until you find the right one.

Real-life example: An attacker tries 10,000 passwords in one hour.

School example: A student tries 100 different passwords to get into the school system.

Home example: Someone tries to guess your Wi-Fi password.

Nigerian example: A fraudster tries to guess a bank customer's PIN.

Query for brute force:
SELECT user_id, COUNT(*) AS attempts
FROM login_logs
WHERE success = false
AND login_time BETWEEN NOW() - INTERVAL 1 HOUR AND NOW()
GROUP BY user_id
HAVING attempts > 50;

Mini summary: Brute force attacks try many passwords quickly.


Lesson 8: Finding Multiple Failed Logins from Same IP

Definition: If many failed logins come from the same IP address, it could be an attacker.

Why it is important: Attackers often try many accounts from the same IP address.

Simple explanation: It's like someone trying all the doors in a building to find one that is unlocked.

Real-life example: An attacker uses one computer to try to hack into many accounts.

School example: A student from one computer tries to access many student accounts.

Home example: A device on your network tries to access many services.

Nigerian example: An attacker uses one IP to try to hack into a bank's customer accounts.

Query for same IP failed logins:
SELECT ip_address, COUNT(*) AS attempts
FROM login_logs
WHERE success = false
GROUP BY ip_address
HAVING attempts > 5;

Mini summary: Multiple failed logins from the same IP can indicate an attack.


Lesson 9: Finding Logins from Unusual Locations

Definition: Unusual locations are places where a user doesn't normally log in from.

Why it is important: If a user logs in from a different country, their account might be hacked.

Simple explanation: It's like your friend suddenly calling you from a different country.

Real-life example: A user logs in from Nigeria and then 10 minutes later from the UK.

School example: A student logs in from home and then from a different city.

Home example: A family member logs into their email from two different places.

Nigerian example: A bank customer logs in from Lagos and then from Kano in 5 minutes.

Query for unusual locations:
SELECT user_id, ip_address, login_time
FROM login_logs
WHERE ip_address NOT LIKE '192.168.%'
ORDER BY user_id, login_time;

Mini summary: Logins from unusual locations can indicate account compromise.


Lesson 10: Combining Clues โ€“ Advanced Threat Hunting

Definition: Combining clues means using multiple queries to find a pattern.

Why it is important: A single clue might not mean anything, but several clues together can reveal an attack.

Simple explanation: It's like putting together a jigsaw puzzle โ€“ each piece is a clue.

Real-life example: Failed logins + unusual IP + after-hours = likely attack.

School example: Failed logins + late at night + different city = suspicious.

Home example: Multiple failed logins + unknown device = security threat.

Nigerian example: Failed logins + unusual location + after-hours = fraud attempt.

Combined Query:
SELECT users.name, logs.ip_address, logs.login_time
FROM login_logs logs
JOIN users ON logs.user_id = users.id
WHERE logs.success = false
AND TIME(logs.login_time) > '22:00:00'
AND logs.ip_address NOT LIKE '192.168.%'
ORDER BY logs.login_time DESC;

Mini summary: Combining clues helps us detect hidden attacks.


Lesson 11: Using Subqueries for Advanced Threat Hunting

Definition: Subqueries can help us find users who have multiple suspicious activities.

Why it is important: Some attackers are very active. Subqueries help us find them.

Simple explanation: It's like asking a question, then asking another question based on the answer.

Real-life example: Find users who have had more than 3 failed logins and a login from an unusual IP.

School example: Find students who have failed logins and late-night access.

Home example: Find family members who have failed logins and unusual activity.

Nigerian example: Find customers who have failed logins and unusual transactions.

Subquery Example:
SELECT name FROM users
WHERE id IN (
    SELECT user_id FROM login_logs
    WHERE success = false
    GROUP BY user_id
    HAVING COUNT(*) > 5
);

Mini summary: Subqueries help us find users with multiple suspicious activities.


Lesson 12: Using LIKE for Threat Hunting

Definition: LIKE can help us find suspicious patterns in text, like email addresses or IP addresses.

Why it is important: Attackers often use patterns, like fake email addresses.

Simple explanation: It's like searching for a word in a book.

Real-life example: Finding all emails from a suspicious domain.

School example: Finding all students with fake email addresses.

Home example: Finding all devices with suspicious MAC addresses.

Nigerian example: Finding all transactions with suspicious reference numbers.

LIKE Query:
SELECT * FROM users WHERE email LIKE '%hacker%';
SELECT * FROM login_logs WHERE ip_address LIKE '10.0.%';

Mini summary: LIKE helps us find patterns in text data.


Lesson 13: Using Date and Time Functions

Definition: Date and time functions help us analyse data over time.

Why it is important: Attacks often happen at specific times.

Simple explanation: It's like checking the clock to see when something happened.

Real-life example: Finding all logins in the last 24 hours.

School example: Finding all access to the school system in the last week.

Home example: Finding all smart device usage in the last hour.

Nigerian example: Finding all transactions in the last month.

Date/Time Queries:
SELECT * FROM login_logs WHERE login_time > NOW() - INTERVAL 1 DAY;
SELECT * FROM login_logs WHERE DATE(login_time) = CURDATE();

Mini summary: Date/time functions help us analyse data over time.


Lesson 14: Practice โ€“ A Real-World Threat Hunt

Definition: Practice means using your skills on real-world data.

Why it is important: Practice helps you think like a detective.

Simple explanation: Like a fire drill โ€“ you practise so you're ready for the real thing.

Real-life example: A security team practices threat hunting every month.

School example: Students practice hunting for threats in a lab environment.

Home example: A parent practices monitoring their devices.

Nigerian example: A bank practices threat hunting on test data.

Practice Scenario:
You have a login_logs table. Write queries to find:
1. All failed logins in the last 24 hours.
2. All logins after 11 PM.
3. All logins from unusual IP addresses.
4. Users with more than 10 failed logins.

Mini summary: Practice makes you a better threat hunter.


Lesson 15: You Are Now a Threat Hunter!

Definition: A threat hunter is someone who actively searches for hidden threats. You have become one!

Why it is important: Your skills can help protect systems and stop attacks.

Simple explanation: You are now a digital detective.

Real-life example: You can help a company find suspicious activities.

School example: You can help your school protect its network.

Home example: You can help your family protect their devices.

Nigerian example: You can help a bank detect fraud.

You โ†’ Learned threat hunting โ†’ Can protect systems! ๐ŸŽ‰

Mini summary: You are now a threat hunter โ€“ congratulations!


๐Ÿ“Œ Key Vocabulary (with simple definitions)

  • Threat Hunting: Actively searching for hidden dangers.
  • Brute Force: Trying many passwords to break in.
  • IP Address: A unique number identifying a device on the internet.
  • Failed Login: A login attempt that was not successful.
  • Suspicious Activity: Activity that might indicate an attack.
  • After-Hours: Time outside normal working hours.
  • Anomaly: Something that is unusual or unexpected.
  • Compromised Account: An account that has been hacked.
  • Logs: Records of activities in a system.
  • Subquery: A query inside another query.

๐Ÿง  Important Concepts

  • Concept 1: Threat hunting is proactive. You don't wait for alerts โ€“ you search.
  • Concept 2: Failed logins are a key sign. Many failed attempts can mean an attack.
  • Concept 3: Timing matters. Logins at odd hours are suspicious.
  • Concept 4: Location matters. Logins from unusual places are suspicious.
  • Concept 5: Combine clues. A single clue might not mean much, but together they tell a story.

๐Ÿชœ Step-by-Step: How to Hunt for Threats

  1. Set up your database. Create tables to store login logs, user information, and IP addresses.
  2. Collect data. Insert logs from your systems.
  3. Define what is normal. Know what typical user behaviour looks like.
  4. Write queries for anomalies. Search for failed logins, after-hours activity, unusual IPs.
  5. Analyse the results. Look for patterns and investigate suspicious findings.
  6. Take action. If you find a threat, block the attack and fix the vulnerability.
  7. Review and improve. Learn from each hunt to get better.
Step 1: Set up database
Step 2: Collect data
Step 3: Define normal behaviour
Step 4: Write queries for anomalies
Step 5: Analyse results
Step 6: Take action
Step 7: Review and improve

๐ŸŒ Real-life Examples

  • Example 1: A company detects a brute force attack by querying for multiple failed logins from the same IP.
  • Example 2: A hospital finds unusual access to patient records by looking for after-hours logins.
  • Example 3: A government agency discovers a compromised account by querying for logins from unusual locations.

๐Ÿ‡ณ๐Ÿ‡ฌ Nigerian Examples

  • Example 1: A Nigerian bank detects fraud by finding failed logins from unusual IP addresses.
  • Example 2: A Nigerian telecom company finds suspicious activity by querying for after-hours logins.
  • Example 3: A Nigerian e-commerce site discovers a brute force attack by counting failed logins.

๐ŸŽˆ Fun Examples children can relate to

  • Fun Example 1: You have a table of times your friends tried to log into your game account. You find someone tried 20 times in one hour โ€“ that's a brute force attack!
  • Fun Example 2: You have a table of who uses your smart TV. You find someone is using it at 3 AM โ€“ that's unusual!
  • Fun Example 3: You have a table of logins to your favourite website. You find a login from a different country โ€“ that's suspicious!

๐Ÿ  Everyday Examples

  • Everyday 1: A parent checks who is using their Netflix account by looking at login times.
  • Everyday 2: A family monitors their Wi-Fi to see if any unknown devices are connected.
  • Everyday 3: A person checks their bank account to see if there are any unusual transactions.

๐Ÿ‘ฉโ€๐Ÿซ Teacher Notes

  • Use the warm-up story to introduce the concept of threat hunting.
  • Encourage students to think like detectives.
  • Provide sample datasets for students to practice on.
  • Discuss real-world security incidents and how they could have been detected.
  • Emphasise the importance of proactive security.

๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Parent Tips

  • Talk to your child about the importance of monitoring online activities.
  • Encourage your child to think about security in their daily lives.
  • Support your child's learning by providing access to resources and tools.
  • Discuss how companies use threat hunting to stay safe.

โœจ Interesting Facts

  • Fact 1: Many security breaches are discovered by threat hunters, not by alarms.
  • Fact 2: The average time to detect a breach is over 200 days โ€“ threat hunting helps reduce this.
  • Fact 3: Attackers often work at night to avoid detection.
  • Fact 4: Nigeria has a growing community of cybersecurity professionals.

๐Ÿ’ก Did You Know?

  • Did you know that you can use MySQL to analyse millions of log entries in seconds?
  • Did you know that many companies use MySQL for security monitoring?
  • Did you know that threat hunting is a high-demand job in cybersecurity?
  • Did you know that you can become a cybersecurity professional with the right skills?

๐Ÿ”” Remember This

  • Threat hunting is active searching for threats.
  • Failed logins, after-hours activity, and unusual IPs are red flags.
  • Combine clues to find hidden attacks.
  • MySQL is a powerful tool for threat hunting.
  • Practice makes you a better hunter.
  • You can make a difference by protecting systems.

โš ๏ธ Common Mistakes

  • Mistake 1: Ignoring failed logins as "normal".
  • Mistake 2: Not considering after-hours activity.
  • Mistake 3: Focusing on one clue instead of combining clues.
  • Mistake 4: Not using date/time functions to analyse activity over time.
  • Mistake 5: Forgetting to document and review findings.

๐ŸŒŸ Best Practices

  • Practice 1: Define what "normal" looks like in your system.
  • Practice 2: Regularly review login logs for anomalies.
  • Practice 3: Use multiple queries to get a full picture.
  • Practice 4: Document your findings and share with your team.
  • Practice 5: Continuously improve your hunting skills.

๐Ÿ“Š Illustrations & Tables

Flowchart: Threat Hunting Process

  Define Normal
        |
        V
  Collect Data
        |
        V
  Write Queries
        |
        V
  Analyse Results
        |
        V
  Identify Anomalies
        |
        V
  Investigate
        |
        V
  Take Action
        |
        V
  Review and Improve

Comparison Table: Normal vs Suspicious

Normal Activity Suspicious Activity
Logins during working hours Logins after midnight
Logins from known IPs Logins from unknown IPs
Few failed logins Many failed logins
Logins from one location Logins from multiple locations

Table: Common Threat Hunting Queries

Query Purpose Example Query
Failed logins SELECT * FROM login_logs WHERE success = false;
After-hours logins SELECT * FROM login_logs WHERE TIME(login_time) > '22:00:00';
Unusual IPs SELECT * FROM login_logs WHERE ip_address NOT LIKE '192.168.%';
Brute force SELECT user_id, COUNT(*) FROM login_logs WHERE success = false GROUP BY user_id HAVING COUNT(*) > 10;
Combined clues SELECT users.name, logs.ip_address FROM login_logs logs JOIN users ON logs.user_id = users.id WHERE logs.success = false AND TIME(logs.login_time) > '22:00:00';

Timeline: Your Threat Hunting Journey

Lesson 1: What is threat hunting?
    |
Lesson 2: Setting up a security database
    |
Lesson 3: Finding failed logins
    |
Lesson 4: After-hours logins
    |
Lesson 5: Suspicious IP addresses
    |
Lesson 6: Unusual user behaviour
    |
Lesson 7: Brute force attacks
    |
Lesson 8: Multiple failed logins from same IP
    |
Lesson 9: Logins from unusual locations
    |
Lesson 10: Combining clues
    |
Lesson 11: Subqueries
    |
Lesson 12: LIKE for threat hunting
    |
Lesson 13: Date/time functions
    |
Lesson 14: Practice
    |
YOU ARE A THREAT HUNTER! ๐ŸŽ‰

๐Ÿ“ End-of-Module Summary

Congratulations! You have completed Module Six of your Security Operation Centre Analyst training. You have learned how to use MySQL for threat hunting. You can now find failed logins, after-hours activity, suspicious IP addresses, and brute force attacks. You have learned to combine clues and use advanced queries to find hidden threats. You are now a true threat hunter!


โ“ Frequently Asked Questions (FAQs)

  1. Q: What is threat hunting?
    A: Actively searching for hidden threats in a system.
  2. Q: Why is threat hunting important?
    A: It helps find attacks that might otherwise go unnoticed.
  3. Q: What is a brute force attack?
    A: An attack where many passwords are tried to break in.
  4. Q: What is an IP address?
    A: A unique number identifying a device on the internet.
  5. Q: Why are after-hours logins suspicious?
    A: Most users don't log in at night.
  6. Q: What is an unusual IP address?
    A> An IP address from a location that is not typical.
  7. Q: How can I find failed logins?
    A: Use a query with WHERE success = false.
  8. Q: What is a subquery?
    A: A query inside another query.
  9. Q: How can I combine clues?
    A: Use multiple conditions in a WHERE clause or use JOIN.
  10. Q: How can I practice threat hunting?
    A: Use sample data and write queries to find suspicious activities.

๐Ÿ“ Review Questions (15)

  1. What is threat hunting?
  2. Why is threat hunting important?
  3. What is a brute force attack?
  4. What is an IP address?
  5. Why are after-hours logins suspicious?
  6. What is an unusual IP address?
  7. How can you find failed logins?
  8. What is a subquery?
  9. How can you combine clues?
  10. Give an example of a suspicious activity.
  11. How can you detect a brute force attack?
  12. What should you do if you find a suspicious activity?
  13. Why is practice important in threat hunting?
  14. How can MySQL help in threat hunting?
  15. What have you become after this module?

โœ๏ธ Fill-in-the-Blank

  1. ______ is actively searching for hidden threats.
  2. A ______ attack tries many passwords to break in.
  3. An ______ address identifies a device on the internet.
  4. ______ hours logins are suspicious.
  5. ______ IP addresses are from unknown locations.
  6. Failed logins have success = ______ .
  7. A ______ is a query inside another query.
  8. ______ clues helps us find hidden attacks.
  9. ______ is a powerful tool for threat hunting.
  10. ______ makes you a better threat hunter.
  11. Most employees don't log in at ______ .
  12. Many failed logins from the same IP can indicate a ______ attack.
  13. Logins from unusual ______ can indicate a compromised account.
  14. ______ functions help us analyse data over time.
  15. You are now a ______ hunter.

โœ… True or False

  1. Threat hunting is waiting for an alarm to go off. (False)
  2. A brute force attack tries many passwords. (True)
  3. After-hours logins are always normal. (False)
  4. Unusual IP addresses are not a concern. (False)
  5. Failed logins can indicate an attack. (True)
  6. A subquery is a query inside another query. (True)
  7. Combining clues helps find hidden threats. (True)
  8. MySQL is not useful for threat hunting. (False)
  9. Practice is important for threat hunting. (True)
  10. You can become a threat hunter. (True)

๐Ÿ”˜ Multiple Choice Questions

  1. What is threat hunting?
    A) Waiting for alerts
    B) Actively searching for threats
    C) Playing games
    Answer: B
  2. What is a brute force attack?
    A) A single failed login
    B) Trying many passwords
    C) A type of virus
    Answer: B
  3. What is an IP address?
    A) A user's name
    B) A unique device identifier
    C) A type of log
    Answer: B
  4. Why are after-hours logins suspicious?
    A) Most users don't log in at night
    B) They are always normal
    C) They are faster
    Answer: A
  5. What is an unusual IP address?
    A) An IP from a known location
    B) An IP from an unknown location
    C) A local IP
    Answer: B
  6. How can you find failed logins?
    A) SELECT * FROM login_logs WHERE success = true
    B) SELECT * FROM login_logs WHERE success = false
    C) SELECT * FROM login_logs WHERE success = NULL
    Answer: B
  7. What is a subquery?
    A) A query inside another query
    B) A query that fails
    C) A type of JOIN
    Answer: A
  8. How can you combine clues?
    A) Use multiple conditions in WHERE
    B) Use only one condition
    C) Ignore extra clues
    Answer: A
  9. What can multiple failed logins from the same IP indicate?
    A) A brute force attack
    B) Normal behaviour
    C) A system upgrade
    Answer: A
  10. What should you do if you find suspicious activity?
    A) Ignore it
    B) Investigate and take action
    C) Delete the logs
    Answer: B
  11. Why is practice important?
    A) It makes you faster and better
    B) It is not important
    C) It is only for fun
    Answer: A
  12. What tool helps with threat hunting?
    A) MySQL
    B) A calculator
    C) A painting
    Answer: A
  13. What does LIKE help with?
    A) Finding patterns in text
    B) Adding numbers
    C) Deleting data
    Answer: A
  14. What do date/time functions do?
    A) Analyse data over time
    B) Delete data
    C) Create tables
    Answer: A
  15. What have you become after this module?
    A) A threat hunter
    B) A beginner
    C) A robot
    Answer: A

๐Ÿ”— Matching Exercise

Match the term to its description:

Term Description
Threat Hunting Actively searching for threats
Brute Force Trying many passwords
IP Address Device identifier
Failed Login Unsuccessful login attempt
After-Hours Time outside normal hours

โœ๏ธ Short Answer Questions

  1. What is threat hunting?
  2. How can you detect a brute force attack?
  3. Why are after-hours logins suspicious?
  4. How can you use MySQL for threat hunting?
  5. What should you do if you find suspicious activity?

๐ŸŽญ Scenario-based Exercises

Scenario 1: You are a SOC Analyst. You notice that there are many failed logins from a specific IP address. Write a query to find all failed logins from that IP in the last 24 hours.

Scenario 2: You have a table of login logs. You want to find all users who have more than 5 failed logins after 10 PM. Write the query.

Scenario 3: You notice that a user has logged in from two different cities in 5 minutes. Write a query to find all users with logins from different locations within a short time.


๐Ÿ‘ฅ Group Activity

Threat Hunting Challenge: In groups of 4, you are given a sample database with login logs. Your task is to write queries to find at least 5 suspicious activities. Present your findings to the class and explain why they are suspicious.


๐Ÿง‘โ€๐ŸŽ“ Individual Activity

My Threat Hunt: Create a database with sample login logs. Write queries to find failed logins, after-hours logins, and suspicious IP addresses. Write a report on your findings.


๐Ÿ’ฌ Classroom Discussion Questions

  1. What is the most important sign of an attack?
  2. How can you protect against brute force attacks?
  3. Why is threat hunting better than waiting for alerts?
  4. How can companies improve their threat hunting?
  5. What would you do if you found a serious threat?

๐Ÿ› ๏ธ Mini Project: Build a Threat Hunting Dashboard

Task: Build a simple dashboard that shows the results of your threat hunting queries. Include tables for failed logins, after-hours logins, suspicious IPs, and brute force attempts. Present your dashboard to the class.


๐Ÿ“‹ Practical Assignment

Assignment: Find a real-world dataset of security logs (or use sample data). Write at least 5 threat hunting queries and document your findings. Explain what each query does and what it found.


๐Ÿ† Challenge Exercise

Challenge: Write a complex query that finds all users who have had more than 10 failed logins in the last 24 hours, and then joined by a login from an unusual IP address. Use JOIN, GROUP BY, HAVING, and subqueries.


๐Ÿ”‘ Quiz Answers

Fill-in-the-Blank Answers: 1. Threat hunting, 2. brute force, 3. IP, 4. After, 5. Unusual, 6. false, 7. subquery, 8. Combining, 9. MySQL, 10. Practice, 11. night, 12. brute force, 13. locations, 14. Date/time, 15. threat.

True or False: 1F, 2T, 3F, 4F, 5T, 6T, 7T, 8F, 9T, 10T.

Multiple Choice Answers: 1B, 2B, 3B, 4A, 5B, 6B, 7A, 8A, 9A, 10B, 11A, 12A, 13A, 14A, 15A.


๐ŸŽ Key Takeaways

  • Threat hunting is actively searching for hidden threats.
  • Failed logins, after-hours activity, and unusual IPs are red flags.
  • Brute force attacks try many passwords quickly.
  • Combining clues helps detect hidden attacks.
  • MySQL is a powerful tool for threat hunting.
  • Practice is essential to becoming a skilled threat hunter.
  • You can make a difference by protecting systems.

๐Ÿš€ Preparation for Module Seven

In Module Seven, we will learn about incident response โ€“ what to do when a security incident happens. You will learn how to contain an attack, investigate it, and recover from it. We will also look at how MySQL can help in incident response.

Before next class: Think about what you would do if you discovered a security breach. We will explore this together in the next module.


๐Ÿ›ก๏ธ You have completed Module Six โ€“ keep up the great work! ๐Ÿ›ก๏ธ

๐Ÿ† 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.
โ†’