mirror of
https://github.com/bol-van/zapret.git
synced 2025-05-24 22:32:58 +03:00
Compare commits
4 Commits
307a61c43e
...
fda1bcd72c
Author | SHA1 | Date | |
---|---|---|---|
|
fda1bcd72c | ||
|
fc42f6e20e | ||
|
45b93f3a45 | ||
|
92ba6b439e |
@ -212,7 +212,7 @@ doh_resolve()
|
|||||||
# $1 - ip version 4/6
|
# $1 - ip version 4/6
|
||||||
# $2 - hostname
|
# $2 - hostname
|
||||||
# $3 - doh server URL. use $DOH_SERVER if empty
|
# $3 - doh server URL. use $DOH_SERVER if empty
|
||||||
$MDIG --family=$1 --dns-make-query=$2 | curl -s --data-binary @- -H "Content-Type: application/dns-message" "${3:-$DOH_SERVER}" | $MDIG --dns-parse-query
|
$MDIG --family=$1 --dns-make-query=$2 | $CURL -s --data-binary @- -H "Content-Type: application/dns-message" "${3:-$DOH_SERVER}" | $MDIG --dns-parse-query
|
||||||
}
|
}
|
||||||
doh_find_working()
|
doh_find_working()
|
||||||
{
|
{
|
||||||
|
40
ipset/get_antifilter_domains.sh
Normal file
40
ipset/get_antifilter_domains.sh
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
IPSET_DIR="$(dirname "$0")"
|
||||||
|
IPSET_DIR="$(cd "$IPSET_DIR"; pwd)"
|
||||||
|
|
||||||
|
. "$IPSET_DIR/def.sh"
|
||||||
|
|
||||||
|
TMPLIST="$TMPDIR/list.txt"
|
||||||
|
|
||||||
|
URL="https://antifilter.download/list/domains.lst"
|
||||||
|
|
||||||
|
dl()
|
||||||
|
{
|
||||||
|
# $1 - url
|
||||||
|
# $2 - file
|
||||||
|
# $3 - minsize
|
||||||
|
# $4 - maxsize
|
||||||
|
curl -L -H "Accept-Encoding: gzip" -k --fail --max-time 60 --connect-timeout 10 --retry 4 --max-filesize 251658240 -o "$TMPLIST" "$1" ||
|
||||||
|
{
|
||||||
|
echo list download failed : $1
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
|
dlsize=$(LANG=C wc -c "$TMPLIST" | xargs | cut -f 1 -d ' ')
|
||||||
|
if test $dlsize -lt $3; then
|
||||||
|
echo list is too small : $dlsize bytes. can be bad.
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
zzcat "$TMPLIST" | tr -d '\015' | zz "$2"
|
||||||
|
rm -f "$TMPLIST"
|
||||||
|
}
|
||||||
|
|
||||||
|
# useful in case ipban set is used in custom scripts
|
||||||
|
FAIL=
|
||||||
|
getipban || FAIL=1
|
||||||
|
"$IPSET_DIR/create_ipset.sh"
|
||||||
|
[ -n "$FAIL" ] && exit
|
||||||
|
|
||||||
|
dl "$URL" "$ZHOSTLIST" 32768 4194304
|
||||||
|
|
||||||
|
exit 0
|
@ -76,13 +76,6 @@ void randomize_default_tls_payload(uint8_t *p)
|
|||||||
#define PKTDATA_MAXDUMP 32
|
#define PKTDATA_MAXDUMP 32
|
||||||
#define IP_MAXDUMP 80
|
#define IP_MAXDUMP 80
|
||||||
|
|
||||||
static uint8_t zeropkt[DPI_DESYNC_MAX_FAKE_LEN];
|
|
||||||
|
|
||||||
void desync_init(void)
|
|
||||||
{
|
|
||||||
memset(zeropkt, 0, sizeof(zeropkt));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool desync_valid_zero_stage(enum dpi_desync_mode mode)
|
bool desync_valid_zero_stage(enum dpi_desync_mode mode)
|
||||||
{
|
{
|
||||||
return mode==DESYNC_SYNACK || mode==DESYNC_SYNDATA;
|
return mode==DESYNC_SYNACK || mode==DESYNC_SYNDATA;
|
||||||
|
@ -52,5 +52,4 @@ bool desync_valid_second_stage(enum dpi_desync_mode mode);
|
|||||||
bool desync_valid_second_stage_tcp(enum dpi_desync_mode mode);
|
bool desync_valid_second_stage_tcp(enum dpi_desync_mode mode);
|
||||||
bool desync_valid_second_stage_udp(enum dpi_desync_mode mode);
|
bool desync_valid_second_stage_udp(enum dpi_desync_mode mode);
|
||||||
|
|
||||||
void desync_init(void);
|
|
||||||
uint8_t dpi_desync_packet(uint32_t fwmark, const char *ifout, uint8_t *data_pkt, size_t *len_pkt);
|
uint8_t dpi_desync_packet(uint32_t fwmark, const char *ifout, uint8_t *data_pkt, size_t *len_pkt);
|
||||||
|
@ -84,8 +84,6 @@ static void pre_desync(void)
|
|||||||
signal(SIGHUP, onhup);
|
signal(SIGHUP, onhup);
|
||||||
signal(SIGUSR1, onusr1);
|
signal(SIGUSR1, onusr1);
|
||||||
signal(SIGUSR2, onusr2);
|
signal(SIGUSR2, onusr2);
|
||||||
|
|
||||||
desync_init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user