0

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?

RiptimRip
  • 11
  • 1
  • 3
  • It's debatable whether Windows or the server application is causing this, but in any case you can certainly not block it, or anything else, with Jnetpcap. – user207421 Feb 13 '19 at 09:41
  • I mean I'm using Jdivert to block, Jnetpcap is just for the TCP handshake and other things but that's a separate program, This one should just block but it isn't. Can't figure out why. – RiptimRip Feb 13 '19 at 09:47
  • If one side sends a RST, then blocking it does no good because that side simply will not have a TCP connection, and it will continue to send RST without processing for any segment it receives that is sent to that connection. – Ron Maupin Feb 13 '19 at 15:01
  • I'm attempting to block the any RST from my side from being sent so the connection isn't terminated. I will write my own program to process future packets on my side, I just need to perma block the OS from sending any RST packets. – RiptimRip Feb 13 '19 at 15:09

1 Answers1

0

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

sl33pchild
  • 26
  • 2