Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I programatically collect packets from passively sniffing? [closed]

I want to test the vulnerability of the server I just wrote against man in the middle attacks.

How (on Mac OS X) do I analyze packets. (I'll be checking where they are going, pulling information from if they are heading to my server, and seeing what all is available) Then I'll figure out a way to encrypt everything... but first things first.

Any help on packet sniffing would be greatly appreciated.

My preferred language is java. But I can do C++.

so, my question is: "Is there any sort of API / library that I can interface with?"

Like, if I could do PacketSniffer ps = new PacketSniffer(); that would be amazing.

like image 339
NullVoxPopuli Avatar asked Dec 21 '22 22:12

NullVoxPopuli


2 Answers

No need to write your own - Download Wireshark from http://www.wireshark.org/

like image 44
Jim Garrison Avatar answered May 14 '23 17:05

Jim Garrison


The best portable library for this is libpcap. There's even a java wrapper available for it.

like image 159
Chris Dodd Avatar answered May 14 '23 17:05

Chris Dodd