What's changed: Initial version
4.5Protocol headers, artifacts, and regular expressions
Covers what each header element of Ethernet/IPv4/IPv6/TCP/UDP/ICMP/DNS/SMTP, POP3, IMAP/HTTP, HTTPS/ARP reveals, the artifacts (IOCs—hashes, URLs, domains, IPs, filenames, etc.) that are the products of analysis, and basic regular expressions as the tool for searching logs/payloads, as the skill of surfacing threats and feeding the next stage of investigation.
Packet headers are a trove of clues for decoding an attack. Knowing what each field means lets you spot a scan type (TCP flags), a suspected C2 (abnormal DNS queries), or spoofing (duplicate ARP) without reading all the content. And extracting the solid traces obtained from analysis—artifacts (IOCs)—and sharing them lets other systems search for and block the same threat. To pick target strings out of massive logs and payloads, regular expressions are indispensable. This section ties together reading major protocol headers, the elements of IOCs, and basic regex as tools for SOC search and surfacing.
4.5.1Major protocol headers and their reading
- L2/L3: Ethernet carries source/destination MAC and EtherType (the first 3 bytes of a MAC, the OUI, hint at the NIC vendor; local segment only). IPv4 has
src/dstIP,TTL, protocol number, and flags/fragment (TTLas remaining hops hints at OS/path length). IPv6 has 128-bit addresses, aNext Header, and aHop Limit. ARP resolves IP<->MAC; multiple MACs for one IP or suspicious gratuitous ARP signals ARP spoofing. - L4: TCP has
src/dstports,seq/ack, flags (SYN/ACK/FIN/RST/PSH/URG), and a window. The flag pattern indicates a scan type (manySYN-only = SYN scan; frequentRST= closed-port responses). UDP has onlysrc/dstports and length and is connectionless. ICMP hastype/code(echo request/reply, unreachable) and is material for apingsweep or ICMP tunneling. - L7: DNS shows domain names in queries/responses; abnormally long random subdomains or many TXT records suggest DNS tunneling/DGA. HTTP (80) exposes
Host/URI/User-Agent/method, while HTTPS (443) encrypts the body with TLS, exposing about the SNI only. Email is SMTP (25/587) to send, POP3 (110), IMAP (143) to receive, whereFrom/To/Subjectand attachments are key to phishing analysis.
Continue reading — free sign-up
You're reading the free preview. Sign up free to read this section in full, plus every chapter (including 4+) and all questions.

