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
Common Network Protocols and Vulnerabilities
📖 Scenario: You are learning about common network protocols used in everyday internet communication and the typical vulnerabilities that can affect them. Understanding these helps you recognize how data travels and where security risks may appear.
🎯 Goal: Build a simple reference dictionary that lists common network protocols with their port numbers and a known vulnerability for each. This will help you remember key facts about network security basics.
📋 What You'll Learn
Create a dictionary named protocols with exact protocol names as keys and their port numbers as values
Add a variable named vulnerability_threshold set to the number 22
Create a new dictionary named vulnerable_protocols that includes only protocols with port numbers less than vulnerability_threshold
Add a final dictionary named protocol_vulnerabilities mapping each protocol in vulnerable_protocols to a known vulnerability string
💡 Why This Matters
🌍 Real World
Network administrators and cybersecurity professionals use knowledge of protocols and their vulnerabilities to secure networks and prevent attacks.
💼 Career
Understanding common network protocols and their weaknesses is essential for roles like network security analyst, system administrator, and cybersecurity engineer.
Progress0 / 4 steps
1
Create the protocols dictionary
Create a dictionary called protocols with these exact entries: 'HTTP': 80, 'HTTPS': 443, 'FTP': 21, 'SSH': 22, and 'Telnet': 23.
Cybersecurity
Hint
Use curly braces {} to create a dictionary with keys as protocol names and values as port numbers.
2
Add a vulnerability threshold variable
Add a variable named vulnerability_threshold and set it to the number 22.
Cybersecurity
Hint
Just assign the number 22 to the variable vulnerability_threshold.
3
Filter protocols below the threshold
Create a new dictionary called vulnerable_protocols that includes only the protocols from protocols whose port numbers are less than vulnerability_threshold. Use a dictionary comprehension with for protocol, port in protocols.items().
Cybersecurity
Hint
Use a dictionary comprehension to select only protocols with port numbers less than 22.
4
Map protocols to vulnerabilities
Create a dictionary called protocol_vulnerabilities that maps each protocol in vulnerable_protocols to a known vulnerability string. Use these exact pairs: 'FTP': 'Unencrypted credentials', 'SSH': 'Brute force attacks', 'Telnet': 'Data interception'. Use a dictionary comprehension iterating over vulnerable_protocols.keys().
Cybersecurity
Hint
Use a dictionary comprehension to map only the protocols present in vulnerable_protocols to their vulnerabilities.
Practice
(1/5)
1. Which protocol is primarily used to securely browse websites by encrypting data between your browser and the server?
easy
A. HTTPS
B. FTP
C. HTTP
D. DNS
Solution
Step 1: Understand the purpose of HTTPS
HTTPS stands for HyperText Transfer Protocol Secure and encrypts data to protect privacy.
Step 2: Compare with other protocols
HTTP is not secure, FTP is for file transfer, and DNS resolves domain names, none encrypt data like HTTPS.
Final Answer:
HTTPS -> Option A
Quick Check:
Secure web browsing = HTTPS [OK]
Hint: Secure web browsing uses HTTPS, not HTTP or FTP [OK]
Common Mistakes:
Confusing HTTP with HTTPS
Thinking FTP encrypts web data
Assuming DNS secures browsing
2. Which of the following is the correct port number for the FTP protocol by default?
easy
A. 80
B. 21
C. 443
D. 53
Solution
Step 1: Recall default FTP port
FTP (File Transfer Protocol) uses port 21 by default for control commands.
Step 2: Identify other ports
Port 80 is for HTTP, 443 for HTTPS, and 53 for DNS, so they are incorrect for FTP.
Final Answer:
21 -> Option B
Quick Check:
FTP default port = 21 [OK]
Hint: FTP control commands use port 21 by default [OK]
Common Mistakes:
Choosing port 80 (HTTP) for FTP
Confusing HTTPS port 443 with FTP
Selecting DNS port 53
3. Consider this simplified code snippet simulating a DNS query response check:
response = {'status': 'NOERROR', 'data': '1.2.3.4'}
if response['status'] == 'NOERROR':
print('Valid IP:', response['data'])
else:
print('Error in DNS response')
What will be printed?
medium
A. Valid IP: 1.2.3.4
B. KeyError
C. Valid IP: NOERROR
D. Error in DNS response
Solution
Step 1: Check the condition on response status
The code checks if response['status'] equals 'NOERROR', which it does.
Step 2: Determine the printed output
Since condition is true, it prints 'Valid IP:' followed by response['data'], which is '1.2.3.4'.
Final Answer:
Valid IP: 1.2.3.4 -> Option A
Quick Check:
response['status'] == 'NOERROR' prints IP [OK]
Hint: Check condition first; if true, print IP from data key [OK]
Common Mistakes:
Confusing status with data value
Expecting error when none occurs
Assuming KeyError without missing keys
4. A network administrator notices that FTP traffic is being intercepted and credentials stolen. Which vulnerability is most likely being exploited?
medium
A. SQL Injection
B. DNS Spoofing
C. Man-in-the-Middle Attack
D. Cross-Site Scripting
Solution
Step 1: Identify the nature of the attack
Intercepting FTP traffic and stealing credentials indicates someone is spying on communication.
Step 2: Match with known vulnerabilities
Man-in-the-Middle (MitM) attacks intercept and alter communication between two parties, fitting this scenario.
Final Answer:
Man-in-the-Middle Attack -> Option C
Quick Check:
Intercepted FTP = Man-in-the-Middle [OK]
Hint: Intercepted communication usually means Man-in-the-Middle attack [OK]
Common Mistakes:
Confusing with DNS Spoofing
Thinking SQL Injection affects FTP
Mixing with Cross-Site Scripting
5. You want to secure a company's email communication. Which protocol should you use to encrypt emails during transmission to prevent eavesdropping?
hard
A. FTP
B. Telnet
C. HTTP
D. SMTP with STARTTLS
Solution
Step 1: Identify email transmission protocols
SMTP is the standard protocol for sending emails, but by default it is unencrypted.
Step 2: Choose encryption method for SMTP
STARTTLS upgrades SMTP to use encryption, protecting emails from eavesdropping during transmission.
Step 3: Exclude other protocols
FTP is for file transfer, HTTP is for web browsing, and Telnet is insecure remote access; none encrypt email.
Final Answer:
SMTP with STARTTLS -> Option D
Quick Check:
Email encryption during send = SMTP + STARTTLS [OK]
Hint: Use SMTP with STARTTLS to encrypt email sending [OK]