Alpaq
Alpaq

Reputation: 23

Exception after capturing outbound packets with jdivert (Java bindings for WinDivert)

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

Answers (1)

sl33pchild
sl33pchild

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

Related Questions