DAY 1 · MODULE 4
Python for Cyber Security
Learn the Python basics needed to automate security analysis.
Understand the concept
Variables
Conditions
Loops
Functions
Lists and dictionaries
File handling
Exceptions
Modules
Why this matters
Python lets students automate repeated security-analysis tasks and understand how security tools process data.
See what happens internally
Interactive visualization loads here.
Perform the activity
- Open the browser Python lab.
- Modify variables and conditions.
- Loop over a list of ports.
- Print a simple service classification.
Workshop safety: Activities involving scanning, web vulnerabilities or security testing must be performed only on the assigned training target or intentionally vulnerable lab.
Read and understand the working example
ports = [22, 80, 443]
for port in ports:
print(port)Open in Browser Code LabProve your understanding
Modify the starter program so port 22 prints SSH, port 80 prints HTTP and port 443 prints HTTPS.