September 2016

Exporting project in production


Just finished building a sniffer, to analyse some of my network traffic, and I managed to make it work on my development computer.
Unfortunatly, I can't make it work on the computer I want.
I installed WinPcap_4_1_3, and java, and that's the terminal message I received :

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.slytechs.library.NativeLibrary.dlopen(Ljava/lang/String;)J
at com.slytechs.library.NativeLibrary.dlopen(Native Method)
at com.slytechs.library.NativeLibrary.(Unknown Source)
at com.slytechs.library.JNILibrary.(Unknown Source)
at com.slytechs.library.JNILibrary.loadLibrary(Unknown Source)
at com.slytechs.library.JNILibrary.register(Unknown Source)
at com.slytechs.library.JNILibrary.register(Unknown Source)
at com.slytechs.library.JNILibrary.register(Unknown Source)
at org.jnetpcap.Pcap.(Unknown Source)
at javaapplication1.PacketLoader.(
at javaapplication1.JavaApplication1.main(
Appuyez sur une touche pour continuer...

Netbeans provided me a jar file i'm running, and a library folder which contains jnetpcap.rar.

Would be a big help if you could help me to make it work.

Thanks a lot,


Extract packet payload and store in a string

I need to extract payload of a packet and want to store in a string. How this can be done. Currently I am doing like :

import org.jnetpcap.Pcap;
import org.jnetpcap.packet.JPacket;
import org.jnetpcap.packet.JPacketHandler;

public class Hexdump
public static void main(String[] args)
String FILENAME1 = "/home/mayank/Pcaps/DNS_Skype.pcap";
final StringBuilder errbuf = new StringBuilder();
final Pcap pcap1 = Pcap.openOffline(FILENAME1, errbuf);

if (pcap1 == null)

pcap1.loop(-1, new JPacketHandler()
public void nextPacket(JPacket packet, StringBuilder errbuf)
String hexdump = packet.toHexdump(packet.size(), false, true, false);
}, errbuf);


In this way payload is not coming in a proper format. Please help.