Hello. I have a capture file named original.pcap from a wifi capture I did. When I open it in Wireshark and properly configure decryption, I can see two HTTP POST packets. When I double-click any of those packets, I got a window that shows me the packet in three different view modes (Frame, Decrypted CCMP data and Reassembled TCP). So far, so good. Now, I'm trying to create a new file named post.pcap using tshark with those HTTP POST packets only. I tried the following command (no copy/paste here, please ignore any typos):
I used UAT to config decryption in tshark. Also, I extracted eapol packets so tshark can do the decryption. But when I open post.pcap in Wireshark, I can see the EAPOL packets and just two TCP packets, not the HTTP packets I was expecting. If I double-click one of those TCP packets, I can see it is related to the original HTTP POST, but it shows me only two view modes (Frame and Decrypted CCMP data). It seems that I need more packets in the original file in order to properly show the HTTP packets. How can I make tshark extract the right combination of packets? Thanks. asked 25 Jul '16, 16:19 santonline edited 25 Jul '16, 16:20 |
One Answer:
There may be a way to accomplish this in a single step (possibly using MATE or some other method?), but you should be able to at least use a 2-step approach to have First, find the relevant TCP stream(s) (options omitted for brevity and clarity):
(For illustrative purposes, let's suppose there are 2 matching streams, numbers 1 and 3.) Second, modify the filter to include the entire stream and save those packets to your file:
answered 26 Jul '16, 10:41 cmaynard ♦♦ edited 26 Jul '16, 10:50 |
Thank you, but I forgot to mention that I want to make a script out of it. Is there a way pass the stream IDs to the filter in the second command automatically?
Below is my attempt at a script that should get you more or less what you want. It can produce either a single
.pcapng
file with all streams in one file, or it can produce a separate.pcapng
file, one for each stream.