Exercises: Module 02 — Networking for Security¶
Instructions¶
Complete each exercise in order using your authorized lab environment (Kali Linux + Metasploitable 2 on a host-only network, or HackTheBox/TryHackMe).
Easy Exercises (1–3)¶
Exercise 1¶
Difficulty: Easy Objective: OSI layer attack classification
For each attack type below, identify which OSI layer(s) it primarily targets and explain why: ARP Spoofing, SQL Injection, DDoS SYN Flood, SSL Stripping, DNS Cache Poisoning, HTTP Header Injection
Exercise 2¶
Difficulty: Easy Objective: Basic nmap usage
Using your Kali Linux against your authorized lab target (Metasploitable or HackTheBox machine):
# Run these three nmap commands and document the output:
nmap -sn [target-ip] # Host discovery
nmap [target-ip] # Default port scan
nmap -sV --top-ports 100 [target-ip] # Service version detection
Document: how many ports are open, which services are running, which versions are identified.
Exercise 3¶
Difficulty: Easy Objective: Protocol identification
For each port/service pair from your nmap scan, identify: (a) what the protocol is used for, (b) whether it transmits data in cleartext or encrypted, © what an attacker would look for when this port is open.
Medium Exercises (4–6)¶
Exercise 4¶
Difficulty: Medium Objective: Full port scan and service enumeration
# Run a comprehensive scan against your authorized target
nmap -p- -sV -sC -T4 -oA ~/lab/nmap_full [target-ip]
# -sC runs default NSE scripts
# Document all findings in a recon table format
Exercise 5¶
Difficulty: Medium Objective: Wireshark analysis
Capture 5 minutes of traffic between your Kali VM and your authorized target. Apply filters to find: HTTP requests, DNS queries, any cleartext protocols. Document what information is visible.
Exercise 6¶
Difficulty: Medium Objective: Banner grabbing
Use netcat to manually connect to 5 different services on your authorized target and capture the service banners. Document: service name, version from banner, any security implications of the version.
Hard Exercises (7–8)¶
Exercise 7¶
Difficulty: Hard Objective: Write a Python port scanner
Write a Python script that:
- Accepts a target IP and port range as arguments
- Scans each port using socket connections
- Identifies open vs. closed ports
- Grabs banners from open ports where possible
- Outputs a structured report
import socket
import sys
# Implement your scanner here
# Remember: only run against your authorized lab environment
Exercise 8¶
Difficulty: Hard Objective: Network reconnaissance report
Write a complete network reconnaissance report for your lab target covering: host discovery, open ports, services and versions, identified vulnerabilities (using nmap --script vuln output), and your recommended follow-up testing priorities.
Expert Exercise (9)¶
Exercise 9¶
Difficulty: Expert Objective: Analyze a network-level CVE
Research CVE-2017-0144 (EternalBlue/MS17-010). Write a technical analysis covering: the exact protocol and protocol message type that is vulnerable, why the buffer overflow occurs conceptually, what an attacker achieves by exploiting it, and what defensive controls would prevent exploitation (network-level, host-level, both).