@@ -78,6 +78,9 @@ WINSOCK_API_LINKAGE INT WSAAPI inet_pton(INT Family, LPCSTR pStringBuf, PVOID pA
78
78
"(tcp.DstPort == 80 or tcp.DstPort == 443) and tcp.Ack and " \
79
79
"(" DIVERT_NO_LOCALNETSv4_DST " or " DIVERT_NO_LOCALNETSv6_DST "))" \
80
80
"))"
81
+ #define FILTER_PASSIVE_BLOCK_QUIC "outbound and !impostor and !loopback and udp " \
82
+ "and udp.DstPort == 443 and udp.PayloadLength >= 1200 " \
83
+ "and udp.Payload[0] >= 0xC0 and udp.Payload32[1b] == 0x01"
81
84
#define FILTER_PASSIVE_STRING_TEMPLATE "inbound and ip and tcp and " \
82
85
"!impostor and !loopback and " \
83
86
"((ip.Id <= 0xF and ip.Id >= 0x0) " IPID_TEMPLATE ") and " \
@@ -559,7 +562,8 @@ int main(int argc, char *argv[]) {
559
562
conntrack_info_t dns_conn_info ;
560
563
tcp_conntrack_info_t tcp_conn_info ;
561
564
562
- int do_passivedpi = 0 , do_fragment_http = 0 ,
565
+ int do_passivedpi = 0 , do_block_quic = 0 ,
566
+ do_fragment_http = 0 ,
563
567
do_fragment_http_persistent = 0 ,
564
568
do_fragment_http_persistent_nowait = 0 ,
565
569
do_fragment_https = 0 , do_host = 0 ,
@@ -641,7 +645,7 @@ int main(int argc, char *argv[]) {
641
645
max_payload_size = 1200 ;
642
646
}
643
647
644
- while ((opt = getopt_long (argc , argv , "123456prsaf :e:mwk:n" , long_options , NULL )) != -1 ) {
648
+ while ((opt = getopt_long (argc , argv , "123456pqrsaf :e:mwk:n" , long_options , NULL )) != -1 ) {
645
649
switch (opt ) {
646
650
case '1' :
647
651
do_passivedpi = do_host = do_host_removespace \
@@ -685,6 +689,9 @@ int main(int argc, char *argv[]) {
685
689
case 'p' :
686
690
do_passivedpi = 1 ;
687
691
break ;
692
+ case 'q' :
693
+ do_block_quic = 1 ;
694
+ break ;
688
695
case 'r' :
689
696
do_host = 1 ;
690
697
break ;
@@ -884,6 +891,7 @@ int main(int argc, char *argv[]) {
884
891
default :
885
892
puts ("Usage: goodbyedpi.exe [OPTION...]\n"
886
893
" -p block passive DPI\n"
894
+ " -q block QUIC/HTTP3\n"
887
895
" -r replace Host with hoSt\n"
888
896
" -s remove space between host header and its value\n"
889
897
" -a additional space between Method and Request-URI (enables -s, may break sites)\n"
@@ -960,6 +968,7 @@ int main(int argc, char *argv[]) {
960
968
}
961
969
962
970
printf ("Block passive: %d\n" /* 1 */
971
+ "Block QUIC/HTTP3: %d\n" /* 1 */
963
972
"Fragment HTTP: %u\n" /* 2 */
964
973
"Fragment persistent HTTP: %u\n" /* 3 */
965
974
"Fragment HTTPS: %u\n" /* 4 */
@@ -979,7 +988,7 @@ int main(int argc, char *argv[]) {
979
988
"Fake requests, wrong checksum: %d\n" /* 17 */
980
989
"Fake requests, wrong SEQ/ACK: %d\n" /* 18 */
981
990
"Max payload size: %hu\n" , /* 19 */
982
- do_passivedpi , /* 1 */
991
+ do_passivedpi , do_block_quic , /* 1 */
983
992
(do_fragment_http ? http_fragment_size : 0 ), /* 2 */
984
993
(do_fragment_http_persistent ? http_fragment_size : 0 ),/* 3 */
985
994
(do_fragment_https ? https_fragment_size : 0 ), /* 4 */
@@ -1031,6 +1040,15 @@ int main(int argc, char *argv[]) {
1031
1040
filter_num ++ ;
1032
1041
}
1033
1042
1043
+ if (do_block_quic ) {
1044
+ filters [filter_num ] = init (
1045
+ FILTER_PASSIVE_BLOCK_QUIC ,
1046
+ WINDIVERT_FLAG_DROP );
1047
+ if (filters [filter_num ] == NULL )
1048
+ die ();
1049
+ filter_num ++ ;
1050
+ }
1051
+
1034
1052
/*
1035
1053
* IPv4 & IPv6 filter for inbound HTTP redirection packets and
1036
1054
* active DPI circumvention
0 commit comments