Overview
A two-part C2 detection lab built across 4 VMs — DNS tunneling (dnscat2) and HTTPS C2 (Meterpreter) — both caught using behavioral detections in Splunk via Zeek logs. No signatures. OS-agnostic. Same methodology, two different protocols. The key finding: encryption hides the payload, not the behavior.
Attack Chain / Build Steps
- Deployed dnscat2 server on Kali and client on victim VM, establishing an encrypted C2 session over UDP port 53 — interactive root shell entirely through DNS with no direct TCP/UDP connection.
- Discovered and fixed a critical Zeek TSV field parsing issue in props.conf (FIELD_HEADER_REGEX) causing all Splunk field names to misalign — documented as a required fix for any Zeek/Splunk deployment.
- Built three behavioral DNS detections: unusual record types (666 events, T1071.004), encoded query length (240-char payloads, T1572), and high-volume query rate (3,978 queries at 0.627s avg, T1048.003).
- Extended the lab to HTTPS C2 using Meterpreter reverse HTTPS — generated payload with msfvenom, established session over port 4443, achieved root shell via encrypted channel.
- Added zeek:ssl sourcetype to Splunk pipeline and built three HTTPS detections: self-signed certificate (183 events, T1573.002), repeated connections to same destination (215 events, T1071.001), and beaconing interval (1,244 connections at 2.03s avg).
- Documented detection limits: CV-based beaconing fails for interactive C2 shells; valid certs on port 443 defeat cert-based detection — beaconing interval analysis survives both scenarios.
Outcome
Root shell confirmed over DNS and HTTPS · 6 behavioral detections across 2 protocols · Zeek/Splunk parsing bug discovered and documented as a required environment fix.