Reputation: 23
I was trying to capture network taffic using jdivert (https://github.com/ffalcinelli/jdivert) Whenever I try to open the handle:
public static void main(String[] args) throws WinDivertException {
WinDivert w = new WinDivert("outbound");
w.open(); //exception there
Packet packet = w.recv();
System.out.println(packet);
w.close();
}
It throws exception:
Exception in thread "main" WinDivertException{code=5, message='null'}
at com.github.ffalcinelli.jdivert.exceptions.WinDivertException.throwExceptionOnGetLastError(WinDivertException.java:57)
at com.github.ffalcinelli.jdivert.WinDivert.open(WinDivert.java:112)
at pl.alpaq.lab.packets.TestClass.main(TestClass.java:11)
Upvotes: 0
Views: 189
Reputation: 26
I see in your exception output : WinDivertException{code=5, message='null'}
According to the windivert faq page , code 5 is a permission error code.
Are you running your console/shell with admin rights?
Upvotes: 1