0

Referring to: How could I sniff network traffic in Java?

I managed to get the sniffer to work with various APIs mentioned there (jNetPcap seems to work best for me). However I struggle to make the payload actually readable, as it is in gzip format.

So is there another API (or a good way with jNetPcap) to sniff and decompress gzipped content in Java?

No. 7892142
  • 121
  • 4
  • can you not just run it through the gzip decompressor? – Nim Sep 12 '17 at 07:31
  • "not in GZIP format" all the time. Sorry, should have mentioned. (see also http://jnetpcap.com/node/1097, my problem is similar) – No. 7892142 Sep 12 '17 at 07:34
  • that's not very helpful - you need to somehow determine which packets contain compressed data and then decompress them and handle non-compressed packets normally. Whatever protocol you are sniffing should have some semantics to allow you to do this.. for example if it's HTTP, you can look for the header to see if it's compressed, and if it is, decompress the body etc. – Nim Sep 12 '17 at 07:38

1 Answers1

0

you can also use winPcap for windows to sniff packets

1.in java write code to list the network devices 2.then set filters to sniff packets of your own desire

Sanju Abel
  • 111
  • 5