mhendy25 / offline_network_traffic_analyzer

0 stars 0 forks source link

Making Pyshark output collapsible #10

Open danysigha opened 4 months ago

danysigha commented 4 months ago

Yes, we can obtain the output of Wireshark in 4 lines of code. However, this output is not properly formatted (it is not collapsible). Please come up with some scrips to properly format the output of Pyshark to make it readable for the users. Do not hesitate to be creative! You can start on the ethernet layer of this packet. If you have some time, please format the output of the other layers as well.

How to get the Pyshark output you ask? I did it in this short script

  1. We first need to convert the hexdumps to pcap files using text2pcap.

  2. Use Pyshark's FileCapture function to convert pcap to the desired text output.

As usual, setup is pretty annoying. Make sure to install the command line version of Wireshark. This can be done with brew install on Mac. Here are the steps:

  1. Set up brew
  2. get rid of old wireshark. Delete app and run brew uninstall --force wireshark to be safe
  3. Install wireshark by running brew install wireshark and brew install --cask wireshark
  4. Check that it worked brew info --cask wireshark
  5. Add an alias to your path directory alias wireshark='/Applications/Wireshark.app/Contents/MacOS/Wireshark'