Mini Project: A Packet-Capture Analyser
You will build a small network-security sensor in Python: a program that reads pcap files byte by byte, decodes Ethernet, ARP, IPv4, TCP, UDP and DNS with struct, and raises three kinds of alerts that this course has taught you to recognise:
- cleartext credentials (an HTTP login form, HTTP Basic authentication, FTP/POP3/IMAP passwords),
- ARP spoofing (an IP address whose MAC changes),
- NXDOMAIN bursts (many failed lookups from one client in a short window, a sign of DGA malware or misconfiguration).
You then cross-check the results with tshark and write up the findings with the template at the end. Every step links to the lesson it relies on.
Data and scope. The analyser runs in your browser, which can't read the sandbox's files, so the sample captures arp.pcap, dns.pcap and http.pcap are embedded as hex (2,617 bytes in total), with a hash check that proves they are the same files as in $SAMPLES/pcap. A fourth capture with a burst of failed lookups is generated inside the program. All of it is synthetic lab traffic (10.10.0.0/24, lab.test); the password in it is the lab-only lab-only-123. Run your finished analyser only on captures you are authorised to analyse.
Step 1: the pcap format
A classic pcap file (the format tcpdump writes; Wireshark's newer default is pcapng) is a 24-byte global header followed by records, each a 16-byte record header plus the captured bytes:
| Global header field | Bytes | In the samples |
|---|---|---|
| magic number | 4 | d4 c3 b2 a1: 0xa1b2c3d4 written little-endian, so all header fields are little-endian, microsecond timestamps |
| version major, minor | 2 + 2 | 2.4 |
| time zone offset, timestamp accuracy | 4 + 4 | 0, 0 |
| snap length | 4 | 65535 |
| link type | 4 | 1 = Ethernet |
| Record header field | Bytes |
|---|---|
| timestamp seconds, microseconds | 4 + 4 |
| captured length, original length | 4 + 4 |
The packet bytes themselves are in network byte order as always, so a pcap reader mixes < (file headers) and ! (packet headers) in its struct formats. The first program reads the smallest sample, arp.pcap (198 bytes = 24 + 3 × (16 + 42)):
import struct
from datetime import datetime, timezone
ARP_PCAP = bytes.fromhex(
"d4c3b2a1020004000000000000000000ffff000001000000a0ba6869000000002a0000002a000000ffffffffffff0200000a"
"0a05080600010800060400010200000a0a050a0a00050000000000000a0a0001a0ba6869900100002a0000002a0000000200"
"000a0a050200000a0a01080600010800060400020200000a0a010a0a00010200000a0a050a0a0005a5ba6869000000002a00"
"00002a0000000200000a0a050200000a0a66080600010800060400020200000a0a660a0a00010200000a0a050a0a0005")
magic, vmaj, vmin, tz, acc, snap, link = struct.unpack("<IHHiIII", ARP_PCAP[:24])
print(f"magic 0x{magic:08x}, version {vmaj}.{vmin}, snaplen {snap}, link type {link} (Ethernet)")
off = 24
while off < len(ARP_PCAP):
sec, usec, incl, orig = struct.unpack("<IIII", ARP_PCAP[off:off + 16])
frame = ARP_PCAP[off + 16:off + 16 + incl]
when = datetime.fromtimestamp(sec, timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
etype = struct.unpack("!H", frame[12:14])[0]
print(f"record at offset {off:>3}: {when}.{usec:06d} {incl} bytes EtherType 0x{etype:04x}")
off += 16 + inclmagic 0xa1b2c3d4, version 2.4, snaplen 65535, link type 1 (Ethernet)
record at offset 24: 2026-01-15 10:00:00.000000 42 bytes EtherType 0x0806
record at offset 82: 2026-01-15 10:00:00.000400 42 bytes EtherType 0x0806
record at offset 140: 2026-01-15 10:00:05.000000 42 bytes EtherType 0x0806
The timestamps are the lab's fixed capture clock. (Ethernet Frames and MAC Addresses explains the EtherType.)
Step 2: decoders, detectors and a full run
The complete analyser is below. Read it in sections:
- 0. Integrity: the first 16 hex digits of each embedded file's SHA-256 must match the sandbox files (the same check you would do on evidence before analysing it).
- 1. pcap reader and writer, as in step 1, plus a writer used to build the synthetic capture.
- 2. Decoders: Ethernet and ARP (ARP on the Wire), IPv4 using the IHL and total length (The IPv4 Header), TCP using the data offset (The TCP Header), UDP, and a minimal DNS header and question parser (DNS Messages in Packets).
- 3. Detectors: cleartext credentials (HTTP in Cleartext, FTP), ARP spoofing as an IP-to-MAC change (ARP Spoofing), and an NXDOMAIN burst rule: 5 or more NXDOMAIN answers to one client within 10 seconds (DNS Resolution).
- 4. A synthetic burst: six NXDOMAIN responses for random-looking
.examplenames to10.10.0.9, 0.8 s apart, built byte by byte and written as a pcap. - 5. Run: every capture through every detector, then the alerts in time order.
ARP_PCAP = bytes.fromhex(
"d4c3b2a1020004000000000000000000ffff000001000000a0ba6869000000002a0000002a000000ffffffffffff0200000a"
"0a05080600010800060400010200000a0a050a0a00050000000000000a0a0001a0ba6869900100002a0000002a0000000200"
"000a0a050200000a0a01080600010800060400020200000a0a010a0a00010200000a0a050a0a0005a5ba6869000000002a00"
"00002a0000000200000a0a050200000a0a66080600010800060400020200000a0a660a0a00010200000a0a050a0a0005")
DNS_PCAP = bytes.fromhex(
"d4c3b2a1020004000000000000000000ffff000001000000a0ba68690000000048000000480000000200000a0a350200000a"
"0a0508004500003a10000000401156660a0a00050a0a00359c4100350026760b1a2b0100000100000000000003777777036c"
"616204746573740000010001a0ba6869b004000064000000640000000200000a0a050200000a0a3508004500005610000000"
"4011564a0a0a00350a0a000500359c41004228671a2b8580000100010000000003777777036c616204746573740000010001"
"03777777036c6162047465737400000100010000012c00040a0a000aa0ba686920a1070049000000490000000200000a0a35"
"0200000a0a0508004500003b10000000401156650a0a00050a0a00359c4200350027a28c1a2c01000001000000000000046e"
"6f7065036c616204746573740000010001a0ba68696ca5070093000000930000000200000a0a050200000a0a350800450000"
"85100000004011561b0a0a00350a0a000500359c4200711b481a2c85830001000000010000046e6f7065036c616204746573"
"740000010001036c6162047465737400000600010000012c0036026e73036c61620474657374000a686f73746d6173746572"
"036c616204746573740078c27b6d00000e1000000258000151800000012c")
HTTP_PCAP = bytes.fromhex(
"d4c3b2a1020004000000000000000000ffff000001000000a0ba6869000000003a0000003a0000000200000a0a0a0200000a"
"0a0508004500002c10000000400656aa0a0a00050a0a000ac4ec0050000f4240000000006002faf081870000020405b4a0ba"
"6869fa0000003a0000003a0000000200000a0a050200000a0a0a08004500002c10000000400656aa0a0a000a0a0a00050050"
"c4ec002dc6c0000f42416012fe88b6f00000020405b4a0ba6869f401000036000000360000000200000a0a0a0200000a0a05"
"08004500002810000000400656ae0a0a00050a0a000ac4ec0050000f4241002dc6c1501001f6cb400000a0ba6869ee020000"
"85000000850000000200000a0a0a0200000a0a05080045000077100000004006565f0a0a00050a0a000ac4ec0050000f4241"
"002dc6c1501801f62d2d0000474554202f20485454502f312e310d0a486f73743a207777772e6c61622e746573740d0a5573"
"65722d4167656e743a206c61622d636c69656e742f312e300d0a4163636570743a202a2f2a0d0a0d0aa0ba6869e803000036"
"000000360000000200000a0a050200000a0a0a08004500002810000000400656ae0a0a000a0a0a00050050c4ec002dc6c100"
"0f4290501001fdcaea0000a0ba6869e2040000bb000000bb0000000200000a0a050200000a0a0a0800450000ad1000000040"
"0656290a0a000a0a0a00050050c4ec002dc6c1000f4290501801fd84c50000485454502f312e3120323030204f4b0d0a5365"
"727665723a206c61622d68747470640d0a436f6e74656e742d547970653a20746578742f68746d6c0d0a436f6e74656e742d"
"4c656e6774683a2035300d0a0d0a3c68746d6c3e3c626f64793e48656c6c6f2066726f6d207777772e6c61622e746573743c"
"2f626f64793e3c2f68746d6c3e0aa0ba6869dc05000036000000360000000200000a0a0a0200000a0a050800450000281000"
"0000400656ae0a0a00050a0a000ac4ec0050000f4290002dc746501001f5ca6d0000a0ba6869d60600003600000036000000"
"0200000a0a0a0200000a0a0508004500002810000000400656ae0a0a00050a0a000ac4ec0050000f4290002dc746501101f5"
"ca6c0000a0ba6869d007000036000000360000000200000a0a050200000a0a0a08004500002810000000400656ae0a0a000a"
"0a0a00050050c4ec002dc746000f4291501101fdca630000a0ba6869ca08000036000000360000000200000a0a0a0200000a"
"0a0508004500002810000000400656ae0a0a00050a0a000ac4ec0050000f4291002dc747501001f5ca6b0000a1ba68690000"
"00003a0000003a0000000200000a0a0a0200000a0a0508004500002c10000000400656aa0a0a00050a0a000ac4ee0050001e"
"8480000000006002faf03f360000020405b4a1ba6869fa0000003a0000003a0000000200000a0a050200000a0a0a08004500"
"002c10000000400656aa0a0a000a0a0a00050050c4ee003d0900001e84816012fe8832500000020405b4a1ba6869f4010000"
"36000000360000000200000a0a0a0200000a0a0508004500002810000000400656ae0a0a00050a0a000ac4ee0050001e8481"
"003d0901501001f646a00000a1ba6869ee020000e3000000e30000000200000a0a0a0200000a0a050800450000d510000000"
"400656010a0a00050a0a000ac4ee0050001e8481003d0901501801f693d80000504f5354202f6c6f67696e20485454502f31"
"2e310d0a486f73743a207777772e6c61622e746573740d0a557365722d4167656e743a206c61622d636c69656e742f312e30"
"0d0a436f6e74656e742d547970653a206170706c69636174696f6e2f782d7777772d666f726d2d75726c656e636f6465640d"
"0a436f6e74656e742d4c656e6774683a2033320d0a0d0a757365723d616c6963652670617373776f72643d6c61622d6f6e6c"
"792d313233a1ba6869e803000036000000360000000200000a0a050200000a0a0a08004500002810000000400656ae0a0a00"
"0a0a0a00050050c4ee003d0901001e852e501001fd45ec0000a1ba6869e2040000a8000000a80000000200000a0a05020000"
"0a0a0a08004500009a100000004006563c0a0a000a0a0a00050050c4ee003d0901001e852e501801fd02080000485454502f"
"312e312033303220466f756e640d0a5365727665723a206c61622d68747470640d0a4c6f636174696f6e3a202f686f6d650d"
"0a5365742d436f6f6b69653a2073657373696f6e3d6c616234323b20487474704f6e6c790d0a436f6e74656e742d4c656e67"
"74683a20300d0a0d0aa1ba6869dc05000036000000360000000200000a0a0a0200000a0a0508004500002810000000400656"
"ae0a0a00050a0a000ac4ee0050001e852e003d0973501001f545820000a1ba6869d606000036000000360000000200000a0a"
"0a0200000a0a0508004500002810000000400656ae0a0a00050a0a000ac4ee0050001e852e003d0973501101f545810000a1"
"ba6869d007000036000000360000000200000a0a050200000a0a0a08004500002810000000400656ae0a0a000a0a0a000500"
"50c4ee003d0973001e852f501101fd45780000a1ba6869ca08000036000000360000000200000a0a0a0200000a0a05080045"
"00002810000000400656ae0a0a00050a0a000ac4ee0050001e852f003d0974501001f545800000")
import hashlib, struct, ipaddress
from collections import defaultdict
from urllib.parse import parse_qs
# --- 0. integrity: the embedded bytes are the sandbox's sample files ---------------------------
EXPECTED = {"arp.pcap": "7422732148c559b1", "dns.pcap": "40de0a295b055737", "http.pcap": "23e99864e8200693"}
for name, data in [("arp.pcap", ARP_PCAP), ("dns.pcap", DNS_PCAP), ("http.pcap", HTTP_PCAP)]:
assert hashlib.sha256(data).hexdigest()[:16] == EXPECTED[name], name
# --- 1. pcap reader and writer -----------------------------------------------------------------
def read_pcap(data):
magic, vmaj, vmin, _, _, snap, link = struct.unpack("<IHHiIII", data[:24])
assert magic == 0xA1B2C3D4 and link == 1, "little-endian pcap with Ethernet expected"
off = 24
while off < len(data):
sec, usec, incl, orig = struct.unpack("<IIII", data[off:off + 16])
yield sec + usec / 1e6, data[off + 16:off + 16 + incl]
off += 16 + incl
def write_pcap(frames):
out = struct.pack("<IHHiIII", 0xA1B2C3D4, 2, 4, 0, 0, 65535, 1)
for t, f in frames:
out += struct.pack("<IIII", int(t), round((t % 1) * 1e6), len(f), len(f)) + f
return out
# --- 2. decoders -------------------------------------------------------------------------------
def mac(b): return ":".join(f"{x:02x}" for x in b)
def ip(b): return str(ipaddress.IPv4Address(b))
def decode(frame):
p = {"src_mac": mac(frame[6:12])}
etype = struct.unpack("!H", frame[12:14])[0]
if etype == 0x0806:
op, sha, spa = struct.unpack("!6xH6s4s", frame[14:32])
return {**p, "proto": "arp", "op": op, "sender_mac": mac(sha), "sender_ip": ip(spa)}
if etype != 0x0800:
return {**p, "proto": hex(etype)}
ihl = (frame[14] & 15) * 4
proto, src, dst = frame[23], ip(frame[26:30]), ip(frame[30:34])
seg = frame[14 + ihl:14 + struct.unpack("!H", frame[16:18])[0]]
p.update(src=src, dst=dst)
if proto == 6:
sport, dport, off = struct.unpack("!HH8xB", seg[:13])
return {**p, "proto": "tcp", "sport": sport, "dport": dport, "payload": seg[(off >> 4) * 4:]}
if proto == 17:
sport, dport = struct.unpack("!HH", seg[:4])
return {**p, "proto": "udp", "sport": sport, "dport": dport, "payload": seg[8:]}
return {**p, "proto": str(proto)}
def dns_summary(msg):
ident, flags, qd = struct.unpack("!HHH", msg[:6])
labels, i = [], 12
while msg[i]:
labels.append(msg[i + 1:i + 1 + msg[i]].decode()); i += 1 + msg[i]
return {"id": ident, "response": bool(flags & 0x8000), "rcode": flags & 15, "qname": ".".join(labels)}
# --- 3. detectors ------------------------------------------------------------------------------
SECRET_FIELDS = {"password", "pass", "pwd", "passwd"}
alerts = []
def check_cleartext(t, p):
data = p.get("payload", b"")
if p.get("proto") != "tcp" or not data:
return
if data.startswith((b"POST ", b"GET ")):
head, _, body = data.partition(b"\r\n\r\n")
fields = set(parse_qs(body.decode(errors="replace"))) & SECRET_FIELDS
if fields:
alerts.append((t, "CLEARTEXT-CREDENTIAL", f"HTTP form field(s) {sorted(fields)} {p['src']} -> {p['dst']}:{p['dport']}"))
if b"\r\nAuthorization: Basic " in head:
alerts.append((t, "CLEARTEXT-CREDENTIAL", f"HTTP Basic auth {p['src']} -> {p['dst']}:{p['dport']}"))
if p["dport"] in (21, 110, 143) and data.upper().startswith((b"PASS ", b"LOGIN ")):
alerts.append((t, "CLEARTEXT-CREDENTIAL", f"{data.split()[0].decode()} command {p['src']} -> {p['dst']}:{p['dport']}"))
arp_table = {}
def check_arp(t, p):
if p.get("proto") != "arp":
return
ipaddr, m = p["sender_ip"], p["sender_mac"]
if ipaddr in arp_table and arp_table[ipaddr] != m:
alerts.append((t, "ARP-SPOOFING", f"{ipaddr} moved {arp_table[ipaddr]} -> {m}" + (" in a reply" if p["op"] == 2 else " in a request")))
arp_table.setdefault(ipaddr, m)
nx = defaultdict(list)
WINDOW, THRESHOLD = 10.0, 5
def check_dns(t, p):
if p.get("proto") != "udp" or 53 not in (p["sport"], p["dport"]) or not p["payload"]:
return
d = dns_summary(p["payload"])
if d["response"] and d["rcode"] == 3:
client = p["dst"]
nx[client] = [x for x in nx[client] if t - x <= WINDOW] + [t]
if len(nx[client]) == THRESHOLD:
alerts.append((t, "NXDOMAIN-BURST", f"{client}: {THRESHOLD} NXDOMAIN answers within {WINDOW:.0f} s (last: {d['qname']})"))
# --- 4. a synthetic burst, written as pcap bytes -----------------------------------------------
def dns_response(t, client, ident, qname):
q = b"".join(bytes([len(l)]) + l.encode() for l in qname.split(".")) + b"\0" + struct.pack("!HH", 1, 1)
dns = struct.pack("!HHHHHH", ident, 0x8183, 1, 0, 0, 0) + q
udp = struct.pack("!HHHH", 53, 41000, 8 + len(dns), 0) + dns
iph = struct.pack("!BBHHHBBH4s4s", 0x45, 0, 20 + len(udp), 0x2000, 0, 64, 17, 0,
ipaddress.IPv4Address("10.10.0.53").packed, ipaddress.IPv4Address(client).packed)
eth = bytes.fromhex("0200000a0a09" "0200000a0a35") + b"\x08\x00"
return t, eth + iph + udp
T0 = 1768471200.0 + 60
names = ["qx7kd", "vbz2m", "p9rwt", "hk3ls", "zt8yq", "mw4cf"]
BURST_PCAP = write_pcap([dns_response(T0 + i * 0.8, "10.10.0.9", 0x3000 + i, n + ".example") for i, n in enumerate(names)])
# --- 5. run ------------------------------------------------------------------------------------
captures = {"arp.pcap": ARP_PCAP, "dns.pcap": DNS_PCAP, "http.pcap": HTTP_PCAP, "burst.pcap (synthetic)": BURST_PCAP}
for name, data in captures.items():
n = 0
for t, frame in read_pcap(data):
p = decode(frame)
check_cleartext(t, p); check_arp(t, p); check_dns(t, p)
n += 1
print(f"{name:<24} {n:>3} frames")
print()
from datetime import datetime, timezone
for t, kind, text in sorted(alerts):
stamp = datetime.fromtimestamp(t, timezone.utc).strftime("%H:%M:%S.%f")[:-3]
print(f"{stamp} {kind:<21} {text}")arp.pcap 3 frames
dns.pcap 4 frames
http.pcap 20 frames
burst.pcap (synthetic) 6 frames
10:00:01.000 CLEARTEXT-CREDENTIAL HTTP form field(s) ['password'] 10.10.0.5 -> 10.10.0.10:80
10:00:05.000 ARP-SPOOFING 10.10.0.1 moved 02:00:00:0a:0a:01 -> 02:00:00:0a:0a:66 in a reply
10:01:03.200 NXDOMAIN-BURST 10.10.0.9: 5 NXDOMAIN answers within 10 s (last: zt8yq.example)
Three alerts, one per detector, and nothing else: the GET request, the DNS lookups of dns.pcap (one NXDOMAIN is below the threshold) and the normal ARP exchange are all quiet. That last point matters as much as the alerts: a sensor that fires on normal traffic gets ignored.
Step 3: cross-check with tshark
A home-made decoder can be wrong in ways that hide attacks. Check its results against a mature dissector on the same files. The session asks tshark the same three questions about the sample captures (the synthetic burst exists only inside the Python program):
cd $SAMPLES/pcap
sha256sum arp.pcap dns.pcap http.pcap | cut -c1-16
echo "== cleartext credentials (form fields named like passwords):"
tshark -r http.pcap -Y 'urlencoded-form.key matches "(?i)^pass(word|wd)?$|^pwdquot;' -T fields \
-e frame.time -e ip.src -e ip.dst -e tcp.dstport -e urlencoded-form.key | sed 's/ */ /'
echo "== ARP: IPs claimed by more than one MAC:"
tshark -r arp.pcap -Y arp -T fields -e arp.src.proto_ipv4 -e arp.src.hw_mac | sort -u |
awk '{n[$1]++; m[$1] = m[$1] " " $2} END {for (i in n) if (n[i] > 1) print i ":" m[i]}'
echo "== NXDOMAIN answers per client:"
tshark -r dns.pcap -Y 'dns.flags.rcode == 3' -T fields -e ip.dst | sort | uniq -c7422732148c559b1
40de0a295b055737
23e99864e8200693
== cleartext credentials (form fields named like passwords):
Jan 15, 2026 10:00:01.000750000 UTC 10.10.0.5 10.10.0.10 80 user,password
== ARP: IPs claimed by more than one MAC:
10.10.0.1: 02:00:00:0a:0a:01 02:00:00:0a:0a:66
== NXDOMAIN answers per client:
1 10.10.0.5
The hashes match the integrity check in the program, and tshark agrees on all three findings for the sample files: one cleartext password field from 10.10.0.5 to 10.10.0.10:80, one IP (10.10.0.1) claimed by two MACs, and a single NXDOMAIN for 10.10.0.5, below the burst threshold.
Step 4: extend it
Pick at least two; each is a few lines.
- Telnet and FTP in the same run. Build the Telnet and FTP captures from SSH versus Telnet and FTP, FTPS and SFTP as frames in Python (like
dns_response) and add them tocaptures. The FTPPASSrule should fire; write a Telnet rule (aPassword:prompt from port 23 followed by a client segment). - Unsolicited ARP replies. Track requests
(asker, target IP)and mark replies that answer no request, as in the ARP lesson's practice. - Long and random DNS names. Add a tunnelling rule: query names with a first label longer than 30 characters and Shannon entropy above 3.5 bits per character.
- SYN flood. Count SYNs without a matching final ACK per destination in a 1-second window (SYN Floods and SYN Cookies).
- Robustness. Feed the decoder a truncated frame and a DNS name with a compression pointer loop. Make it skip bad packets with a counted warning instead of crashing: a sensor must survive hostile input.
The write-up
Use this template for the report on your run. Keep it factual and short; the reader is a security lead who must decide what to do next.
PACKET-CAPTURE ANALYSIS REPORT
Analyst: <name> Date: <yyyy-mm-dd> Case / ticket: <id>
Scope and authorisation: <which captures, who authorised the analysis, retention>
1. Evidence
File SHA-256 (first 16) Frames Time span (UTC)
arp.pcap 7422732148c559b1 3 2026-01-15 10:00:00 - 10:00:05
...
Tools: own analyser vX (Python 3, struct), tshark 4.2.2 for cross-checks.
2. Summary (three sentences at most)
<what happened, how serious, what must be done first>
3. Findings (one block per finding, most severe first)
ID / title: F-1 Cleartext credentials on the lab web login
Severity: High / Medium / Low, with one line of reasoning
Evidence: frame number, time, source -> destination:port, field NAMES only (never paste secrets)
Interpretation: what it means and what else could explain it (false positives)
Recommendation: the fix from the lesson (e.g. HTTPS + HSTS + Secure cookies; rotate the exposed password)
Detection rule: the analyser or IDS rule that will catch a recurrence
4. Non-findings and limits
<what was checked and found normal; what this capture can't show (vantage point, encrypted traffic, sampling)>
5. Next steps
<owner, action, deadline>A filled-in finding for the ARP alert, as an example:
F-2 ARP spoofing of the lab gateway
Severity: High: a host on the LAN placed itself in the path of 10.10.0.5's traffic.
Evidence: arp.pcap frame 3, 10:00:05.000 UTC: reply "10.10.0.1 is-at 02:00:00:0a:0a:66",
5 s after the gateway answered with 02:00:00:0a:0a:01; no request preceded it.
Interpretation: unsolicited mapping change for the gateway. Benign causes (failover pair, NIC swap)
are not documented for 10.10.0.1.
Recommendation: locate 02:00:00:0a:0a:66 by switch port; enable DHCP snooping and dynamic ARP
inspection on VLAN 10; check 10.10.0.5 for intercepted sessions.
Detection rule: analyser ARP-SPOOFING rule; arpwatch on the segment.Checklist
- Both programs run and print the outputs above.
- You can explain every
structformat string in the analyser (which use<, which use!, and why). - The tshark cross-check agrees with your analyser.
- At least two extensions done, each with a test case that triggers it and one that doesn't.
- The report follows the template, contains no secrets, and every finding links evidence to a fix.
Test yourself
Why does the pcap reader unpack file headers with < but packet headers with !?
- It is a bug
- This pcap file was written little-endian (magic d4 c3 b2 a1), while protocol headers are always in network byte order
- Python requires it
- Only the TCP header is big-endian
Why does the analyser check SHA-256 hashes of the embedded captures first?
- To decrypt them
- To prove the analysed bytes are exactly the evidence files, as in a chain of custody
- To compress them
- tshark requires it
Why does the single NXDOMAIN in dns.pcap not raise an alert?
- The decoder misses it
- The burst rule needs 5 NXDOMAIN answers to one client within 10 seconds
- NXDOMAIN is never suspicious
- It is a query, not a response
What should a finding about cleartext credentials quote as evidence?
- The password, so others can verify it
- The frame, time, endpoints and the field names, never the secret itself
- Nothing
- The whole capture