Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Why Proactive Scanning Finds Weaknesses
📖 Scenario: You work in a cybersecurity team that wants to find weak points in a company's computer system before hackers do.To do this, you use a method called proactive scanning, which checks the system regularly to spot problems early.
🎯 Goal: Build a simple Python program that lists system parts, sets a scanning threshold, checks each part for weaknesses, and marks the weak parts found by proactive scanning.
📋 What You'll Learn
Create a dictionary called system_parts with these exact entries: 'Firewall': 85, 'Antivirus': 90, 'Web Server': 70, 'Database': 65, 'Email Server': 75
Create a variable called scan_threshold and set it to 75
Use dictionary comprehension with variables part and security_score to iterate over system_parts.items() and create a dictionary called weaknesses_found that includes only parts with scores less than scan_threshold
Add a final line that sets a variable called scan_complete to True to show the scan finished
💡 Why This Matters
🌍 Real World
Proactive scanning is used by cybersecurity teams to find and fix weaknesses before attackers exploit them.
💼 Career
Understanding how to identify weak points in systems is key for roles like security analyst, penetration tester, and IT auditor.
Progress0 / 4 steps
1
Create the system parts dictionary
Create a dictionary called system_parts with these exact entries: 'Firewall': 85, 'Antivirus': 90, 'Web Server': 70, 'Database': 65, 'Email Server': 75
Cybersecurity
Hint
Use curly braces {} to create a dictionary with the exact keys and values given.
2
Set the scanning threshold
Create a variable called scan_threshold and set it to 75
Cybersecurity
Hint
Just assign the number 75 to the variable named scan_threshold.
3
Find weaknesses with a loop and dictionary comprehension
Use dictionary comprehension with variables part and security_score to iterate over system_parts.items() and create a dictionary called weaknesses_found that includes only parts with scores less than scan_threshold
Cybersecurity
Hint
Use dictionary comprehension with for part, security_score in system_parts.items() and an if condition to filter.
4
Mark the scan as complete
Add a final line that sets a variable called scan_complete to True to show the scan finished
Cybersecurity
Hint
Just assign True to the variable scan_complete.
Practice
(1/5)
1. Why is proactive scanning important in cybersecurity?
easy
A. It finds security weaknesses early before attackers exploit them.
B. It slows down the system to prevent attacks.
C. It replaces the need for software updates.
D. It only checks for hardware problems.
Solution
Step 1: Understand the purpose of proactive scanning
Proactive scanning regularly checks systems to find security weaknesses early.
Step 2: Compare options to the purpose
Only It finds security weaknesses early before attackers exploit them. correctly states that it finds weaknesses early before attackers exploit them.
Final Answer:
It finds security weaknesses early before attackers exploit them. -> Option A
Quick Check:
Early weakness detection = It finds security weaknesses early before attackers exploit them. [OK]
Hint: Remember: proactive means finding problems before they happen [OK]
Common Mistakes:
Thinking scanning slows system down
Confusing scanning with software updates
Assuming it only checks hardware
2. Which of the following is the correct description of proactive scanning?
easy
A. Regularly using automated tools to detect vulnerabilities.
B. Waiting for attacks to happen before checking systems.
C. Manually checking only after a breach occurs.
D. Ignoring system updates to save time.
Solution
Step 1: Identify the scanning method
Proactive scanning uses automated tools regularly to find vulnerabilities.
Step 2: Eliminate incorrect options
Options B, C, and D describe reactive or incorrect approaches, not proactive scanning.
Final Answer:
Regularly using automated tools to detect vulnerabilities. -> Option A
Quick Check:
Automated regular checks = Regularly using automated tools to detect vulnerabilities. [OK]
Hint: Proactive means regular automated checks, not waiting [OK]
Common Mistakes:
Confusing proactive with reactive scanning
Thinking manual checks are proactive
Ignoring the role of automation
3. Consider this code snippet representing a simple proactive scan process:
vulnerabilities = ['weak_password', 'open_port', 'outdated_software']
found = []
for item in vulnerabilities:
if 'open' in item:
found.append(item)
print(found)
What will be the output?
medium
A. ['weak_password']
B. ['open_port']
C. ['outdated_software']
D. []
Solution
Step 1: Analyze the loop and condition
The loop checks each vulnerability; it adds the item to found if 'open' is in the string.
Step 2: Check which items contain 'open'
'open_port' contains 'open', so it is added. Others do not.
Final Answer:
['open_port'] -> Option B
Quick Check:
Contains 'open' = ['open_port'] [OK]
Hint: Look for the keyword 'open' in list items [OK]
Common Mistakes:
Adding all items without checking condition
Confusing string containment
Ignoring case sensitivity (not relevant here)
4. This code is meant to find vulnerabilities containing 'weak' but has an error:
vulnerabilities = ['weak_password', 'open_port', 'outdated_software']
found = []
for item in vulnerabilities
if 'weak' in item:
found.append(item)
print(found)
What is the error?
medium
A. Wrong variable name in the loop.
B. Incorrect indentation of the if statement.
C. Using append instead of extend.
D. Missing colon after for loop statement.
Solution
Step 1: Check syntax of for loop
The for loop line is missing a colon at the end, which is required in Python.
Step 2: Verify other parts
Indentation and variable names are correct; append is appropriate for adding single items.
Final Answer:
Missing colon after for loop statement. -> Option D
Quick Check:
For loop needs colon = Missing colon after for loop statement. [OK]
Hint: Look for missing colons after loops or if statements [OK]
Common Mistakes:
Thinking indentation is wrong when it is correct
Confusing append with extend
Assuming variable name error without evidence
5. A company uses proactive scanning to find weaknesses. After scanning, it finds some systems with outdated software and weak passwords. What should the company do next to improve security?
hard
A. Ignore the findings since no attack happened yet.
B. Wait for attackers to exploit the weaknesses before acting.
C. Fix the outdated software and strengthen passwords immediately.
D. Only scan once a year to save resources.
Solution
Step 1: Understand the purpose of proactive scanning
It finds weaknesses early so they can be fixed before attacks happen.
Step 2: Decide the correct action after finding weaknesses
The company should fix the issues immediately to improve security.
Final Answer:
Fix the outdated software and strengthen passwords immediately. -> Option C
Quick Check:
Fix found weaknesses promptly = Fix the outdated software and strengthen passwords immediately. [OK]
Hint: Fix problems found by scanning right away [OK]