From 320058960fa7a4031c8deae9d1a690737252bd82 Mon Sep 17 00:00:00 2001 From: StressOzz <131419324+StressOzz@users.noreply.github.com> Date: Fri, 24 Jul 2026 22:23:30 +0500 Subject: [PATCH] =?UTF-8?q?add=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20fake=20=D0=B8=D0=B7=20=D0=B1=D0=BB=D0=BE=D0=BA?= =?UTF-8?q?=D0=B0=20discord,stun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zapret-Manager.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Zapret-Manager.sh b/Zapret-Manager.sh index 1e95e7e..3fa4ad7 100644 --- a/Zapret-Manager.sh +++ b/Zapret-Manager.sh @@ -143,13 +143,19 @@ Dv14=$'--filter-tcp=2053,2083,2087,2096,8443\n--hostlist-domains=discord.media\n Dv15=$'--filter-tcp=2053,2083,2087,2096,8443\n--hostlist-domains=discord.media\n--dpi-desync=fake,multidisorder\n--dpi-desync-split-pos=1,midsld\n--dpi-desync-repeats=11\n--dpi-desync-fooling=badseq\n--dpi-desync-fake-tls=0x00000000\n--dpi-desync-fake-tls=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin\n--dpi-desync-fake-tls-mod=rnd,dupsid,sni=www.google.com' Dv16=$'--filter-tcp=2053,2083,2087,2096,8443\n--hostlist-domains=discord.media\n--dpi-desync=fake,hostfakesplit\n--dpi-desync-fake-tls-mod=rnd,dupsid,sni=www.google.com\n--dpi-desync-hostfakesplit-mod=host=www.google.com,altorder=1\n--dpi-desync-fooling=ts' Dv17=$'--filter-tcp=2053,2083,2087,2096,8443\n--hostlist-domains=discord.media\n--dpi-desync=hostfakesplit\n--dpi-desync-repeats=4\n--dpi-desync-fooling=ts\n--dpi-desync-hostfakesplit-mod=host=www.google.com' -DIC_FAKE() { if ! grep -q -- "--filter-l7=discord,stun" "$CONF" || ! grep -q -- "--dpi-desync-fake-discord=" "$CONF"; then echo -e "\n${RED}Блок ${NC}discord,stun${RED} не найден!${NC}\n"; PAUSE; return; fi; FAKE_DIC=$(grep -m1 -- '--dpi-desync-fake-discord=' "$CONF" | sed 's|.*fake/||'); stat_f() { [ "$FAKE_DIC" = "$1" ] && echo "${GREEN}(используется)${NC}"; } -echo -e "\n${MAGENTA}Выберите fake для discord,stun${NC}\n${CYAN}1) ${GREEN}Сменить на ${NC}stun.bin $(stat_f stun.bin)\n${CYAN}2) ${GREEN}Сменить на ${NC}stun2.bin $(stat_f stun2.bin)\n${CYAN}3) ${GREEN}Сменить на ${NC}quic_initial_www_google_com.bin $(stat_f quic_initial_www_google_com.bin)\n${CYAN}4) ${GREEN}Сменить на ${NC}quic_initial_dbankcloud_ru.bin $(stat_f quic_initial_dbankcloud_ru.bin)" -echo -e "${CYAN}5) ${GREEN}Сменить на ${NC}quic_initial_steamcommunity_com.bin $(stat_f quic_initial_steamcommunity_com.bin)\n${CYAN}6) ${GREEN}Сменить на ${NC}quic_initial_tencent_com.bin $(stat_f quic_initial_tencent_com.bin)\n${CYAN}Enter) ${GREEN}Выход в меню настройки Discord${NC}" -echo -ne "\n${YELLOW}Выберите пункт:${NC} "; read -r choiceF; case "$choiceF" in 1) new_fileD="stun.bin";; 2) new_fileD="stun2.bin";; 3) new_fileD="quic_initial_www_google_com.bin";; 4) new_fileD="quic_initial_dbankcloud_ru.bin";; -5) new_fileD="quic_initial_steamcommunity_com.bin";; 6) new_fileD="quic_initial_tencent_com.bin";; *) return;; esac; echo -e "\n${CYAN}Устанавливаем fake${NC} ${new_fileD}" -awk -v new="$new_fileD" 'BEGIN {blk=0} /^.*--filter-l7=discord,stun/ {blk=1} blk && /^.*--filter-l7=/ && $0 !~ /--filter-l7=discord,stun/ {blk=0} blk && $0 ~ "--dpi-desync-fake-discord=/opt/zapret/files/fake/" { sub(/\/opt\/zapret\/files\/fake\/[^ ]+/, "/opt/zapret/files/fake/" new) } blk && $0 ~ "--dpi-desync-fake-stun=/opt/zapret/files/fake/" { sub(/\/opt\/zapret\/files\/fake\/[^ ]+/, "/opt/zapret/files/fake/" new) } {print}' \ -"$CONF" > "$CONF.tmp" && mv "$CONF.tmp" "$CONF"; ZAPRET_RESTART; echo -e "fake ${GREEN}изменён на ${NC}${new_fileD}${GREEN}!${NC}\n"; PAUSE; } +stat_f() { [ "$FAKE_DIC" = "$1" ] && [ "$FAKE_DISABLED" = 0 ] && echo "${GREEN}(используется)${NC}"; }; stat_del() { [ "$FAKE_DISABLED" = 1 ] && echo "${GREEN}(используется)${NC}"; } +DIC_FAKE() { if ! grep -q -- "--filter-l7=discord,stun" "$CONF" || ! grep -q -- "--dpi-desync=fake" "$CONF"; then echo -e "\n${RED}Блок ${NC}discord,stun${RED} не найден!${NC}\n"; PAUSE; return; fi +FAKE_DIC=$(awk '/--filter-l7=discord,stun/ {blk=1; next} blk && /^.*--filter-l7=/ {exit} blk && /--dpi-desync-fake-discord=/ {sub(/.*fake\//,""); print; exit}' "$CONF") +FAKE_DISABLED=$(awk '/--filter-l7=discord,stun/ {blk=1; next} blk && /^.*--filter-l7=/ {exit} blk && /--dpi-desync-fake-discord=/ {found=1; exit} END {print found ? 0 : 1}' "$CONF") +echo -e "\n${MAGENTA}Выберите fake для discord,stun${NC}\n${CYAN}1) ${GREEN}Сменить на ${NC}stun.bin $(stat_f stun.bin)\n${CYAN}2) ${GREEN}Сменить на ${NC}stun2.bin $(stat_f stun2.bin)\n${CYAN}3) ${GREEN}Сменить на ${NC}quic_initial_www_google_com.bin $(stat_f quic_initial_www_google_com.bin)" +echo -e "${CYAN}4) ${GREEN}Сменить на ${NC}quic_initial_dbankcloud_ru.bin $(stat_f quic_initial_dbankcloud_ru.bin)\n${CYAN}5) ${GREEN}Сменить на ${NC}quic_initial_steamcommunity_com.bin $(stat_f quic_initial_steamcommunity_com.bin)" +echo -e "${CYAN}6) ${GREEN}Сменить на ${NC}quic_initial_tencent_com.bin $(stat_f quic_initial_tencent_com.bin)\n${CYAN}7) ${GREEN}Удалить ${NC}fake $(stat_del)\n${CYAN}Enter) ${GREEN}Выход в меню настройки Discord${NC}"; echo -ne "\n${YELLOW}Выберите пункт:${NC} " +read -r choiceF; case "$choiceF" in 1) new_fileD="stun.bin";; 2) new_fileD="stun2.bin";; 3) new_fileD="quic_initial_www_google_com.bin";; 4) new_fileD="quic_initial_dbankcloud_ru.bin";; 5) new_fileD="quic_initial_steamcommunity_com.bin";; 6) new_fileD="quic_initial_tencent_com.bin";; 7) new_fileD="DELETE";; *) return;; esac +[ "$new_fileD" = "DELETE" ] && echo -e "\n${CYAN}Удаляем ${NC}fake" || echo -e "\n${CYAN}Устанавливаем${NC} ${new_fileD}"; if [ "$new_fileD" = "DELETE" ]; then +awk 'BEGIN{blk=0} /--filter-l7=discord,stun/ {blk=1} blk && /^.*--filter-l7=/ && $0 !~ /--filter-l7=discord,stun/ {blk=0} blk && /--dpi-desync-fake-discord=/ {next} blk && /--dpi-desync-fake-stun=/ {next} {print}' "$CONF" > "$CONF.tmp" && mv "$CONF.tmp" "$CONF"; elif grep -A5 -- '--filter-l7=discord,stun' "$CONF" | grep -q -- '--dpi-desync-fake-discord='; then +awk -v new="$new_fileD" 'BEGIN {blk=0} /^.*--filter-l7=discord,stun/ {blk=1} blk && /^.*--filter-l7=/ && $0 !~ /--filter-l7=discord,stun/ {blk=0} blk && $0 ~ "--dpi-desync-fake-discord=/opt/zapret/files/fake/" {sub(/\/opt\/zapret\/files\/fake\/[^ ]+/, "/opt/zapret/files/fake/" new)} blk && $0 ~ "--dpi-desync-fake-stun=/opt/zapret/files/fake/" {sub(/\/opt\/zapret\/files\/fake\/[^ ]+/, "/opt/zapret/files/fake/" new)} {print}' "$CONF" > "$CONF.tmp" && mv "$CONF.tmp" "$CONF" +else awk -v new="$new_fileD" 'BEGIN{blk=0} /--filter-l7=discord,stun/ {blk=1} blk && /^.*--filter-l7=/ && $0 !~ /--filter-l7=discord,stun/ {blk=0} {print; if (blk && /--dpi-desync=fake/) {print "--dpi-desync-fake-discord=/opt/zapret/files/fake/" new; print "--dpi-desync-fake-stun=/opt/zapret/files/fake/" new}}' "$CONF" > "$CONF.tmp" && mv "$CONF.tmp" "$CONF"; fi +ZAPRET_RESTART; if [ "$new_fileD" = "DELETE" ]; then echo -e "fake ${GREEN}удалён!${NC}\n"; else echo -e "fake ${GREEN}изменён на ${NC}${new_fileD}${GREEN}!${NC}\n"; fi; PAUSE; } select_Dv() { DVS=$(set | grep -E '^Dv[0-9]+=' | sed 's/=.*//' | sort -V); COUNT_dv=$(echo "$DVS" | wc -l); echo; echo -en "${YELLOW}Введите версию стратегии для discord.media (${NC}1-$COUNT_dv${YELLOW}):${NC} "; read CHOICE_DV