使用 jdivert 捕获出站数据包后出现异常(Java WinDivert 绑定)

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

我正在尝试使用转移来捕获网络流量 (https://github.com/ffalcinelli/jdivert) 每当我尝试打开手柄时:

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(); 
    }

抛出异常:

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)

我在你的异常输出中看到:WinDivertException{code=5, message='null'}

根据 windivert faq page ,代码5是权限错误代码。

你 运行 你 console/shell 有管理员权限吗?