mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-26 12:10:53 +03:00
Compare commits
3 Commits
3ad029efe0
...
ee44aebcc4
Author | SHA1 | Date | |
---|---|---|---|
|
ee44aebcc4 | ||
|
667d32a3e7 | ||
|
9a087fc6c9 |
@ -1011,6 +1011,15 @@ tpws_curl_test()
|
||||
echo - checking tpws $3 $4 $5 $6 $7 $8 $9${TPWS_EXTRA:+ $TPWS_EXTRA}${TPWS_EXTRA_1:+ "$TPWS_EXTRA_1"}${TPWS_EXTRA_2:+ "$TPWS_EXTRA_2"}${TPWS_EXTRA_3:+ "$TPWS_EXTRA_3"}${TPWS_EXTRA_4:+ "$TPWS_EXTRA_4"}${TPWS_EXTRA_5:+ "$TPWS_EXTRA_5"}${TPWS_EXTRA_6:+ "$TPWS_EXTRA_6"}${TPWS_EXTRA_7:+ "$TPWS_EXTRA_7"}${TPWS_EXTRA_8:+ "$TPWS_EXTRA_8"}${TPWS_EXTRA_9:+ "$TPWS_EXTRA_9"}
|
||||
local ALL_PROXY="socks5://127.0.0.1:$SOCKS_PORT"
|
||||
ws_curl_test tpws_start "$@"${TPWS_EXTRA:+ $TPWS_EXTRA}${TPWS_EXTRA_1:+ "$TPWS_EXTRA_1"}${TPWS_EXTRA_2:+ "$TPWS_EXTRA_2"}${TPWS_EXTRA_3:+ "$TPWS_EXTRA_3"}${TPWS_EXTRA_4:+ "$TPWS_EXTRA_4"}${TPWS_EXTRA_5:+ "$TPWS_EXTRA_5"}${TPWS_EXTRA_6:+ "$TPWS_EXTRA_6"}${TPWS_EXTRA_7:+ "$TPWS_EXTRA_7"}${TPWS_EXTRA_8:+ "$TPWS_EXTRA_8"}${TPWS_EXTRA_9:+ "$TPWS_EXTRA_9"}
|
||||
local code=$?
|
||||
[ "$code" = 0 ] && {
|
||||
local testf=$1 dom=$2
|
||||
shift; shift;
|
||||
local strategy="$@"
|
||||
strategy_append_extra_tpws
|
||||
report_append "ipv${IPV} $dom $testf : tpws ${WF:+$WF }$strategy"
|
||||
}
|
||||
return $code
|
||||
}
|
||||
pktws_curl_test()
|
||||
{
|
||||
@ -1019,7 +1028,26 @@ pktws_curl_test()
|
||||
# $3,$4,$5, ... - nfqws/dvtws params
|
||||
echo - checking $PKTWSD ${WF:+$WF }$3 $4 $5 $6 $7 $8 $9${PKTWS_EXTRA:+ $PKTWS_EXTRA}${PKTWS_EXTRA_1:+ "$PKTWS_EXTRA_1"}${PKTWS_EXTRA_2:+ "$PKTWS_EXTRA_2"}${PKTWS_EXTRA_3:+ "$PKTWS_EXTRA_3"}${PKTWS_EXTRA_4:+ "$PKTWS_EXTRA_4"}${PKTWS_EXTRA_5:+ "$PKTWS_EXTRA_5"}${PKTWS_EXTRA_6:+ "$PKTWS_EXTRA_6"}${PKTWS_EXTRA_7:+ "$PKTWS_EXTRA_7"}${PKTWS_EXTRA_8:+ "$PKTWS_EXTRA_8"}${PKTWS_EXTRA_9:+ "$PKTWS_EXTRA_9"}
|
||||
ws_curl_test pktws_start "$@"${PKTWS_EXTRA:+ $PKTWS_EXTRA}${PKTWS_EXTRA_1:+ "$PKTWS_EXTRA_1"}${PKTWS_EXTRA_2:+ "$PKTWS_EXTRA_2"}${PKTWS_EXTRA_3:+ "$PKTWS_EXTRA_3"}${PKTWS_EXTRA_4:+ "$PKTWS_EXTRA_4"}${PKTWS_EXTRA_5:+ "$PKTWS_EXTRA_5"}${PKTWS_EXTRA_6:+ "$PKTWS_EXTRA_6"}${PKTWS_EXTRA_7:+ "$PKTWS_EXTRA_7"}${PKTWS_EXTRA_8:+ "$PKTWS_EXTRA_8"}${PKTWS_EXTRA_9:+ "$PKTWS_EXTRA_9"}
|
||||
local code=$?
|
||||
[ "$code" = 0 ] && {
|
||||
local testf=$1 dom=$2
|
||||
shift; shift;
|
||||
local strategy="$@"
|
||||
strategy_append_extra_pktws
|
||||
report_append "ipv${IPV} $dom $testf : $PKTWSD ${WF:+$WF }$strategy"
|
||||
}
|
||||
return $code
|
||||
}
|
||||
|
||||
strategy_append_extra_pktws()
|
||||
{
|
||||
strategy="${strategy:+$strategy${PKTWS_EXTRA:+ $PKTWS_EXTRA}${PKTWS_EXTRA_1:+ "$PKTWS_EXTRA_1"}${PKTWS_EXTRA_2:+ "$PKTWS_EXTRA_2"}${PKTWS_EXTRA_3:+ "$PKTWS_EXTRA_3"}${PKTWS_EXTRA_4:+ "$PKTWS_EXTRA_4"}${PKTWS_EXTRA_5:+ "$PKTWS_EXTRA_5"}${PKTWS_EXTRA_6:+ "$PKTWS_EXTRA_6"}${PKTWS_EXTRA_7:+ "$PKTWS_EXTRA_7"}${PKTWS_EXTRA_8:+ "$PKTWS_EXTRA_8"}${PKTWS_EXTRA_9:+ "$PKTWS_EXTRA_9"}}"
|
||||
}
|
||||
strategy_append_extra_tpws()
|
||||
{
|
||||
strategy="${strategy:+$strategy${TPWS_EXTRA:+ $TPWS_EXTRA}${TPWS_EXTRA_1:+ "$TPWS_EXTRA_1"}${TPWS_EXTRA_2:+ "$TPWS_EXTRA_2"}${TPWS_EXTRA_3:+ "$TPWS_EXTRA_3"}${TPWS_EXTRA_4:+ "$TPWS_EXTRA_4"}${TPWS_EXTRA_5:+ "$TPWS_EXTRA_5"}${TPWS_EXTRA_6:+ "$TPWS_EXTRA_6"}${TPWS_EXTRA_7:+ "$TPWS_EXTRA_7"}${TPWS_EXTRA_8:+ "$TPWS_EXTRA_8"}${TPWS_EXTRA_9:+ "$TPWS_EXTRA_9"}}"
|
||||
}
|
||||
|
||||
xxxws_curl_test_update()
|
||||
{
|
||||
# $1 - xxx_curl_test function
|
||||
@ -1071,7 +1099,7 @@ report_strategy()
|
||||
strategy="$(echo "$strategy" | xargs)"
|
||||
echo "!!!!! $1: working strategy found for ipv${IPV} $2 : $3 $strategy !!!!!"
|
||||
echo
|
||||
report_append "ipv${IPV} $2 $1 : $3 ${WF:+$WF }$strategy"
|
||||
# report_append "ipv${IPV} $2 $1 : $3 ${WF:+$WF }$strategy"
|
||||
return 0
|
||||
else
|
||||
echo "$1: $3 strategy for ipv${IPV} $2 not found"
|
||||
@ -1314,7 +1342,7 @@ pktws_check_domain_http_bypass()
|
||||
|
||||
local strategy
|
||||
pktws_check_domain_http_bypass_ "$@"
|
||||
strategy="${strategy:+$strategy${PKTWS_EXTRA:+ $PKTWS_EXTRA}${PKTWS_EXTRA_1:+ "$PKTWS_EXTRA_1"}${PKTWS_EXTRA_2:+ "$PKTWS_EXTRA_2"}${PKTWS_EXTRA_3:+ "$PKTWS_EXTRA_3"}${PKTWS_EXTRA_4:+ "$PKTWS_EXTRA_4"}${PKTWS_EXTRA_5:+ "$PKTWS_EXTRA_5"}${PKTWS_EXTRA_6:+ "$PKTWS_EXTRA_6"}${PKTWS_EXTRA_7:+ "$PKTWS_EXTRA_7"}${PKTWS_EXTRA_8:+ "$PKTWS_EXTRA_8"}${PKTWS_EXTRA_9:+ "$PKTWS_EXTRA_9"}}"
|
||||
strategy_append_extra_pktws
|
||||
report_strategy $1 $3 $PKTWSD
|
||||
}
|
||||
|
||||
@ -1359,7 +1387,7 @@ pktws_check_domain_http3_bypass()
|
||||
|
||||
local strategy
|
||||
pktws_check_domain_http3_bypass_ "$@"
|
||||
strategy="${strategy:+$strategy $PKTWS_EXTRA $PKTWS_EXTRA_1 $PKTWS_EXTRA_2 $PKTWS_EXTRA_3 $PKTWS_EXTRA_4 $PKTWS_EXTRA_5 $PKTWS_EXTRA_6 $PKTWS_EXTRA_7 $PKTWS_EXTRA_8 $PKTWS_EXTRA_9}"
|
||||
strategy_append_extra_pktws
|
||||
report_strategy $1 $2 $PKTWSD
|
||||
}
|
||||
warn_mss()
|
||||
@ -1402,12 +1430,14 @@ tpws_check_domain_http_bypass_()
|
||||
tpws_curl_test_update $1 $3 $s && [ "$SCANLEVEL" = quick ] && return
|
||||
done
|
||||
else
|
||||
local need_mss=1
|
||||
for mss in '' 88; do
|
||||
s3=${mss:+--mss=$mss}
|
||||
for s2 in '' '--oob' '--disorder' ${oobdis:+"$oobdis"}; do
|
||||
for pos in $splits_tls; do
|
||||
tpws_curl_test_update $1 $3 --split-pos=$pos $s2 $s3 && warn_mss $s3 && [ "$SCANLEVEL" != force ] && {
|
||||
[ "$SCANLEVEL" = quick ] && return
|
||||
need_mss=0
|
||||
break
|
||||
}
|
||||
done
|
||||
@ -1416,12 +1446,14 @@ tpws_check_domain_http_bypass_()
|
||||
for s2 in '--tlsrec=midsld' '--tlsrec=sniext+1 --split-pos=midsld' '--tlsrec=sniext+4 --split-pos=midsld' '--tlsrec=sniext+1 --split-pos=1,midsld' '--tlsrec=sniext+4 --split-pos=1,midsld' ; do
|
||||
tpws_curl_test_update $1 $3 $s2 $s $s3 && warn_mss $s3 && [ "$SCANLEVEL" != force ] && {
|
||||
[ "$SCANLEVEL" = quick ] && return
|
||||
need_mss=0
|
||||
break
|
||||
}
|
||||
done
|
||||
done
|
||||
# only linux supports mss
|
||||
[ "$UNAME" = Linux -a "$sec" = 1 ] || break
|
||||
[ "$SCANLEVEL" = force -o "$need_mss" = 1 ] || break
|
||||
done
|
||||
fi
|
||||
}
|
||||
@ -1433,7 +1465,7 @@ tpws_check_domain_http_bypass()
|
||||
|
||||
local strategy
|
||||
tpws_check_domain_http_bypass_ "$@"
|
||||
strategy="${strategy:+$strategy${TPWS_EXTRA:+ $TPWS_EXTRA}${TPWS_EXTRA_1:+ "$TPWS_EXTRA_1"}${TPWS_EXTRA_2:+ "$TPWS_EXTRA_2"}${TPWS_EXTRA_3:+ "$TPWS_EXTRA_3"}${TPWS_EXTRA_4:+ "$TPWS_EXTRA_4"}${TPWS_EXTRA_5:+ "$TPWS_EXTRA_5"}${TPWS_EXTRA_6:+ "$TPWS_EXTRA_6"}${TPWS_EXTRA_7:+ "$TPWS_EXTRA_7"}${TPWS_EXTRA_8:+ "$TPWS_EXTRA_8"}${TPWS_EXTRA_9:+ "$TPWS_EXTRA_9"}}"
|
||||
strategy_append_extra_tpws
|
||||
report_strategy $1 $3 tpws
|
||||
}
|
||||
|
||||
|
20
nfq/nfqws.c
20
nfq/nfqws.c
@ -552,7 +552,7 @@ static bool parse_ws_scale_factor(char *s, uint16_t *wsize, uint8_t *wscale)
|
||||
|
||||
|
||||
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
static void cleanup_args()
|
||||
{
|
||||
wordfree(¶ms.wexp);
|
||||
@ -561,7 +561,7 @@ static void cleanup_args()
|
||||
|
||||
static void cleanup_params(void)
|
||||
{
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
cleanup_args();
|
||||
#endif
|
||||
|
||||
@ -985,7 +985,7 @@ static unsigned int hash_jen(const void *data,unsigned int len)
|
||||
static void exithelp(void)
|
||||
{
|
||||
printf(
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
" @<config_file>|$<config_file>\t\t\t; read file for options. must be the only argument. other options are ignored.\n\n"
|
||||
#endif
|
||||
" --debug=0|1|syslog|@<filename>\n"
|
||||
@ -1099,7 +1099,7 @@ static void exithelp_clean(void)
|
||||
exithelp();
|
||||
}
|
||||
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
// no static to not allow optimizer to inline this func (save stack)
|
||||
void config_from_file(const char *filename)
|
||||
{
|
||||
@ -1192,7 +1192,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
if (argc>=2 && (argv[1][0]=='@' || argv[1][0]=='$'))
|
||||
{
|
||||
config_from_file(argv[1]+1);
|
||||
@ -1595,7 +1595,13 @@ int main(int argc, char **argv)
|
||||
dp->split_count++;
|
||||
break;
|
||||
case 26: /* dpi-desync-split-seqovl */
|
||||
if (!parse_split_pos(optarg, &dp->seqovl))
|
||||
if (!strcmp(optarg,"0"))
|
||||
{
|
||||
// allow zero = disable seqovl
|
||||
dp->seqovl.marker=PM_ABS;
|
||||
dp->seqovl.pos=0;
|
||||
}
|
||||
else if (!parse_split_pos(optarg, &dp->seqovl))
|
||||
{
|
||||
DLOG_ERR("Invalid argument for dpi-desync-split-seqovl\n");
|
||||
exit_clean(1);
|
||||
@ -1957,7 +1963,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
// do not need args from file anymore
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
cleanup_args();
|
||||
#endif
|
||||
argv=NULL; argc=0;
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <sys/queue.h>
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
#include <wordexp.h>
|
||||
#endif
|
||||
|
||||
@ -104,7 +104,7 @@ bool dp_list_have_autohostlist(struct desync_profile_list_head *head);
|
||||
|
||||
struct params_s
|
||||
{
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
wordexp_t wexp; // for file based config
|
||||
#endif
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/queue.h>
|
||||
#include <time.h>
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
#include <wordexp.h>
|
||||
#endif
|
||||
|
||||
@ -85,7 +85,7 @@ void dp_list_destroy(struct desync_profile_list_head *head);
|
||||
|
||||
struct params_s
|
||||
{
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
wordexp_t wexp; // for file based config
|
||||
#endif
|
||||
|
||||
|
12
tpws/tpws.c
12
tpws/tpws.c
@ -122,7 +122,7 @@ static int get_default_ttl(void)
|
||||
static void exithelp(void)
|
||||
{
|
||||
printf(
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
" @<config_file>|$<config_file>\t\t; read file for options. must be the only argument. other options are ignored.\n\n"
|
||||
#endif
|
||||
" --bind-addr=<v4_addr>|<v6_addr>\t; for v6 link locals append %%interface_name\n"
|
||||
@ -215,7 +215,7 @@ static void exithelp(void)
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
static void cleanup_args()
|
||||
{
|
||||
wordfree(¶ms.wexp);
|
||||
@ -223,7 +223,7 @@ static void cleanup_args()
|
||||
#endif
|
||||
static void cleanup_params(void)
|
||||
{
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
cleanup_args();
|
||||
#endif
|
||||
|
||||
@ -472,7 +472,7 @@ static bool parse_pf_list(char *opt, struct port_filters_head *pfl)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
// no static to not allow optimizer to inline this func (save stack)
|
||||
void config_from_file(const char *filename)
|
||||
{
|
||||
@ -547,7 +547,7 @@ void parse_params(int argc, char *argv[])
|
||||
dp = &dpl->dp;
|
||||
dp->n = ++desync_profile_count;
|
||||
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
if (argc>=2 && (argv[1][0]=='@' || argv[1][0]=='$'))
|
||||
{
|
||||
config_from_file(argv[1]+1);
|
||||
@ -1288,7 +1288,7 @@ void parse_params(int argc, char *argv[])
|
||||
SplitDebug();
|
||||
VPRINT("\n");
|
||||
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined( __OpenBSD__) && !defined(__ANDROID__)
|
||||
// do not need args from file anymore
|
||||
cleanup_args();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user