Labs / Night Watch / Forensics, incident response & log correlation

Lab 1 of 3 · Forensics, incident response & log correlation

Packet forensics: reading an incident from a capture file

Pcap analysis of an incident: work out what happened from one saved capture.

Open this lab Pro 6 steps

The idea

Pcap analysis reads an incident back from a capture file, a recording of every packet: who was involved, what leaked, and the outside server a machine phoned home to. The victim workstation talked to webServer and to c2Server through the sensor; you read the saved file on the victim with tcpdump and tshark.

Stream 1 is the login
Stream 1 is the login

Steps

  1. The capture the sensor recorded

    Every packet from the time the victim was compromised is saved in /tmp/incident.pcap. You touch nothing live, only the file, so the evidence stays as it was. Start wide: listing only the connection openings shows each conversation on one line, and one address in it you should not recognise.

    victim:~# tcpdump -nr /tmp/incident.pcap 'tcp[tcpflags] & tcp-syn != 0 and tcp[tcpflags] & tcp-ack == 0'
  2. Who talked to whom: conversations and endpoints

    Let the tool summarise the file instead of reading packet by packet. Conversations lists each pair of talkers and how much they exchanged; endpoints lists every address with its totals. The victim is in every conversation, as expected — so the signal is its one peer that sits outside the company's networks.

    victim:~# tshark -r /tmp/incident.pcap -q -z conv,tcp
    victim:~# tshark -r /tmp/incident.pcap -q -z endpoints,ip

Pro

4 more steps in the app

  1. What was requested: display filters and fields
  2. Follow the stream: the leaked credentials
  3. Export the object: what was taken
  4. The indicator, and the timeline
Get Pro

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab