What is PCAP forensics, and why replay recorded traffic through an IDS?
It means analysing recorded network traffic (pcap files) after the fact. Replaying it through an IDS applies today's signatures to old traffic, revealing infections that went unnoticed when the traffic happened.
* Replay the capture for alerts; separately, carve out the transferred files and check what they really are. *
A pcap file is a packet capture: every packet with its timestamp, exactly as it crossed the wire. Tools such as tcpdump, Wireshark or a full-packet-capture system create them.
Replaying a capture with tcpreplay onto the interface Suricata watches makes the IDS inspect it as if it were live. That is useful for several reasons:
- Retroactive detection: a new signature for a malware family can be tested against last month's traffic, to find out whether you were already infected.
- Incident investigation: alerts point to the relevant flows, so you can see which host talked to which server.
- Safe training and testing: real malware traffic can be studied without running any malware.
Because the packets carry their full payload, an analyst can go further than the alert. With tools such as tshark they can extract the transferred files themselves.
Go deeper:
Suricata: Command Line Options —
-roffline mode runs a capture straight through Suricata without replaying it onto an interface.Malware-Traffic-Analysis.net training exercises — real infection pcaps with questions and answers to practise this workflow.
pcap (Wikipedia) — the capture format and the libraries behind it.