Lesson 03 Network Traffic Analysis with AI
Theme:

Answers

Reference answers for Lesson 03 lab and homework.

Part 1 — Lab Answers

Exercise 1 — tcpdump Triage

Expected findings

Exercise 2 — DNS Exfiltration Hunting

Expected findings

Exercise 3 — HTTP Session Reconstruction

Expected findings

Exercise 4 — NetFlow Beacon Detection

Expected findings

Final Exercise — Attack Story

Expected chain

Initial access via HTTP (credential from Exercise 3) → DNS tunnel for C2 (Exercise 2) → NetFlow beacon confirms periodicity (Exercise 4) → tcpdump confirms protocol mix (Exercise 1). A good synthesis connects the same compromised internal IP across three or four sources.


Part 2 — Homework Answers

Task 1 — Beacon Hunting Script

Expected shape

A script of ~60 lines using collections.defaultdict(list) to group, statistics for stddev, and jitter computed as stdev/mean * 100. The main output should flag a single tuple that matches the lab's C2 finding.

Task 2 — DNS Exfil Decoder

Expected shape

Extract the leftmost label(s) per query, concatenate in arrival order, attempt base64.b32decode then base64.b64decode with padding repair, print whichever yields >80% printable ASCII. A good solution handles case-sensitivity and missing padding gracefully.

Task 3 — Egress Filter Recommendation

Expected rules

Each rule should list realistic false-positive scenarios (e.g., "breaks captive portal login for visitor wifi").