📖 Scenario: You are part of a small company's IT team. Your job is to help protect the company's computer network from bad people who try to break in and cause harm.To do this well, you need to understand the kinds of attacks these bad people use. This knowledge helps you build better defenses.
🎯 Goal: Build a simple list of common attack types, set a threshold for which attacks are most dangerous, filter the list to only include those dangerous attacks, and finally, add a note explaining why knowing these attacks helps protect the network.
📋 What You'll Learn
Create a list called attack_types with these exact strings: 'Phishing', 'Malware', 'DDoS', 'Man-in-the-Middle', 'SQL Injection'
Create a variable called danger_threshold and set it to 3
Create a dictionary called attack_danger_levels with these exact pairs: 'Phishing': 2, 'Malware': 4, 'DDoS': 5, 'Man-in-the-Middle': 3, 'SQL Injection': 4
Create a list called dangerous_attacks that includes only attacks from attack_types whose danger level in attack_danger_levels is greater than or equal to danger_threshold
Create a string variable called defense_note with the exact text: 'Understanding attacks helps build strong defenses.'
💡 Why This Matters
🌍 Real World
Knowing common cyber attacks helps IT teams protect networks by focusing on the most dangerous threats.
💼 Career
Cybersecurity professionals must understand attack methods to design effective defenses and keep systems safe.
Progress0 / 4 steps
1
Create the list of attack types
Create a list called attack_types with these exact strings: 'Phishing', 'Malware', 'DDoS', 'Man-in-the-Middle', 'SQL Injection'
Computer Networks
Hint
Use square brackets [] to create a list and include all attack names as strings inside.
2
Set the danger threshold
Create a variable called danger_threshold and set it to the number 3
Computer Networks
Hint
Just assign the number 3 to the variable named danger_threshold.
3
Create the attack danger levels dictionary
Create a dictionary called attack_danger_levels with these exact pairs: 'Phishing': 2, 'Malware': 4, 'DDoS': 5, 'Man-in-the-Middle': 3, 'SQL Injection': 4
Computer Networks
Hint
Use curly braces {} to create a dictionary with attack names as keys and their danger levels as values.
4
Filter dangerous attacks and add defense note
Create a list called dangerous_attacks that includes only attacks from attack_types whose danger level in attack_danger_levels is greater than or equal to danger_threshold. Then create a string variable called defense_note with the exact text: 'Understanding attacks helps build strong defenses.'
Computer Networks
Hint
Use a list comprehension to filter attacks. Then assign the exact text to defense_note.
Practice
(1/5)
1. Why is it important to understand how cyber attacks work?
easy
A. Because it makes your computer run faster
B. Because it reduces the need for passwords
C. Because it allows you to ignore security warnings
D. Because it helps you recognize and stop attacks early
Solution
Step 1: Understand the role of attack knowledge
Knowing how attacks happen helps you spot signs of an attack early.
Step 2: Connect early recognition to defense
Early spotting means you can stop or reduce damage quickly.
Final Answer:
Because it helps you recognize and stop attacks early -> Option D
Quick Check:
Understanding attacks = Early defense [OK]
Hint: Think: Knowing attacks means spotting them fast [OK]
Common Mistakes:
Confusing attack knowledge with performance improvement
Ignoring the importance of early detection
Believing passwords become unnecessary
2. Which of the following is the correct way to describe a phishing attack?
easy
A. An attack that tricks users into giving personal information
B. An attack that physically damages hardware
C. An attack that speeds up internet connection
D. An attack that deletes all software automatically
Solution
Step 1: Define phishing attack
Phishing is when attackers trick people into sharing private info like passwords.
Step 2: Eliminate incorrect options
Phishing does not damage hardware, speed internet, or delete software automatically.
Final Answer:
An attack that tricks users into giving personal information -> Option A
Quick Check:
Phishing = Trick for info [OK]
Hint: Phishing = fake messages to steal info [OK]
Common Mistakes:
Mixing phishing with physical or automatic damage
Thinking phishing improves system speed
Confusing phishing with malware deletion
3. If a company knows that attackers often use weak passwords to break in, what is the best defense?
medium
A. Allow users to choose any password they want
B. Force users to create strong, complex passwords
C. Remove all passwords from the system
D. Ignore password security and focus on hardware
Solution
Step 1: Identify the attack method
Attackers use weak passwords to gain access easily.
Step 2: Choose the defense that counters weak passwords
Strong, complex passwords make it harder for attackers to guess or crack them.
Final Answer:
Force users to create strong, complex passwords -> Option B