title: Reading captured packet from command line with tcpdump
body: <p>I am capturing traffic using:</p>
  
  <pre><code> tcpdump -i &lt;interface&gt; -nn  -s0 -w ike2.pcap
  </code></pre>
  
  <p>Then I am reading the captured file using: </p>
  
  <pre><code>tcpdump  -vvv -l -r ike2.pcap
  </code></pre>
  
  <p>While reading, the first packet is getting displayed as:</p>
  
  <pre><code>07:22:33.320142 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], length: 296) 10.0.0.1.isakmp &gt; 10.0.0.2.isakmp: [udp sum ok] isakmp 2.0 msgid  cookie -&gt;: phase 1 I #34[]:
      (#33)
      (#34)
      (#40)
      (#41)
      (#41)
  </code></pre>
  
  <p>I need to get the details of this packet. In this ISAKMP IKEv2 packet, I am interested to extract the values of 'Encryption Algorithm' and 'Integrity Algorithm' (i.e 'ENCR_3DES' and 'AUTH_HMAC_MD5_96')</p>
  
  <p>I can view the values if I inspect the packet in wireshark. But, I have to do this from a shell script, so I cannot use wireshark. I need to get these values from tcpdump read command itself. </p>
  
  <p>I am assuming there might be some way to print the encryption and integrity algorithms used from tcpdump read command. Could you please help to figure this out.</p>
  
  <p>Captured packet:</p>
  
  <p><img src="https://i.stack.imgur.com/ETXnm.jpg" alt="captured packet"></p>