0
0
Cybersecurityknowledge~30 mins

Service and port management in Cybersecurity - Mini Project: Build & Apply

Choose your learning style9 modes available
Service and Port Management Basics
📖 Scenario: You are a network administrator managing a small office network. You need to keep track of which services run on which ports to ensure security and proper access.
🎯 Goal: Build a simple list of common services with their port numbers, then filter to find services running on ports below 1024, which are considered well-known ports.
📋 What You'll Learn
Create a dictionary called services with these exact entries: 'HTTP': 80, 'HTTPS': 443, 'FTP': 21, 'SSH': 22, 'SMTP': 25
Create a variable called well_known_port_limit and set it to 1024
Create a new dictionary called well_known_services that includes only the services from services running on ports less than well_known_port_limit
Add a final line that creates a list called service_names containing only the names of the services in well_known_services
💡 Why This Matters
🌍 Real World
Network administrators often need to know which services run on which ports to configure firewalls and monitor network traffic.
💼 Career
Understanding service and port management is essential for cybersecurity roles, network engineering, and system administration.
Progress0 / 4 steps
1
Create the services dictionary
Create a dictionary called services with these exact entries: 'HTTP': 80, 'HTTPS': 443, 'FTP': 21, 'SSH': 22, 'SMTP': 25
Cybersecurity
Need a hint?

Use curly braces {} to create a dictionary with service names as keys and port numbers as values.

2
Set the well-known port limit
Create a variable called well_known_port_limit and set it to 1024
Cybersecurity
Need a hint?

Just assign the number 1024 to the variable well_known_port_limit.

3
Filter well-known services
Create a new dictionary called well_known_services that includes only the services from services running on ports less than well_known_port_limit
Cybersecurity
Need a hint?

Use dictionary comprehension to select services with ports less than well_known_port_limit.

4
List the names of well-known services
Add a final line that creates a list called service_names containing only the names of the services in well_known_services
Cybersecurity
Need a hint?

Use the keys() method on the dictionary and convert it to a list.