I am researching how to build an Intrusion Prevention System (IPS) application using Java, however I don't know how to redirect Internet packets from a PC to my application and read the packets. The data format I'm looking to get from the packets is similar to the data that Wireshark produces. How would I go about getting low-level packet data like this in a Java application?
Best How To :
Unfortunately, Java does not have access to "raw sockets"--the kind of access you need to get the details you'd expect from a Wireshark dump or the similar.
If you need to use Java for the rest of your application, consider using JNI (link is to a good JNI tutorial). It allows you to use C/C++/Fortran code within a Java application, so you can make system calls and get the kind of access you need.