Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to display the port number used by the HTTP service.
Cybersecurity
print('The HTTP service uses port [1]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing HTTP port with FTP (21) or HTTPS (443).
✗ Incorrect
HTTP typically uses port 80 for communication.
2fill in blank
mediumComplete the command to check which service is listening on port {{BLANK_1}}.
Cybersecurity
netstat -an | grep [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 80 which is for HTTP, not SSH.
✗ Incorrect
Port 22 is commonly used by SSH service.
3fill in blank
hardFix the error in the command to stop the service running on port {{BLANK_1}}.
Cybersecurity
sudo fuser -k [1]/tcp Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 22 which is for SSH, not HTTP.
✗ Incorrect
Port 80 is used by HTTP service, which can be stopped using this command.
4fill in blank
hardFill both blanks to create a dictionary mapping services to their default ports.
Cybersecurity
services = {'HTTP': [1], 'FTP': [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing FTP port with SSH port 22.
✗ Incorrect
HTTP uses port 80 and FTP uses port 21 by default.
5fill in blank
hardFill all three blanks to filter services running on ports greater than 1024.
Cybersecurity
filtered_services = {service: port for service, port in services.items() if port [1] 1024 [2] service != '[3]'} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' for port comparison.
Not excluding HTTP service correctly.
✗ Incorrect
This code filters services with ports greater than 1024 and excludes HTTP.