Thursday, 01 May 2014 21:45:00 (UTC/GMT)
The phrase "PCAP or it didn't happen" is often used in the network security field when someone want proof that an attack or compromise has taken place.
One such example is the recent OpenSSL heartbleed vulnerability,
where some claim that the vulnerability was
exploited even before
it was discovered by Google's Neel Mehta and Codenomicon.
Image: PCAP or it didn't happen pwnie, original by Nina
After the Heartbleed security advisory was published,
"Anyone reproduced observations of #Heartbleed attacks from 2013?"
and Liam Randall (of Bro fame) tweeted:
"If someone finds historical exploits of #Heartbleed I hope they can report it. Lot's of sites mining now."
It is unfortunately not possible to identify Heartbleed attacks by analyzing log files, as stated by the following Q&A from the
Can I detect if someone has exploited this against me?
Exploitation of this bug does not leave any trace of anything abnormal happening to the logs.
the Heartbleed attacks weren't available until after implementations of the exploit code were being actively used in the wild.
Hence, the only reliable way of detecting early heartbleed attacks (i.e. prior to April 7) is to analyze old captured network traffic from before April 7.
In order to do this you should have had a full packet capture running, which was configured to capture and store all your traffic.
Unfortunately many companies and organizations haven't yet realized the value that historical packet captures can provide.
Why Full Packet Capture Matters
Some argue that just storing netflow data is enough in order to do incident response.
However, detecting events like the heartbleed attack is impossible to do with netflow since you need to verify the contents of the network traffic.
Not only is retaining historical full packet captures useful in order to detect attacks that have taken place in the past, it is also extremely valuable to have in order to do any of the following:
- IDS Verification
Investigate IDS alerts to see if they were false positives or real attacks.
- Post Exploitation Analysis
Analyze network traffic from a compromise to see what the attacker did after hacking into a system.
- Exfiltration Analysis
Assess what intellectual property that has been exfiltrated by an external attacker or insider.
- Network Forensics
Perform forensic analysis of a suspect's network traffic by extracting files, emails, chat messages, images etc.
Setting up a Full Packet Capture
The first step, when deploying a full packet capture (FPC) solution, is to install a
network tap or configure a monitor port in order to get a copy of all packets going in and out from your networks.
Then simply sniff the network traffic with a tool like
dumpcap or netsniff-ng.
Another alternative is to deploy a whole network security monitoring (NSM) infrastructure, preferably by installing the
SecurityOnion Linux distro.
A network sniffer will eventually run out of disk, unless captured network traffic is written to disk in a rung buffer manner
(use "-b files" switch in dumpcap) or there is a scheduled job in place to remove the oldest capture files.
SecurityOnion, for example, normally runs its "cleandisk" cronjob when disk utilization reaches 90%.
The ratio between disk space and utilized bandwidth becomes the maximum retention period for full packet data.
We recommend having a full packet capture retention period of at least 7 days,
but many companies and organizations are able to store several month's worth of network traffic (disk is cheap).
Big Data PCAP Analysis
Okay, you've got a PCAP store with multiple terabytes of data. Then what? How do you go about analyzing such large volumes of captured full content network traffic?
Well, tasks like indexing and analyzing PCAP data are complex matters than are beyond the scope of this blog post.
We've covered the big data PCAP analysis topic in previous
blog posts, and there is more to come.
However, capturing the packets to disk is a crucial first step in order to utilize the powers of network forensics. Or as the saying goes “PCAP or it didn't happen”.
We now have T-shirts with "PCAP or it didn't happen" print for sale!
Posted by Erik Hjelmvik on Thursday, 01 May 2014 21:45:00 (UTC/GMT)