From bb8fc64f180282a8e003dbd49fe27c8206fb6408 Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Sun, 24 Dec 2017 20:37:49 +0300 Subject: [PATCH] Handle ip.id up to 0xF. Some DPI send several TCP RST or HTTP redirection packets with increasing IP ID number. Handle them all. --- README.md | 2 +- goodbyedpi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2675962..9fca8df 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Use `goodbyedpi.exe -4` if it works for your ISP's DPI. This is the fastest mode ### Passive DPI -Most Passive DPI send HTTP 302 Redirect if you try to access blocked website over HTTP and TCP Reset in case of HTTPS, faster than destination website. Packets sent by DPI always have IP Identification field equal to `0x0000` or `0x0001`, as seen with Russian providers. These packets, if they redirect you to another website (censorship page), are blocked by GoodbyeDPI. +Most Passive DPI send HTTP 302 Redirect if you try to access blocked website over HTTP and TCP Reset in case of HTTPS, faster than destination website. Packets sent by DPI usually have IP Identification field equal to `0x0000` or `0x0001`, as seen with Russian providers. These packets, if they redirect you to another website (censorship page), are blocked by GoodbyeDPI. ### Active DPI diff --git a/goodbyedpi.c b/goodbyedpi.c index 9378807..f63ea73 100644 --- a/goodbyedpi.c +++ b/goodbyedpi.c @@ -85,7 +85,7 @@ static struct option long_options[] = { static char *filter_string = NULL; static char *filter_string_template = "(ip and tcp and " "(inbound and ((" - "((ip.Id == 0x0001 or ip.Id == 0x0000) and tcp.SrcPort == 80 and tcp.Ack) or " + "((ip.Id <= 0xF or ip.Id >= 0x0) and tcp.SrcPort == 80 and tcp.Ack) or " "((tcp.SrcPort == 80 or tcp.SrcPort == 443) and tcp.Ack and tcp.Syn)" ") and " DIVERT_NO_LOCALNETS_SRC ") or " "(outbound and " @@ -470,7 +470,7 @@ int main(int argc, char *argv[]) { /* IPv4 filter for inbound RST packets with ID = 0 or 1 */ filters[filter_num] = init( "inbound and ip and tcp and " - "(ip.Id == 0x0001 or ip.Id == 0x0000) and " + "(ip.Id <= 0xF or ip.Id >= 0x0) and " "(tcp.SrcPort == 443 or tcp.SrcPort == 80) and tcp.Rst and " DIVERT_NO_LOCALNETS_SRC, WINDIVERT_FLAG_DROP);