


In session three in which I exported suspicious and malicious content, I used the following for example to identify the name of the malicious file: However, when looking at packets for patterns, sequence of bytes, etc., do we really need to leverage grep or another external tool? Let's see. Many times, when looking at packets or logs, I leverage " grep -perl-regexp". While I did not do blog posts for those (and I wish I had thought about it before), I've chosen to do a blog post for the TShark and working with regular expressions, In a session prior to these, I focused on Full Packet Capturing with TShark for Continuous Monitoring & Threat Intel via IP, Domains, & URLS. In the 3rd session, we extracted suspicious and malicious content from PCAPS. In the second session, we focused on reconnaissance at the transport layer and working with some common application protocols. In the first of those videos, we did an intro to TShark by focusing on reconnaissance at the IP layer. As a result, I produced some videos using TShark. Tshark -f “host 10.42.131.120” -c 50000 -i dp0p192p1 -w /tmp/1000test.Recently, I've been working with the SANS Institute on some Livestream sessions, promoting the SEC503: Intrusion Detection In Depth class. Capture 50000 Packets and save them to a trace file called 1000test.pcap.Note2: In some cases (GRE tunnel traffic, VXLAN traffic), the above filter possibly won’t really work for you as the filter can only apply the source/destination of tunnel IP.Īnother way to control the size of capture file is stopping the packet capture when captures a specfici number of the packet. Note1: dp0p224p1 is the interface on which we capture the traffic. You can use tshark to read your packet capture: Capture packets based on multilpe IPs and Protocol/Port.Capture packets based on IP and Protocol/Port.Tshark -f “ udp port 53” -i dp0p224p1 -w /tmp/capture.pcap Tshark -f “ tcp port 1401” -i dp0p224p1 -w /tmp/capture.pcap Capture packet based on source or destination IP.Here I show you a few real world example for tshark capture filter, which hope can save you a bit of time. To capture your interested traffic and remove unnessary nosiy traffic, you need to use the capture filter when you perform the packet capture. Vyatta 5600 provides Tshark as the packet capture tool.
