How to Block Windows OS automatic RST packet right after TCP handshake

458 Views Asked by At

Here's my Code:

import com.github.ffalcinelli.jdivert.WinDivert;
import com.github.ffalcinelli.jdivert.exceptions.WinDivertException;

public class blocker {
    public static void main(String[] args) throws WinDivertException {
        WinDivert w = new WinDivert("outbound");
        w.open();
    }
}

I'm doing a TCP handshake with a PLC with help of the windows operating system. I'm using JnetPcap and Java to do this but right after the handshake the Windows OS is sending a RST, ACK packet and ending the connection. I wrote a blocker code in Java using the JDivert library which is basically a Java wrapper for WinDivert. I initally gave outbound as filter just to test if the code blocks everything or not. But it keep giving me this error:

https://pasteboard.co/I0WWP2P.png

This occurred even when I used the filter given in the official JDivert github repository example. Any help please?

1

There are 1 best solutions below

0
sl33pchild On

im a lot late but for those who stumble upon it.

i saw in the s/shot.. {code=5, message='null'}

acording to below link, code 5 is permission error.

So are you running your shell with admin rights? "run as admin.."

windivert faq