

Here is an example that extracts both the DNS query and the response address. tshark -r example.pcap -Y http.request -T fields -e http.host -e ip.dst -e _uri DNS Analysis with Tshark By combing different filters and output fields, it is possible to create very complex data extraction commands for tshark that can be used to find interesting things within a capture. Other fields we could include in the output are -e ip.dst and -e. We could perform a similar analysis with the request URL in place of the user agent -e _uri. Using additional HTTP filters in Analysis This can be used to detect malware, old browsers on your network and scripts. Using this, we can quickly parse a pcap, even if it is very large and get a summary of all the user agents seen. tshark -r example.pcap -Y http.request -T fields -e http.host -e er_agent | sort | uniq -c | sort -n Note in this example, combining with standard shell commands allows us to sort and count the occurrences of the er_agent. Using the previous command to extract er_agent, this time extracting from a pcap rather than off the live interface. Parse User Agents and Frequency with Standard Shell Commands We could also use the parameter -E seperator=, to change the delimiter to a comma. The default separator for the fields in the output above is TAB. Tshark -i wlan0 -Y http.request -T fields -e http.host -e er_agent Mozilla/5.0 (X11 Ubuntu Linux x86_64 rv:36.0) Gecko/20100101 Firefox/36.0 The -e option identifies which fields to extract. Using the -T specifies we want to extract fields.

The following example extracts data from any HTTP requests that are seen. Capture Packets with Tshark tshark -i wlan0 -w capture-output.pcap Read a Pcap with Tshark tshark -r capture-output.pcap HTTP Analysis with Tshark Go back to Protocol Preferences, click on ESP SAs.Įnter the informations related to the ESP SA.Īuthentication: SHA512-hmac-512-256 Ĭlick OK, you should see the IPSec packet in clear text.Use these as the basis for starting to build extraction commands.The syntax for capturing and reading a pcap is very similar to tcpdump. Under the Protocol Preferences, check the three options shown below.Įxpand the Encapsulation Security Payload and copy the SPI value for this ESP SA. right-click on the ESP packet, in this scenario the ESP SA from the source 12.0.0.1 to the destination 23.0.0.1. Sometimes you want to see how the tunnel and the transport modes works with encapsulation, especially when using GRE over IPSEC and you would like to decrypt the ESP or IPSEC packet to see how GRE packet is encapulated with the two modes, especially for studying, teaching or may be for troubleshooting.Ĭonfigue the ESP encryption with null in the transform set.Ĭrypto ipsec transform-set TS esp-null esp-sha512-hmacĬopy the pre-shared key configured in phase 1 ISAKMP.
