1

Is there any way to extract this data (red box on below image) and save it in a text file in Linux command line? I tried searching on web but couldn't get anything related to my issue. I want to drop these packets on Iptables using their HEX.

pcap file

2
  • I would use a scripting language like Python. There are Python libraries for reading pcap files and thus filtering and extracting data should be not that complex.
    – Robert
    Commented May 26, 2022 at 16:51
  • @Robert there are no tools for doing this over commandline without any scripting lang?
    – ph3ro
    Commented May 26, 2022 at 17:22

1 Answer 1

0

If you are not interested in using Python and would prefer to use a CLI command, tshark is what you're looking for. It is the official Wireshark tool for interfacing with packet captures in a non-GUI environment.

tshark.dev has some great resources that would assist you in getting the specific information you are interested in. It will be difficult for me to select what you're looking for without the PCAP, but something like this should work for you:

tshark -n -T fields -e data

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .