mirror of
https://github.com/bol-van/zapret.git
synced 2026-10-27 05:06:50 +09:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b057491af | ||
|
|
8e7b694076 | ||
|
|
e8395eea56 | ||
|
|
6e619eba1a | ||
|
|
f8bd218e67 | ||
|
|
207a6faf33 | ||
|
|
991e3534a6 | ||
|
|
ebb22dfa3f | ||
|
|
9bd65e0c1d | ||
|
|
5b337b6015 | ||
|
|
4189803693 | ||
|
|
1175b171ba | ||
|
|
bea643c967 | ||
|
|
addc813956 | ||
|
|
0f1721d2c4 | ||
|
|
abdc8d9449 | ||
|
|
9e9136cffd | ||
|
|
c802069a11 | ||
|
|
4e5caf4087 | ||
|
|
de63ee7321 | ||
|
|
d6688b935d | ||
|
|
21e08ca55e | ||
|
|
c4f53549b1 | ||
|
|
08645997f8 | ||
|
|
e42a545ebc | ||
|
|
8324c04a41 | ||
|
|
166847ba92 | ||
|
|
1904f01cf4 | ||
|
|
4ae1ad053d |
No files matched your search
@@ -3,6 +3,8 @@ custom_runner()
|
|||||||
# $1 - function name
|
# $1 - function name
|
||||||
# $2+ - params
|
# $2+ - params
|
||||||
|
|
||||||
|
[ "$DISABLE_CUSTOM" = 1 ] && return 0
|
||||||
|
|
||||||
local n script FUNC=$1
|
local n script FUNC=$1
|
||||||
|
|
||||||
shift
|
shift
|
||||||
|
|||||||
+15
-5
@@ -349,27 +349,37 @@ ipt_do_nfqws_in_out()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zapret_do_firewall_standard_rules_ipt()
|
zapret_do_firewall_standard_tpws_rules_ipt()
|
||||||
{
|
{
|
||||||
# $1 - 1 - add, 0 - del
|
# $1 - 1 - add, 0 - del
|
||||||
|
|
||||||
local f4 f6
|
local f4 f6
|
||||||
|
|
||||||
[ "$TPWS_ENABLE" = 1 -a -n "$TPWS_PORTS" ] &&
|
[ "$TPWS_ENABLE" = 1 -a -n "$TPWS_PORTS" ] && {
|
||||||
{
|
|
||||||
f4="-p tcp -m multiport --dports $TPWS_PORTS_IPT"
|
f4="-p tcp -m multiport --dports $TPWS_PORTS_IPT"
|
||||||
f6=$f4
|
f6=$f4
|
||||||
filter_apply_ipset_target f4 f6
|
filter_apply_ipset_target f4 f6
|
||||||
fw_tpws $1 "$f4" "$f6" $TPPORT
|
fw_tpws $1 "$f4" "$f6" $TPPORT
|
||||||
}
|
}
|
||||||
[ "$NFQWS_ENABLE" = 1 ] &&
|
}
|
||||||
{
|
zapret_do_firewall_standard_nfqws_rules_ipt()
|
||||||
|
{
|
||||||
|
# $1 - 1 - add, 0 - del
|
||||||
|
|
||||||
|
[ "$NFQWS_ENABLE" = 1 ] && {
|
||||||
ipt_do_nfqws_in_out $1 tcp "$NFQWS_PORTS_TCP_IPT" "$NFQWS_TCP_PKT_OUT" "$NFQWS_TCP_PKT_IN"
|
ipt_do_nfqws_in_out $1 tcp "$NFQWS_PORTS_TCP_IPT" "$NFQWS_TCP_PKT_OUT" "$NFQWS_TCP_PKT_IN"
|
||||||
ipt_do_nfqws_in_out $1 tcp "$NFQWS_PORTS_TCP_KEEPALIVE_IPT" keepalive "$NFQWS_TCP_PKT_IN"
|
ipt_do_nfqws_in_out $1 tcp "$NFQWS_PORTS_TCP_KEEPALIVE_IPT" keepalive "$NFQWS_TCP_PKT_IN"
|
||||||
ipt_do_nfqws_in_out $1 udp "$NFQWS_PORTS_UDP_IPT" "$NFQWS_UDP_PKT_OUT" "$NFQWS_UDP_PKT_IN"
|
ipt_do_nfqws_in_out $1 udp "$NFQWS_PORTS_UDP_IPT" "$NFQWS_UDP_PKT_OUT" "$NFQWS_UDP_PKT_IN"
|
||||||
ipt_do_nfqws_in_out $1 udp "$NFQWS_PORTS_UDP_KEEPALIVE_IPT" keepalive "$NFQWS_UDP_PKT_IN"
|
ipt_do_nfqws_in_out $1 udp "$NFQWS_PORTS_UDP_KEEPALIVE_IPT" keepalive "$NFQWS_UDP_PKT_IN"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
zapret_do_firewall_standard_rules_ipt()
|
||||||
|
{
|
||||||
|
# $1 - 1 - add, 0 - del
|
||||||
|
|
||||||
|
zapret_do_firewall_standard_tpws_rules_ipt $1
|
||||||
|
zapret_do_firewall_standard_nfqws_rules_ipt $1
|
||||||
|
}
|
||||||
|
|
||||||
zapret_do_firewall_rules_ipt()
|
zapret_do_firewall_rules_ipt()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
standard_mode_tpws_socks()
|
||||||
|
{
|
||||||
|
# $1 - 1 - run, 0 - stop
|
||||||
|
local opt
|
||||||
|
[ "$TPWS_SOCKS_ENABLE" = 1 ] && {
|
||||||
|
opt="--port=$TPPORT_SOCKS $TPWS_SOCKS_OPT"
|
||||||
|
filter_apply_hostlist_target opt
|
||||||
|
do_tpws_socks $1 2 "$opt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
standard_mode_tpws()
|
||||||
|
{
|
||||||
|
# $1 - 1 - run, 0 - stop
|
||||||
|
local opt
|
||||||
|
[ "$TPWS_ENABLE" = 1 ] && check_bad_ws_options $1 "$TPWS_OPT" && {
|
||||||
|
opt="--port=$TPPORT $TPWS_OPT"
|
||||||
|
filter_apply_hostlist_target opt
|
||||||
|
do_tpws $1 1 "$opt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
standard_mode_nfqws()
|
||||||
|
{
|
||||||
|
# $1 - 1 - run, 0 - stop
|
||||||
|
local opt
|
||||||
|
[ "$NFQWS_ENABLE" = 1 ] && check_bad_ws_options $1 "$NFQWS_OPT" && {
|
||||||
|
opt="--qnum=$QNUM $NFQWS_OPT"
|
||||||
|
filter_apply_hostlist_target opt
|
||||||
|
do_nfqws $1 3 "$opt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
standard_mode_daemons()
|
||||||
|
{
|
||||||
|
# $1 - 1 - run, 0 - stop
|
||||||
|
|
||||||
|
standard_mode_tpws_socks $1
|
||||||
|
standard_mode_tpws $1
|
||||||
|
standard_mode_nfqws $1
|
||||||
|
}
|
||||||
|
zapret_do_daemons()
|
||||||
|
{
|
||||||
|
# $1 - 1 - run, 0 - stop
|
||||||
|
|
||||||
|
standard_mode_daemons $1
|
||||||
|
custom_runner zapret_custom_daemons $1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
zapret_run_daemons()
|
||||||
|
{
|
||||||
|
zapret_do_daemons 1 "$@"
|
||||||
|
}
|
||||||
|
zapret_stop_daemons()
|
||||||
|
{
|
||||||
|
zapret_do_daemons 0 "$@"
|
||||||
|
}
|
||||||
+11
-5
@@ -640,25 +640,31 @@ nft_apply_nfqws_in_out()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zapret_apply_firewall_standard_rules_nft()
|
zapret_apply_firewall_standard_tpws_rules_nft()
|
||||||
{
|
{
|
||||||
local f4 f6
|
local f4 f6
|
||||||
|
|
||||||
[ "$TPWS_ENABLE" = 1 -a -n "$TPWS_PORTS" ] &&
|
[ "$TPWS_ENABLE" = 1 -a -n "$TPWS_PORTS" ] && {
|
||||||
{
|
|
||||||
f4="tcp dport {$TPWS_PORTS}"
|
f4="tcp dport {$TPWS_PORTS}"
|
||||||
f6=$f4
|
f6=$f4
|
||||||
nft_filter_apply_ipset_target f4 f6
|
nft_filter_apply_ipset_target f4 f6
|
||||||
nft_fw_tpws "$f4" "$f6" $TPPORT
|
nft_fw_tpws "$f4" "$f6" $TPPORT
|
||||||
}
|
}
|
||||||
[ "$NFQWS_ENABLE" = 1 ] &&
|
}
|
||||||
{
|
zapret_apply_firewall_standard_nfqws_rules_nft()
|
||||||
|
{
|
||||||
|
[ "$NFQWS_ENABLE" = 1 ] && {
|
||||||
nft_apply_nfqws_in_out tcp "$NFQWS_PORTS_TCP" "$NFQWS_TCP_PKT_OUT" "$NFQWS_TCP_PKT_IN"
|
nft_apply_nfqws_in_out tcp "$NFQWS_PORTS_TCP" "$NFQWS_TCP_PKT_OUT" "$NFQWS_TCP_PKT_IN"
|
||||||
nft_apply_nfqws_in_out tcp "$NFQWS_PORTS_TCP_KEEPALIVE" keepalive "$NFQWS_TCP_PKT_IN"
|
nft_apply_nfqws_in_out tcp "$NFQWS_PORTS_TCP_KEEPALIVE" keepalive "$NFQWS_TCP_PKT_IN"
|
||||||
nft_apply_nfqws_in_out udp "$NFQWS_PORTS_UDP" "$NFQWS_UDP_PKT_OUT" "$NFQWS_UDP_PKT_IN"
|
nft_apply_nfqws_in_out udp "$NFQWS_PORTS_UDP" "$NFQWS_UDP_PKT_OUT" "$NFQWS_UDP_PKT_IN"
|
||||||
nft_apply_nfqws_in_out udp "$NFQWS_PORTS_UDP_KEEPALIVE" keepalive "$NFQWS_UDP_PKT_IN"
|
nft_apply_nfqws_in_out udp "$NFQWS_PORTS_UDP_KEEPALIVE" keepalive "$NFQWS_UDP_PKT_IN"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
zapret_apply_firewall_standard_rules_nft()
|
||||||
|
{
|
||||||
|
zapret_apply_firewall_standard_tpws_rules_nft
|
||||||
|
zapret_apply_firewall_standard_nfqws_rules_nft
|
||||||
|
}
|
||||||
|
|
||||||
zapret_apply_firewall_rules_nft()
|
zapret_apply_firewall_rules_nft()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -417,3 +417,9 @@ v69.5
|
|||||||
|
|
||||||
nfqws,tpws: --dry-run
|
nfqws,tpws: --dry-run
|
||||||
install_easy: check tpws and nfqws options validity
|
install_easy: check tpws and nfqws options validity
|
||||||
|
|
||||||
|
v69.6
|
||||||
|
|
||||||
|
nfqws: set NETLINK_NO_ENOBUFS to fix possible nfq recv errors
|
||||||
|
init.d: unify custom scripts for linux
|
||||||
|
init.d: new custom scripts : 20-fw-extra, 50-wg4all
|
||||||
+1
-1
@@ -158,7 +158,7 @@
|
|||||||
>
|
>
|
||||||
> Далее, имея понимание что работает на http, https, quic нужно
|
> Далее, имея понимание что работает на http, https, quic нужно
|
||||||
> сконструировать параметры запуска `tpws` и/или `nfqws` с использованием
|
> сконструировать параметры запуска `tpws` и/или `nfqws` с использованием
|
||||||
> мультистратегии. Как работают мультистратегии описано в readme.txt.
|
> мультистратегии. Как работают мультистратегии описано в [readme.md](./readme.md#множественные-стратегии).
|
||||||
>
|
>
|
||||||
> Если кратко, то обычно параметры конструируются так:
|
> Если кратко, то обычно параметры конструируются так:
|
||||||
> ```sh
|
> ```sh
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ _"Совсем ничего не могу, все очень сложно, да
|
|||||||
|
|
||||||
1) Скачайте и распакуйте архив https://github.com/bol-van/zapret-win-bundle/archive/refs/heads/master.zip.
|
1) Скачайте и распакуйте архив https://github.com/bol-van/zapret-win-bundle/archive/refs/heads/master.zip.
|
||||||
|
|
||||||
2) Если у вас Windows 7 x64, читайте [docs/windows.md](./windows.md). Без описанной там подготовки может не работать.
|
2) Если у вас Windows 7 x64, однократно запустите `win7/install_win7.cmd`. Батник заменит файлы windivert на совместимую с Windows 7 версию.
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> Для 32-битных систем Windows нет готового полного варианта.
|
> Для 32-битных систем Windows нет готового полного варианта.
|
||||||
@@ -123,7 +123,7 @@ blockcheck перейдет в этом случае на **DoH** _(DNS over HTT
|
|||||||
> она стабильна, на третьих полный хаос, и проще отказаться.
|
> она стабильна, на третьих полный хаос, и проще отказаться.
|
||||||
>
|
>
|
||||||
> Далее, имея понимание что работает на http, https, quic, нужно сконструировать параметры запуска winws
|
> Далее, имея понимание что работает на http, https, quic, нужно сконструировать параметры запуска winws
|
||||||
> с использованием мультистратегии. Как работают мультистратегии описано в [readme.md](./readme.md).
|
> с использованием мультистратегии. Как работают мультистратегии описано в [readme.md](./readme.md#множественные-стратегии).
|
||||||
>
|
>
|
||||||
> Прежде всего вам нужно собрать фильтр перехватываемого трафика. Это делается через параметры
|
> Прежде всего вам нужно собрать фильтр перехватываемого трафика. Это делается через параметры
|
||||||
> `--wf-l3`, `--wf-tcp`, `--wf-udp`.
|
> `--wf-l3`, `--wf-tcp`, `--wf-udp`.
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# zapret v69.5
|
# zapret v69.6
|
||||||
|
|
||||||
# SCAMMER WARNING
|
# SCAMMER WARNING
|
||||||
|
|
||||||
|
|||||||
+8
-7
@@ -1,4 +1,4 @@
|
|||||||
# zapret v69.5
|
# zapret v69.6
|
||||||
|
|
||||||
# ВНИМАНИЕ, остерегайтесь мошенников
|
# ВНИМАНИЕ, остерегайтесь мошенников
|
||||||
|
|
||||||
@@ -1866,8 +1866,9 @@ custom скрипты - это маленькие shell программы, уп
|
|||||||
/opt/zapret/init.d/macos/custom.d
|
/opt/zapret/init.d/macos/custom.d
|
||||||
```
|
```
|
||||||
Директория будет просканирована в алфавитном порядке, и каждый скрипт будет применен.
|
Директория будет просканирована в алфавитном порядке, и каждый скрипт будет применен.
|
||||||
Рядом имеется `custom.d.examples`. Это готовые скрипты, которые можно копировать в `custom.d`.
|
|
||||||
Их можно взять за основу для написания собственных.
|
В `init.d` имеется `custom.d.examples.linux`, в `init.d/macos` - `custom.d.examples`.
|
||||||
|
Это готовые скрипты, которые можно копировать в `custom.d`. Их можно взять за основу для написания собственных.
|
||||||
|
|
||||||
***Для linux пишется код в функции***
|
***Для linux пишется код в функции***
|
||||||
```
|
```
|
||||||
@@ -1885,9 +1886,9 @@ zapret_custom_firewall_v6
|
|||||||
```
|
```
|
||||||
|
|
||||||
zapret_custom_daemons поднимает демоны **nfqws**/**tpws** в нужном вам количестве и с нужными вам параметрами.
|
zapret_custom_daemons поднимает демоны **nfqws**/**tpws** в нужном вам количестве и с нужными вам параметрами.
|
||||||
Для систем традиционного linux (sysv) и MacOS в первом параметре передается код операции: 1 = запуск, 0 = останов.
|
В первом параметре передается код операции: 1 = запуск, 0 = останов.
|
||||||
Для openwrt логика останова отсутствует за ненадобностью.
|
|
||||||
Схема запуска демонов в openwrt отличается - используется procd.
|
Схема запуска демонов в openwrt отличается - используется procd.
|
||||||
|
Поэтому логика останова отсутствует за ненадобностью, останов никогда не вызывается.
|
||||||
|
|
||||||
zapret_custom_firewall поднимает и убирает правила `iptables`.
|
zapret_custom_firewall поднимает и убирает правила `iptables`.
|
||||||
В первом параметре передается код операции: 1 = запуск, 0 = останов.
|
В первом параметре передается код операции: 1 = запуск, 0 = останов.
|
||||||
@@ -1913,8 +1914,8 @@ zapret_custom_firewall_nft поднимает правила nftables.
|
|||||||
В macos firewall-функции ничего сами никуда не заносят. Их задача - лишь выдать текст в stdout,
|
В macos firewall-функции ничего сами никуда не заносят. Их задача - лишь выдать текст в stdout,
|
||||||
содержащий правила для pf-якоря. Остальное сделает обертка.
|
содержащий правила для pf-якоря. Остальное сделает обертка.
|
||||||
|
|
||||||
Особо обратите внимание на номер демона в функциях `run_daemon` и `do_daemon`, номера портов **tpws**
|
Особо обратите внимание на номер демона в функциях `run_daemon` , `do_daemon`, `do_tpws`, `do_tpws_socks`, `do_nfqws` ,
|
||||||
и очередей `nfqueue`.
|
номера портов **tpws** и очередей **nfqueue**.
|
||||||
Они должны быть уникальными во всех скриптах. При накладке будет ошибка.
|
Они должны быть уникальными во всех скриптах. При накладке будет ошибка.
|
||||||
Поэтому используйте функции динамического получения этих значений из пула.
|
Поэтому используйте функции динамического получения этих значений из пула.
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -101,10 +101,11 @@ There are several options :
|
|||||||
Replace these 2 files in every location they are present.
|
Replace these 2 files in every location they are present.
|
||||||
In `zapret-win-bundle` they are in `zapret-winws` и `blockcheck/zapret/nfq` folders.
|
In `zapret-win-bundle` they are in `zapret-winws` и `blockcheck/zapret/nfq` folders.
|
||||||
However this option still requires 10+ year old patch that enables SHA256 signatures.
|
However this option still requires 10+ year old patch that enables SHA256 signatures.
|
||||||
|
If you're using win bundle you can simply run `win7\install_win7.cmd`
|
||||||
|
|
||||||
2. [Hack ESU](https://hackandpwn.com/windows-7-esu-patching)
|
3. [Hack ESU](https://hackandpwn.com/windows-7-esu-patching)
|
||||||
|
|
||||||
3. Use `UpdatePack7R2` from simplix : https://blog.simplix.info
|
4. Use `UpdatePack7R2` from simplix : https://blog.simplix.info
|
||||||
If you are in Russia or Belarus temporary change region in Control Panel.
|
If you are in Russia or Belarus temporary change region in Control Panel.
|
||||||
|
|
||||||
### blockcheck
|
### blockcheck
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ _windivert 2.2.2-A_, который идет в поставке zapret.
|
|||||||
и заменить эти 2 файла.
|
и заменить эти 2 файла.
|
||||||
В [zapret-win-bundle](https://github.com/bol-van/zapret-win-bundle) есть отдельных 2 места, где находится **winws** : [_zapret-winws_](https://github.com/bol-van/zapret-win-bundle/tree/master/zapret-winws) и [_blockcheck/zapret/nfq_](https://github.com/bol-van/zapret-win-bundle/tree/master/blockcheck).
|
В [zapret-win-bundle](https://github.com/bol-van/zapret-win-bundle) есть отдельных 2 места, где находится **winws** : [_zapret-winws_](https://github.com/bol-van/zapret-win-bundle/tree/master/zapret-winws) и [_blockcheck/zapret/nfq_](https://github.com/bol-van/zapret-win-bundle/tree/master/blockcheck).
|
||||||
Надо менять в обоих местах.
|
Надо менять в обоих местах.
|
||||||
|
Альтернативный вариант при использовании win bundle - запустить `win7\install_win7.cmd`
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Этот вариант проверен и должен работать. Тем не менее патч 10 летней давности, который включает SHA256 сигнатуры, все еще необходим.
|
> Этот вариант проверен и должен работать. Тем не менее патч 10 летней давности, который включает SHA256 сигнатуры, все еще необходим.
|
||||||
|
|||||||
File renamed without changes.
@@ -0,0 +1,66 @@
|
|||||||
|
# this custom script runs standard mode with extra firewall rules
|
||||||
|
|
||||||
|
# config: use TPWS_ENABLE_OVERRIDE, NFQWS_ENABLE_OVERRIDE to enable standard mode daemons
|
||||||
|
# standard and override switches cannot be enabled simultaneously !
|
||||||
|
|
||||||
|
TPWS_ENABLE_OVERRIDE=${TPWS_ENABLE_OVERRIDE:-0}
|
||||||
|
NFQWS_ENABLE_OVERRIDE=${NFQWS_ENABLE_OVERRIDE:-0}
|
||||||
|
|
||||||
|
# config: some if these values must be set in config. not setting any of these makes this script meaningless.
|
||||||
|
# pre vars put ipt/nft code to the rule beginning
|
||||||
|
#FW_EXTRA_PRE_TPWS_IPT=
|
||||||
|
#FW_EXTRA_PRE_TPWS_NFT=
|
||||||
|
#FW_EXTRA_PRE_NFQWS_IPT="-m mark --mark 0x10000000/0x10000000"
|
||||||
|
#FW_EXTRA_PRE_NFQWS_NFT="mark and 0x10000000 != 0"
|
||||||
|
# post vars put ipt/nft code to the rule end
|
||||||
|
#FW_EXTRA_POST_TPWS_IPT=
|
||||||
|
#FW_EXTRA_POST_TPWS_NFT=
|
||||||
|
#FW_EXTRA_POST_NFQWS_IPT=
|
||||||
|
#FW_EXTRA_POST_NFQWS_NFT=
|
||||||
|
|
||||||
|
check_std_intersect()
|
||||||
|
{
|
||||||
|
[ "$TPWS_ENABLE_OVERRIDE" = 1 -a "$TPWS_ENABLE" = 1 ] && {
|
||||||
|
echo "ERROR ! both TPWS_ENABLE_OVERRIDE and TPWS_ENABLE are enabled"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
[ "$NFQWS_ENABLE_OVERRIDE" = 1 -a "$NFQWS_ENABLE" = 1 ] && {
|
||||||
|
echo "ERROR ! both NFQWS_ENABLE_OVERRIDE and NFQWS_ENABLE are enabled"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
zapret_custom_daemons()
|
||||||
|
{
|
||||||
|
# $1 - 1 - add, 0 - stop
|
||||||
|
|
||||||
|
check_std_intersect || return
|
||||||
|
|
||||||
|
local TPWS_SOCKS_ENABLE=0 TPWS_ENABLE=$TPWS_ENABLE_OVERRIDE NFQWS_ENABLE=$NFQWS_ENABLE_OVERRIDE
|
||||||
|
standard_mode_daemons "$1"
|
||||||
|
}
|
||||||
|
zapret_custom_firewall()
|
||||||
|
{
|
||||||
|
# $1 - 1 - run, 0 - stop
|
||||||
|
|
||||||
|
check_std_intersect || return
|
||||||
|
|
||||||
|
local FW_EXTRA_PRE FW_EXTRA_POST TPWS_ENABLE=$TPWS_ENABLE_OVERRIDE NFQWS_ENABLE=$NFQWS_ENABLE_OVERRIDE
|
||||||
|
FW_EXTRA_PRE="$FW_EXTRA_PRE_TPWS_IPT" FW_EXTRA_POST="$FW_EXTRA_POST_TPWS_IPT"
|
||||||
|
zapret_do_firewall_standard_tpws_rules_ipt $1
|
||||||
|
FW_EXTRA_PRE="$FW_EXTRA_PRE_NFQWS_IPT" FW_EXTRA_POST="$FW_EXTRA_POST_NFQWS_IPT"
|
||||||
|
zapret_do_firewall_standard_nfqws_rules_ipt $1
|
||||||
|
}
|
||||||
|
zapret_custom_firewall_nft()
|
||||||
|
{
|
||||||
|
# stop logic is not required
|
||||||
|
|
||||||
|
check_std_intersect || return
|
||||||
|
|
||||||
|
local FW_EXTRA_PRE FW_EXTRA_POST TPWS_ENABLE=$TPWS_ENABLE_OVERRIDE NFQWS_ENABLE=$NFQWS_ENABLE_OVERRIDE
|
||||||
|
FW_EXTRA_PRE="$FW_EXTRA_PRE_TPWS_NFT" FW_EXTRA_POST="$FW_EXTRA_POST_TPWS_NFT"
|
||||||
|
zapret_apply_firewall_standard_tpws_rules_nft
|
||||||
|
FW_EXTRA_PRE="$FW_EXTRA_PRE_NFQWS_NFT" FW_EXTRA_POST="$FW_EXTRA_POST_NFQWS_NFT"
|
||||||
|
zapret_apply_firewall_standard_nfqws_rules_nft
|
||||||
|
}
|
||||||
+2
-2
@@ -8,9 +8,9 @@ alloc_qnum QNUM_DHT4ALL
|
|||||||
|
|
||||||
zapret_custom_daemons()
|
zapret_custom_daemons()
|
||||||
{
|
{
|
||||||
# stop logic is managed by procd
|
# $1 - 1 - add, 0 - stop
|
||||||
|
|
||||||
local opt="--qnum=$QNUM_DHT4ALL $NFQWS_OPT_BASE $NFQWS_OPT_DESYNC_DHT"
|
local opt="--qnum=$QNUM_DHT4ALL $NFQWS_OPT_DESYNC_DHT"
|
||||||
do_nfqws $1 $DNUM_DHT4ALL "$opt"
|
do_nfqws $1 $DNUM_DHT4ALL "$opt"
|
||||||
}
|
}
|
||||||
zapret_custom_firewall()
|
zapret_custom_firewall()
|
||||||
+1
-1
@@ -14,7 +14,7 @@ zapret_custom_daemons()
|
|||||||
{
|
{
|
||||||
# $1 - 1 - run, 0 - stop
|
# $1 - 1 - run, 0 - stop
|
||||||
|
|
||||||
local opt="--qnum=$QNUM_DISCORD $NFQWS_OPT_BASE $NFQWS_OPT_DESYNC_DISCORD"
|
local opt="--qnum=$QNUM_DISCORD $NFQWS_OPT_DESYNC_DISCORD"
|
||||||
do_nfqws $1 $DNUM_DISCORD "$opt"
|
do_nfqws $1 $DNUM_DISCORD "$opt"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
# this custom script demonstrates how to launch extra tpws instance limited by ipset
|
||||||
|
|
||||||
|
# can override in config :
|
||||||
|
TPWS_MY1_OPT="${TPWS_MY1_OPT:---oob --split-pos=midsld}"
|
||||||
|
TPWS_MY1_PORTS=${TPWS_MY1_PORTS:-$TPWS_PORTS}
|
||||||
|
TPWS_MY1_SUBNETS4="${TPWS_MY1_SUBNETS4:-142.250.0.0/15 64.233.160.0/19 172.217.0.0/16 173.194.0.0/16 108.177.0.0/17 74.125.0.0/16 209.85.128.0/17 216.58.192.0/19}"
|
||||||
|
TPWS_MY1_SUBNETS6="${TPWS_MY1_SUBNETS6:-2607:F8B0::/32 2a00:1450:4000::/37}"
|
||||||
|
|
||||||
|
TPWS_MY1_IPSET_SIZE=${TPWS_MY1_IPSET_SIZE:-4096}
|
||||||
|
TPWS_MY1_IPSET_OPT="${TPWS_MY1_IPSET_OPT:-hash:net hashsize 8192 maxelem $TPWS_MY1_IPSET_SIZE}"
|
||||||
|
|
||||||
|
alloc_dnum DNUM_TPWS_MY1
|
||||||
|
alloc_tpws_port PORT_TPWS_MY1
|
||||||
|
TPWS_MY1_NAME4=my1tpws4
|
||||||
|
TPWS_MY1_NAME6=my1tpws6
|
||||||
|
|
||||||
|
zapret_custom_daemons()
|
||||||
|
{
|
||||||
|
# $1 - 1 - run, 0 - stop
|
||||||
|
|
||||||
|
local opt="--port=$PORT_TPWS_MY1 $TPWS_MY1_OPT"
|
||||||
|
do_tpws $1 $DNUM_TPWS_MY1 "$opt"
|
||||||
|
}
|
||||||
|
|
||||||
|
zapret_custom_firewall()
|
||||||
|
{
|
||||||
|
# $1 - 1 - run, 0 - stop
|
||||||
|
|
||||||
|
local f4 f6 subnet
|
||||||
|
local PORTS_IPT=$(replace_char - : $TPWS_MY1_PORTS)
|
||||||
|
local dest_set="-m set --match-set $TPWS_MY1_NAME4 dst"
|
||||||
|
|
||||||
|
[ "$1" = 1 -a "$DISABLE_IPV4" != 1 ] && {
|
||||||
|
ipset create $TPWS_MY1_NAME4 $TPWS_MY1_IPSET_OPT family inet 2>/dev/null
|
||||||
|
ipset flush $TPWS_MY1_NAME4
|
||||||
|
for subnet in $TPWS_MY1_SUBNETS4; do
|
||||||
|
echo add $TPWS_MY1_NAME4 $subnet
|
||||||
|
done | ipset -! restore
|
||||||
|
}
|
||||||
|
[ "$1" = 1 -a "$DISABLE_IPV6" != 1 ] && {
|
||||||
|
ipset create $TPWS_MY1_NAME6 $TPWS_MY1_IPSET_OPT family inet6 2>/dev/null
|
||||||
|
ipset flush $TPWS_MY1_NAME6
|
||||||
|
for subnet in $TPWS_MY1_SUBNETS6; do
|
||||||
|
echo add $TPWS_MY1_NAME6 $subnet
|
||||||
|
done | ipset -! restore
|
||||||
|
}
|
||||||
|
|
||||||
|
f4="-p tcp -m multiport --dports $PORTS_IPT -m set --match-set"
|
||||||
|
f6="$f4 $TPWS_MY1_NAME6 dst"
|
||||||
|
f4="$f4 $TPWS_MY1_NAME4 dst"
|
||||||
|
fw_tpws $1 "$f4" "$f6" $PORT_TPWS_MY1
|
||||||
|
|
||||||
|
[ "$1" = 1 ] || {
|
||||||
|
ipset destroy $TPWS_MY1_NAME4 2>/dev/null
|
||||||
|
ipset destroy $TPWS_MY1_NAME6 2>/dev/null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
zapret_custom_firewall_nft()
|
||||||
|
{
|
||||||
|
local f4 f6 subnet
|
||||||
|
|
||||||
|
[ "$DISABLE_IPV4" != 1 ] && {
|
||||||
|
make_comma_list subnets $TPWS_MY1_SUBNETS4
|
||||||
|
nft_create_set $TPWS_MY1_NAME4 "type ipv4_addr; size $TPWS_MY1_IPSET_SIZE; auto-merge; flags interval;"
|
||||||
|
nft_flush_set $TPWS_MY1_NAME4
|
||||||
|
nft_add_set_element $TPWS_MY1_NAME4 "$subnets"
|
||||||
|
}
|
||||||
|
[ "$DISABLE_IPV6" != 1 ] && {
|
||||||
|
make_comma_list subnets $TPWS_MY1_SUBNETS6
|
||||||
|
nft_create_set $TPWS_MY1_NAME6 "type ipv6_addr; size $TPWS_MY1_IPSET_SIZE; auto-merge; flags interval;"
|
||||||
|
nft_flush_set $TPWS_MY1_NAME6
|
||||||
|
nft_add_set_element $TPWS_MY1_NAME6 "$subnets"
|
||||||
|
}
|
||||||
|
|
||||||
|
f4="tcp dport {$TPWS_MY1_PORTS}"
|
||||||
|
f6="$f4 ip6 daddr @$TPWS_MY1_NAME6"
|
||||||
|
f4="$f4 ip daddr @$TPWS_MY1_NAME4"
|
||||||
|
nft_fw_tpws "$f4" "$f6" $PORT_TPWS_MY1
|
||||||
|
}
|
||||||
|
|
||||||
|
zapret_custom_firewall_nft_flush()
|
||||||
|
{
|
||||||
|
# this function is called after all nft fw rules are deleted
|
||||||
|
# however sets are not deleted. it's desired to clear sets here.
|
||||||
|
|
||||||
|
nft_del_set $TPWS_MY1_NAME4 2>/dev/null
|
||||||
|
nft_del_set $TPWS_MY1_NAME6 2>/dev/null
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# this custom script runs desync to all wireguard handshake initiation packets
|
||||||
|
|
||||||
|
# can override in config :
|
||||||
|
NFQWS_OPT_DESYNC_WG="${NFQWS_OPT_DESYNC_WG:---dpi-desync=fake}"
|
||||||
|
|
||||||
|
alloc_dnum DNUM_WG4ALL
|
||||||
|
alloc_qnum QNUM_WG4ALL
|
||||||
|
|
||||||
|
zapret_custom_daemons()
|
||||||
|
{
|
||||||
|
# $1 - 1 - add, 0 - stop
|
||||||
|
|
||||||
|
local opt="--qnum=$QNUM_WG4ALL $NFQWS_OPT_DESYNC_WG"
|
||||||
|
do_nfqws $1 $DNUM_WG4ALL "$opt"
|
||||||
|
}
|
||||||
|
# size = 156 (8 udp header + 148 payload) && payload starts with 0x01000000
|
||||||
|
zapret_custom_firewall()
|
||||||
|
{
|
||||||
|
# $1 - 1 - run, 0 - stop
|
||||||
|
|
||||||
|
local f='-p udp -m u32 --u32'
|
||||||
|
fw_nfqws_post $1 "$f 0>>22&0x3C@4>>16=0x9c&&0>>22&0x3C@8=0x01000000" "$f 44>>16=0x9c&&48=0x01000000" $QNUM_WG4ALL
|
||||||
|
}
|
||||||
|
zapret_custom_firewall_nft()
|
||||||
|
{
|
||||||
|
# stop logic is not required
|
||||||
|
|
||||||
|
local f="udp length 156 @th,64,32 0x01000000"
|
||||||
|
nft_fw_nfqws_post "$f" "$f" $QNUM_WG4ALL
|
||||||
|
}
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
# this custom script runs desync to DHT packets with udp payload length 101..399 , without ipset/hostlist filtering
|
|
||||||
|
|
||||||
# can override in config :
|
|
||||||
NFQWS_OPT_DESYNC_DHT="${NFQWS_OPT_DESYNC_DHT:---dpi-desync=tamper}"
|
|
||||||
|
|
||||||
alloc_dnum DNUM_DHT4ALL
|
|
||||||
alloc_qnum QNUM_DHT4ALL
|
|
||||||
|
|
||||||
zapret_custom_daemons()
|
|
||||||
{
|
|
||||||
# stop logic is managed by procd
|
|
||||||
|
|
||||||
local opt="--qnum=$QNUM_DHT4ALL $NFQWS_OPT_BASE $NFQWS_OPT_DESYNC_DHT"
|
|
||||||
run_daemon $DNUM_DHT4ALL $NFQWS "$opt"
|
|
||||||
}
|
|
||||||
zapret_custom_firewall()
|
|
||||||
{
|
|
||||||
# $1 - 1 - run, 0 - stop
|
|
||||||
|
|
||||||
local f uf4 uf6
|
|
||||||
local first_packet_only="$ipt_connbytes 1:1"
|
|
||||||
|
|
||||||
f='-p udp -m length --length 109:407 -m u32 --u32'
|
|
||||||
uf4='0>>22&0x3C@8>>16=0x6431'
|
|
||||||
uf6='48>>16=0x6431'
|
|
||||||
fw_nfqws_post $1 "$f $uf4 $first_packet_only" "$f $uf6 $first_packet_only" $QNUM_DHT4ALL
|
|
||||||
|
|
||||||
}
|
|
||||||
zapret_custom_firewall_nft()
|
|
||||||
{
|
|
||||||
# stop logic is not required
|
|
||||||
|
|
||||||
local f
|
|
||||||
local first_packet_only="$nft_connbytes 1"
|
|
||||||
|
|
||||||
f="meta length 109-407 meta l4proto udp @th,64,16 0x6431"
|
|
||||||
nft_fw_nfqws_post "$f $first_packet_only" "$f $first_packet_only" $QNUM_DHT4ALL
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
# this custom script runs desync of some udp packets to discord subnets
|
|
||||||
# idea taken from community. not tested and not optimized by author.
|
|
||||||
|
|
||||||
# can override in config :
|
|
||||||
NFQWS_OPT_DESYNC_DISCORD="${NFQWS_OPT_DESYNC_DISCORD:---dpi-desync=fake --dpi-desync-repeats=6 --dpi-desync-any-protocol}"
|
|
||||||
DISCORD_PORTS=${DISCORD_PORTS:-50000-50099}
|
|
||||||
DISCORD_SUBNETS="${DISCORD_SUBNETS:-5.200.14.249 18.165.140.0/25 23.227.38.74 34.0.48.0/24 34.0.49.64/26 34.0.50.0/25 34.0.51.0/24 34.0.52.0/22 34.0.56.0/23 34.0.59.0/24 34.0.60.0/24 34.0.62.128/25 34.0.63.228 34.0.64.0/23 34.0.66.130 34.0.82.140 34.0.129.128/25 34.0.130.0/24 34.0.131.130 34.0.132.139 34.0.133.75 34.0.134.0/24 34.0.135.251 34.0.136.51 34.0.137.0/24 34.0.139.0/24 34.0.140.0/23 34.0.142.0/25 34.0.144.0/23 34.0.146.0/24 34.0.148.25 34.0.149.101 34.0.151.0/25 34.0.153.0/24 34.0.155.0/24 34.0.156.101 34.0.157.0/25 34.0.158.247 34.0.159.188 34.0.192.0/25 34.0.193.0/24 34.0.194.0/24 34.0.195.172 34.0.196.200/29 34.0.197.81 34.0.198.25 34.0.199.0/24 34.0.200.0/24 34.0.201.81 34.0.202.34 34.0.203.0/24 34.0.204.0/23 34.0.206.0/25 34.0.207.0/25 34.0.208.195 34.0.209.0/24 34.0.210.20 34.0.211.0/26 34.0.212.0/24 34.0.213.64/26 34.0.215.128/25 34.0.216.238 34.0.217.0/24 34.0.218.83 34.0.220.103 34.0.221.0/24 34.0.222.193 34.0.223.68 34.0.227.0/24 34.0.240.0/21 34.0.248.0/23 34.0.250.0/24 34.0.251.0/25 34.1.216.0/24 34.1.221.166 35.207.64.0/23 35.207.67.116 35.207.71.0/24 35.207.72.32 35.207.73.0/24 35.207.74.0/24 35.207.75.128/25 35.207.76.128/26 35.207.77.0/24 35.207.78.129 35.207.79.0/24 35.207.80.76 35.207.81.248/30 35.207.82.0/23 35.207.84.0/24 35.207.85.160 35.207.86.41 35.207.87.184 35.207.89.188 35.207.91.146 35.207.92.230 35.207.95.0/24 35.207.97.174 35.207.99.134 35.207.100.64/26 35.207.101.130 35.207.103.64/26 35.207.104.0/24 35.207.106.128/26 35.207.107.19 35.207.108.192/27 35.207.109.185 35.207.110.0/24 35.207.111.174 35.207.114.16 35.207.115.163 35.207.116.51 35.207.117.0/24 35.207.121.204 35.207.122.0/25 35.207.124.145 35.207.125.116 35.207.126.30 35.207.129.0/24 35.207.131.128/27 35.207.132.247 35.207.135.147 35.207.136.69 35.207.137.0/24 35.207.139.0/24 35.207.140.241 35.207.141.119 35.207.142.0/24 35.207.143.96/27 35.207.144.0/25 35.207.145.0/24 35.207.146.89 35.207.147.0/24 35.207.149.0/24 35.207.150.0/24 35.207.151.61 35.207.153.117 35.207.154.0/24 35.207.155.128/25 35.207.156.254 35.207.157.7 35.207.158.192 35.207.160.160 35.207.162.239 35.207.163.0/24 35.207.164.0/25 35.207.165.147 35.207.166.0/25 35.207.167.0/24 35.207.168.116 35.207.170.0/23 35.207.172.0/24 35.207.174.55 35.207.176.128/25 35.207.178.0/24 35.207.180.152 35.207.181.76 35.207.182.125 35.207.184.101 35.207.185.192 35.207.186.128/25 35.207.187.228 35.207.188.0/24 35.207.189.0/25 35.207.190.194 35.207.191.64/26 35.207.193.165 35.207.195.75 35.207.196.0/24 35.207.198.0/23 35.207.201.186 35.207.202.169 35.207.205.211 35.207.207.4 35.207.209.0/25 35.207.210.191 35.207.211.253 35.207.213.97 35.207.214.0/24 35.207.220.147 35.207.221.58 35.207.222.105 35.207.224.151 35.207.225.210 35.207.227.0/24 35.207.229.212 35.207.232.26 35.207.234.182 35.207.238.0/24 35.207.240.0/24 35.207.245.0/24 35.207.249.0/24 35.207.250.212 35.207.251.0/27 35.212.4.134 35.212.12.148 35.212.88.11 35.212.102.50 35.212.111.0/26 35.212.117.247 35.212.120.122 35.213.0.0/24 35.213.2.8 35.213.4.185 35.213.6.118 35.213.7.128/25 35.213.8.168 35.213.10.0/24 35.213.11.21 35.213.12.224/27 35.213.13.19 35.213.14.217 35.213.16.67 35.213.17.235 35.213.23.166 35.213.25.164 35.213.26.62 35.213.27.252 35.213.32.0/24 35.213.33.74 35.213.34.204 35.213.37.81 35.213.38.186 35.213.39.253 35.213.42.0/24 35.213.43.79 35.213.45.0/24 35.213.46.136 35.213.49.17 35.213.50.0/24 35.213.51.213 35.213.52.0/25 35.213.53.0/24 35.213.54.0/24 35.213.56.0/25 35.213.59.0/24 35.213.61.58 35.213.65.0/24 35.213.67.0/24 35.213.68.192/26 35.213.70.151 35.213.72.128/25 35.213.73.245 35.213.74.131 35.213.78.0/24 35.213.79.137 35.213.80.0/25 35.213.83.128/25 35.213.84.245 35.213.85.0/24 35.213.88.145 35.213.89.80/28 35.213.90.0/24 35.213.91.195 35.213.92.0/24 35.213.93.254 35.213.94.78 35.213.95.145 35.213.96.87 35.213.98.0/24 35.213.99.126 35.213.101.214 35.213.102.0/24 35.213.105.0/24 35.213.106.128/25 35.213.107.158 35.213.109.0/24 35.213.110.40 35.213.111.0/25 35.213.115.0/25 35.213.120.0/24 35.213.122.0/24 35.213.124.89 35.213.125.40 35.213.126.185 35.213.127.0/24 35.213.128.0/22 35.213.132.0/23 35.213.134.140 35.213.135.0/24 35.213.136.0/23 35.213.138.128/25 35.213.139.0/24 35.213.140.0/25 35.213.141.164 35.213.142.128/25 35.213.143.0/24 35.213.144.0/22 35.213.148.0/23 35.213.150.0/24 35.213.152.0/23 35.213.154.137 35.213.155.134 35.213.156.144 35.213.157.0/24 35.213.158.64/26 35.213.160.90 35.213.161.253 35.213.162.0/25 35.213.163.0/24 35.213.164.0/23 35.213.166.106 35.213.167.160/27 35.213.168.0/24 35.213.169.179 35.213.170.0/24 35.213.171.201 35.213.172.159 35.213.173.0/24 35.213.174.128/25 35.213.175.128/26 35.213.176.0/24 35.213.177.0/25 35.213.179.139 35.213.180.0/24 35.213.181.0/25 35.213.182.0/23 35.213.184.0/23 35.213.186.70 35.213.187.0/24 35.213.188.128/25 35.213.190.158 35.213.191.0/24 35.213.192.240/31 35.213.193.74 35.213.194.0/25 35.213.195.178 35.213.196.38 35.213.197.68 35.213.198.0/23 35.213.200.0/23 35.213.202.0/25 35.213.203.195 35.213.204.32/27 35.213.205.170 35.213.20Line truncated
|
|
||||||
|
|
||||||
DISCORD_SET_NAME=discord
|
|
||||||
alloc_dnum DNUM_DISCORD
|
|
||||||
alloc_qnum QNUM_DISCORD
|
|
||||||
|
|
||||||
zapret_custom_daemons()
|
|
||||||
{
|
|
||||||
# $1 - 1 - run, 0 - stop
|
|
||||||
|
|
||||||
local opt="--qnum=$QNUM_DISCORD $NFQWS_OPT_BASE $NFQWS_OPT_DESYNC_DISCORD"
|
|
||||||
run_daemon $DNUM_DISCORD $NFQWS "$opt"
|
|
||||||
}
|
|
||||||
|
|
||||||
zapret_custom_firewall()
|
|
||||||
{
|
|
||||||
# $1 - 1 - run, 0 - stop
|
|
||||||
|
|
||||||
local f
|
|
||||||
local first_packets_only="$ipt_connbytes 1:3"
|
|
||||||
local DISCORD_PORTS_IPT=$(replace_char - : $DISCORD_PORTS)
|
|
||||||
local dest_set="-m set --match-set $DISCORD_SET_NAME dst"
|
|
||||||
local subnet
|
|
||||||
|
|
||||||
local DISABLE_IPV6=1
|
|
||||||
|
|
||||||
[ "$1" = 1 ] && {
|
|
||||||
ipset create $DISCORD_SET_NAME hash:net hashsize 8192 maxelem 4096 2>/dev/null
|
|
||||||
ipset flush $DISCORD_SET_NAME
|
|
||||||
for subnet in $DISCORD_SUBNETS; do
|
|
||||||
echo add $DISCORD_SET_NAME $subnet
|
|
||||||
done | ipset -! restore
|
|
||||||
}
|
|
||||||
|
|
||||||
f="-p udp -m multiport --dports $DISCORD_PORTS_IPT"
|
|
||||||
fw_nfqws_post $1 "$f $first_packets_only $dest_set" "" $QNUM_DISCORD
|
|
||||||
|
|
||||||
[ "$1" = 1 ] || {
|
|
||||||
ipset destroy $DISCORD_SET_NAME 2>/dev/null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
zapret_custom_firewall_nft()
|
|
||||||
{
|
|
||||||
# stop logic is not required
|
|
||||||
|
|
||||||
local f
|
|
||||||
local first_packets_only="$nft_connbytes 1-3"
|
|
||||||
local dest_set="ip daddr @$DISCORD_SET_NAME"
|
|
||||||
local subnets
|
|
||||||
|
|
||||||
local DISABLE_IPV6=1
|
|
||||||
|
|
||||||
make_comma_list subnets $DISCORD_SUBNETS
|
|
||||||
nft_create_set $DISCORD_SET_NAME "type ipv4_addr; size 4096; auto-merge; flags interval;"
|
|
||||||
nft_flush_set $DISCORD_SET_NAME
|
|
||||||
nft_add_set_element $DISCORD_SET_NAME "$subnets"
|
|
||||||
|
|
||||||
f="udp dport {$DISCORD_PORTS}"
|
|
||||||
nft_fw_nfqws_post "$f $first_packets_only $dest_set" "" $QNUM_DISCORD
|
|
||||||
}
|
|
||||||
|
|
||||||
zapret_custom_firewall_nft_flush()
|
|
||||||
{
|
|
||||||
# this function is called after all nft fw rules are deleted
|
|
||||||
# however sets are not deleted. it's desired to clear sets here.
|
|
||||||
|
|
||||||
nft_del_set $DISCORD_SET_NAME 2>/dev/null
|
|
||||||
}
|
|
||||||
@@ -10,6 +10,7 @@ ZAPRET_CONFIG=${ZAPRET_CONFIG:-"$ZAPRET_RW/config"}
|
|||||||
. "$ZAPRET_BASE/common/ipt.sh"
|
. "$ZAPRET_BASE/common/ipt.sh"
|
||||||
. "$ZAPRET_BASE/common/nft.sh"
|
. "$ZAPRET_BASE/common/nft.sh"
|
||||||
. "$ZAPRET_BASE/common/linux_fw.sh"
|
. "$ZAPRET_BASE/common/linux_fw.sh"
|
||||||
|
. "$ZAPRET_BASE/common/linux_daemons.sh"
|
||||||
. "$ZAPRET_BASE/common/list.sh"
|
. "$ZAPRET_BASE/common/list.sh"
|
||||||
. "$ZAPRET_BASE/common/custom.sh"
|
. "$ZAPRET_BASE/common/custom.sh"
|
||||||
CUSTOM_DIR="$ZAPRET_RW/init.d/openwrt"
|
CUSTOM_DIR="$ZAPRET_RW/init.d/openwrt"
|
||||||
|
|||||||
+14
-25
@@ -81,6 +81,10 @@ run_tpws()
|
|||||||
}
|
}
|
||||||
run_daemon $1 "$TPWS" "$OPT $2"
|
run_daemon $1 "$TPWS" "$OPT $2"
|
||||||
}
|
}
|
||||||
|
do_tpws()
|
||||||
|
{
|
||||||
|
[ "$1" = 0 ] || { shift; run_tpws "$@"; }
|
||||||
|
}
|
||||||
run_tpws_socks()
|
run_tpws_socks()
|
||||||
{
|
{
|
||||||
[ "$DISABLE_IPV4" = "1" ] && [ "$DISABLE_IPV6" = "1" ] && return 0
|
[ "$DISABLE_IPV4" = "1" ] && [ "$DISABLE_IPV6" = "1" ] && return 0
|
||||||
@@ -90,13 +94,10 @@ run_tpws_socks()
|
|||||||
tpws_apply_socks_binds opt
|
tpws_apply_socks_binds opt
|
||||||
run_daemon $1 "$TPWS" "$opt $2"
|
run_daemon $1 "$TPWS" "$opt $2"
|
||||||
}
|
}
|
||||||
|
do_tpws_socks()
|
||||||
stop_tpws()
|
|
||||||
{
|
{
|
||||||
stop_daemon $1 "$TPWS"
|
[ "$1" = 0 ] || { shift; run_tpws_socks "$@"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tpws_apply_socks_binds()
|
tpws_apply_socks_binds()
|
||||||
{
|
{
|
||||||
local o
|
local o
|
||||||
@@ -113,31 +114,19 @@ tpws_apply_socks_binds()
|
|||||||
eval $1="\"\$$1 $o\""
|
eval $1="\"\$$1 $o\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run_nfqws()
|
||||||
standard_mode_daemons()
|
|
||||||
{
|
{
|
||||||
local opt
|
run_daemon $1 "$NFQWS" "$NFQWS_OPT_BASE $2"
|
||||||
[ "$TPWS_ENABLE" = 1 ] && check_bad_ws_options 1 "$TPWS_OPT" && {
|
}
|
||||||
opt="--port=$TPPORT $TPWS_OPT"
|
do_nfqws()
|
||||||
filter_apply_hostlist_target opt
|
{
|
||||||
run_tpws 1 "$opt"
|
[ "$1" = 0 ] || { shift; run_nfqws "$@"; }
|
||||||
}
|
|
||||||
[ "$TPWS_SOCKS_ENABLE" = 1 ] && {
|
|
||||||
opt="--port=$TPPORT_SOCKS $TPWS_SOCKS_OPT"
|
|
||||||
filter_apply_hostlist_target opt
|
|
||||||
run_tpws_socks 2 "$opt"
|
|
||||||
}
|
|
||||||
[ "$NFQWS_ENABLE" = 1 ] && check_bad_ws_options 1 "$NFQWS_OPT" && {
|
|
||||||
opt="--qnum=$QNUM $NFQWS_OPT_BASE $NFQWS_OPT"
|
|
||||||
filter_apply_hostlist_target opt
|
|
||||||
run_daemon 3 "$NFQWS" "$opt"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start_daemons_procd()
|
start_daemons_procd()
|
||||||
{
|
{
|
||||||
standard_mode_daemons
|
standard_mode_daemons 1
|
||||||
custom_runner zapret_custom_daemons
|
custom_runner zapret_custom_daemons 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,4 @@ pfctl -d ; pfctl -e
|
|||||||
ipfw delete 100
|
ipfw delete 100
|
||||||
ipfw add 100 divert 989 tcp from any to any 80,443 out not diverted not sockarg
|
ipfw add 100 divert 989 tcp from any to any 80,443 out not diverted not sockarg
|
||||||
pkill ^dvtws$
|
pkill ^dvtws$
|
||||||
dvtws --daemon --port 989 --dpi-desync=split2
|
dvtws --daemon --port 989 --dpi-desync=multisplit
|
||||||
+1
-42
@@ -10,6 +10,7 @@ ZAPRET_CONFIG=${ZAPRET_CONFIG:-"$ZAPRET_RW/config"}
|
|||||||
. "$ZAPRET_BASE/common/ipt.sh"
|
. "$ZAPRET_BASE/common/ipt.sh"
|
||||||
. "$ZAPRET_BASE/common/nft.sh"
|
. "$ZAPRET_BASE/common/nft.sh"
|
||||||
. "$ZAPRET_BASE/common/linux_fw.sh"
|
. "$ZAPRET_BASE/common/linux_fw.sh"
|
||||||
|
. "$ZAPRET_BASE/common/linux_daemons.sh"
|
||||||
. "$ZAPRET_BASE/common/list.sh"
|
. "$ZAPRET_BASE/common/list.sh"
|
||||||
. "$ZAPRET_BASE/common/custom.sh"
|
. "$ZAPRET_BASE/common/custom.sh"
|
||||||
CUSTOM_DIR="$ZAPRET_RW/init.d/sysv"
|
CUSTOM_DIR="$ZAPRET_RW/init.d/sysv"
|
||||||
@@ -275,45 +276,3 @@ create_ipset()
|
|||||||
echo "Creating ip list table (firewall type $FWTYPE)"
|
echo "Creating ip list table (firewall type $FWTYPE)"
|
||||||
"$IPSET_CR" "$@"
|
"$IPSET_CR" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
standard_mode_daemons()
|
|
||||||
{
|
|
||||||
# $1 - 1 - run, 0 - stop
|
|
||||||
|
|
||||||
local opt
|
|
||||||
|
|
||||||
[ "$TPWS_ENABLE" = 1 ] && check_bad_ws_options $1 "$TPWS_OPT" && {
|
|
||||||
opt="--port=$TPPORT $TPWS_OPT"
|
|
||||||
filter_apply_hostlist_target opt
|
|
||||||
do_tpws $1 1 "$opt"
|
|
||||||
}
|
|
||||||
[ "$TPWS_SOCKS_ENABLE" = 1 ] && {
|
|
||||||
opt="--port=$TPPORT_SOCKS $TPWS_SOCKS_OPT"
|
|
||||||
filter_apply_hostlist_target opt
|
|
||||||
do_tpws_socks $1 2 "$opt"
|
|
||||||
}
|
|
||||||
[ "$NFQWS_ENABLE" = 1 ] && check_bad_ws_options $1 "$NFQWS_OPT" && {
|
|
||||||
opt="--qnum=$QNUM $NFQWS_OPT"
|
|
||||||
filter_apply_hostlist_target opt
|
|
||||||
do_nfqws $1 3 "$opt"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
zapret_do_daemons()
|
|
||||||
{
|
|
||||||
# $1 - 1 - run, 0 - stop
|
|
||||||
|
|
||||||
standard_mode_daemons $1
|
|
||||||
custom_runner zapret_custom_daemons $1
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
zapret_run_daemons()
|
|
||||||
{
|
|
||||||
zapret_do_daemons 1 "$@"
|
|
||||||
}
|
|
||||||
zapret_stop_daemons()
|
|
||||||
{
|
|
||||||
zapret_do_daemons 0 "$@"
|
|
||||||
}
|
|
||||||
+1
-1
@@ -394,7 +394,7 @@ copy_openwrt()
|
|||||||
mkdir "$2/tpws" "$2/nfq" "$2/ip2net" "$2/mdig" "$2/binaries" "$2/binaries/$ARCH" "$2/init.d" "$2/tmp" "$2/files"
|
mkdir "$2/tpws" "$2/nfq" "$2/ip2net" "$2/mdig" "$2/binaries" "$2/binaries/$ARCH" "$2/init.d" "$2/tmp" "$2/files"
|
||||||
cp -R "$1/files/fake" "$2/files"
|
cp -R "$1/files/fake" "$2/files"
|
||||||
cp -R "$1/common" "$1/ipset" "$2"
|
cp -R "$1/common" "$1/ipset" "$2"
|
||||||
cp -R "$1/init.d/openwrt" "$2/init.d"
|
cp -R "$1/init.d/openwrt" "$1/init.d/custom.d.examples.linux" "$2/init.d"
|
||||||
cp "$1/config" "$1/config.default" "$1/install_easy.sh" "$1/uninstall_easy.sh" "$1/install_bin.sh" "$1/install_prereq.sh" "$1/blockcheck.sh" "$2"
|
cp "$1/config" "$1/config.default" "$1/install_easy.sh" "$1/uninstall_easy.sh" "$1/install_bin.sh" "$1/install_prereq.sh" "$1/blockcheck.sh" "$2"
|
||||||
cp "$BINDIR/tpws" "$BINDIR/nfqws" "$BINDIR/ip2net" "$BINDIR/mdig" "$2/binaries/$ARCH"
|
cp "$BINDIR/tpws" "$BINDIR/nfqws" "$BINDIR/ip2net" "$BINDIR/mdig" "$2/binaries/$ARCH"
|
||||||
}
|
}
|
||||||
|
|||||||
+64
-36
@@ -152,50 +152,62 @@ static int nfq_cb(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_da
|
|||||||
DLOG("packet: id=%d pass unmodified\n", id);
|
DLOG("packet: id=%d pass unmodified\n", id);
|
||||||
return nfq_set_verdict2(qh, id, NF_ACCEPT, mark, 0, NULL);
|
return nfq_set_verdict2(qh, id, NF_ACCEPT, mark, 0, NULL);
|
||||||
}
|
}
|
||||||
static int nfq_main(void)
|
static void nfq_deinit(struct nfq_handle **h,struct nfq_q_handle **qh)
|
||||||
{
|
{
|
||||||
struct nfq_handle *h = NULL;
|
if (*qh)
|
||||||
struct nfq_q_handle *qh = NULL;
|
{
|
||||||
int fd,rv;
|
DLOG_CONDUP("unbinding from queue %u\n", params.qnum);
|
||||||
uint8_t buf[16384] __attribute__((aligned));
|
nfq_destroy_queue(*qh);
|
||||||
|
*qh = NULL;
|
||||||
|
}
|
||||||
|
if (*h)
|
||||||
|
{
|
||||||
|
DLOG_CONDUP("closing library handle\n");
|
||||||
|
nfq_close(*h);
|
||||||
|
*h = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static bool nfq_init(struct nfq_handle **h,struct nfq_q_handle **qh)
|
||||||
|
{
|
||||||
|
nfq_deinit(h,qh);
|
||||||
|
|
||||||
DLOG_CONDUP("opening library handle\n");
|
DLOG_CONDUP("opening library handle\n");
|
||||||
h = nfq_open();
|
*h = nfq_open();
|
||||||
if (!h) {
|
if (!*h) {
|
||||||
DLOG_PERROR("nfq_open()");
|
DLOG_PERROR("nfq_open()");
|
||||||
goto exiterr;
|
goto exiterr;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLOG_CONDUP("unbinding existing nf_queue handler for AF_INET (if any)\n");
|
DLOG_CONDUP("unbinding existing nf_queue handler for AF_INET (if any)\n");
|
||||||
if (nfq_unbind_pf(h, AF_INET) < 0) {
|
if (nfq_unbind_pf(*h, AF_INET) < 0) {
|
||||||
DLOG_PERROR("nfq_unbind_pf()");
|
DLOG_PERROR("nfq_unbind_pf()");
|
||||||
goto exiterr;
|
goto exiterr;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLOG_CONDUP("binding nfnetlink_queue as nf_queue handler for AF_INET\n");
|
DLOG_CONDUP("binding nfnetlink_queue as nf_queue handler for AF_INET\n");
|
||||||
if (nfq_bind_pf(h, AF_INET) < 0) {
|
if (nfq_bind_pf(*h, AF_INET) < 0) {
|
||||||
DLOG_PERROR("nfq_bind_pf()");
|
DLOG_PERROR("nfq_bind_pf()");
|
||||||
goto exiterr;
|
goto exiterr;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLOG_CONDUP("binding this socket to queue '%u'\n", params.qnum);
|
DLOG_CONDUP("binding this socket to queue '%u'\n", params.qnum);
|
||||||
qh = nfq_create_queue(h, params.qnum, &nfq_cb, ¶ms);
|
*qh = nfq_create_queue(*h, params.qnum, &nfq_cb, ¶ms);
|
||||||
if (!qh) {
|
if (!*qh) {
|
||||||
DLOG_PERROR("nfq_create_queue()");
|
DLOG_PERROR("nfq_create_queue()");
|
||||||
goto exiterr;
|
goto exiterr;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLOG_CONDUP("setting copy_packet mode\n");
|
DLOG_CONDUP("setting copy_packet mode\n");
|
||||||
if (nfq_set_mode(qh, NFQNL_COPY_PACKET, 0xffff) < 0) {
|
if (nfq_set_mode(*qh, NFQNL_COPY_PACKET, 0xffff) < 0) {
|
||||||
DLOG_PERROR("can't set packet_copy mode");
|
DLOG_PERROR("can't set packet_copy mode");
|
||||||
goto exiterr;
|
goto exiterr;
|
||||||
}
|
}
|
||||||
if (nfq_set_queue_maxlen(qh, Q_MAXLEN) < 0) {
|
if (nfq_set_queue_maxlen(*qh, Q_MAXLEN) < 0) {
|
||||||
DLOG_PERROR("can't set queue maxlen");
|
DLOG_PERROR("can't set queue maxlen");
|
||||||
goto exiterr;
|
goto exiterr;
|
||||||
}
|
}
|
||||||
// accept packets if they cant be handled
|
// accept packets if they cant be handled
|
||||||
if (nfq_set_queue_flags(qh, NFQA_CFG_F_FAIL_OPEN , NFQA_CFG_F_FAIL_OPEN))
|
if (nfq_set_queue_flags(*qh, NFQA_CFG_F_FAIL_OPEN , NFQA_CFG_F_FAIL_OPEN))
|
||||||
{
|
{
|
||||||
DLOG_ERR("can't set queue flags. its OK on linux <3.6\n");
|
DLOG_ERR("can't set queue flags. its OK on linux <3.6\n");
|
||||||
// dot not fail. not supported on old linuxes <3.6
|
// dot not fail. not supported on old linuxes <3.6
|
||||||
@@ -205,6 +217,27 @@ static int nfq_main(void)
|
|||||||
if (!rawsend_preinit(params.bind_fix4,params.bind_fix6))
|
if (!rawsend_preinit(params.bind_fix4,params.bind_fix6))
|
||||||
goto exiterr;
|
goto exiterr;
|
||||||
|
|
||||||
|
int yes=1, fd = nfq_fd(*h);
|
||||||
|
|
||||||
|
#if defined SOL_NETLINK && defined NETLINK_NO_ENOBUFS
|
||||||
|
if (setsockopt(fd, SOL_NETLINK, NETLINK_NO_ENOBUFS, &yes, sizeof(yes)) == -1)
|
||||||
|
DLOG_PERROR("setsockopt(NETLINK_NO_ENOBUFS)");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
exiterr:
|
||||||
|
nfq_deinit(h,qh);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int nfq_main(void)
|
||||||
|
{
|
||||||
|
uint8_t buf[16384] __attribute__((aligned));
|
||||||
|
struct nfq_handle *h = NULL;
|
||||||
|
struct nfq_q_handle *qh = NULL;
|
||||||
|
int fd,e;
|
||||||
|
ssize_t rd;
|
||||||
|
|
||||||
#ifndef __CYGWIN__
|
#ifndef __CYGWIN__
|
||||||
sec_harden();
|
sec_harden();
|
||||||
|
|
||||||
@@ -216,36 +249,31 @@ static int nfq_main(void)
|
|||||||
|
|
||||||
pre_desync();
|
pre_desync();
|
||||||
|
|
||||||
fd = nfq_fd(h);
|
if (!nfq_init(&h,&qh))
|
||||||
|
|
||||||
// increase socket buffer size. on slow systems reloading hostlist can take a while.
|
|
||||||
// if too many unhandled packets are received its possible to get "no buffer space available" error
|
|
||||||
if (!set_socket_buffers(fd,Q_RCVBUF/2,Q_SNDBUF/2))
|
|
||||||
goto exiterr;
|
goto exiterr;
|
||||||
|
|
||||||
|
fd = nfq_fd(h);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
while ((rv = recv(fd, buf, sizeof(buf), 0)) > 0)
|
while ((rd = recv(fd, buf, sizeof(buf), 0)) >= 0)
|
||||||
{
|
{
|
||||||
int r = nfq_handle_packet(h, (char *)buf, rv);
|
if (rd)
|
||||||
|
{
|
||||||
|
int r = nfq_handle_packet(h, (char *)buf, (int)rd);
|
||||||
if (r) DLOG_ERR("nfq_handle_packet error %d\n", r);
|
if (r) DLOG_ERR("nfq_handle_packet error %d\n", r);
|
||||||
}
|
}
|
||||||
DLOG_ERR("recv: errno %d\n",errno);
|
else
|
||||||
|
DLOG("recv from nfq returned 0 !\n");
|
||||||
|
}
|
||||||
|
e=errno;
|
||||||
|
DLOG_ERR("recv: recv=%zd errno %d\n",rd,e);
|
||||||
|
errno=e;
|
||||||
DLOG_PERROR("recv");
|
DLOG_PERROR("recv");
|
||||||
// do not fail on ENOBUFS
|
// do not fail on ENOBUFS
|
||||||
} while(errno==ENOBUFS);
|
} while(e==ENOBUFS);
|
||||||
|
|
||||||
DLOG_CONDUP("unbinding from queue %u\n", params.qnum);
|
nfq_deinit(&h,&qh);
|
||||||
nfq_destroy_queue(qh);
|
|
||||||
|
|
||||||
#ifdef INSANE
|
|
||||||
/* normally, applications SHOULD NOT issue this command, since
|
|
||||||
* it detaches other programs/sockets from AF_INET, too ! */
|
|
||||||
DLOG_CONDUP("unbinding from AF_INET\n");
|
|
||||||
nfq_unbind_pf(h, AF_INET);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DLOG_CONDUP("closing library handle\n");
|
|
||||||
nfq_close(h);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
exiterr:
|
exiterr:
|
||||||
@@ -1367,10 +1395,12 @@ int main(int argc, char **argv)
|
|||||||
while ((v = getopt_long_only(argc, argv, "", long_options, &option_index)) != -1)
|
while ((v = getopt_long_only(argc, argv, "", long_options, &option_index)) != -1)
|
||||||
{
|
{
|
||||||
if (v)
|
if (v)
|
||||||
|
{
|
||||||
if (bDry)
|
if (bDry)
|
||||||
exit_clean(1);
|
exit_clean(1);
|
||||||
else
|
else
|
||||||
exithelp_clean();
|
exithelp_clean();
|
||||||
|
}
|
||||||
switch (option_index)
|
switch (option_index)
|
||||||
{
|
{
|
||||||
case 0: /* debug */
|
case 0: /* debug */
|
||||||
@@ -1407,7 +1437,6 @@ int main(int argc, char **argv)
|
|||||||
params.debug_target = LOG_TARGET_CONSOLE;
|
params.debug_target = LOG_TARGET_CONSOLE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifndef __CYGWIN__
|
|
||||||
case 1: /* dry-run */
|
case 1: /* dry-run */
|
||||||
bDry=true;
|
bDry=true;
|
||||||
break;
|
break;
|
||||||
@@ -1431,7 +1460,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case 3: /* daemon */
|
case 3: /* daemon */
|
||||||
daemon = true;
|
daemon = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
+1
-1
@@ -151,7 +151,7 @@ void ResolveMultiPos(const uint8_t *data, size_t sz, t_l7proto l7proto, const st
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char *http_methods[] = { "GET /","POST /","HEAD /","OPTIONS /","PUT /","DELETE /","CONNECT /","TRACE /",NULL };
|
const char *http_methods[] = { "GET /","POST /","HEAD /","OPTIONS ","PUT /","DELETE /","CONNECT ","TRACE /",NULL };
|
||||||
const char *HttpMethod(const uint8_t *data, size_t len)
|
const char *HttpMethod(const uint8_t *data, size_t len)
|
||||||
{
|
{
|
||||||
const char **method;
|
const char **method;
|
||||||
|
|||||||
+1
-1
@@ -151,7 +151,7 @@ void ResolveMultiPos(const uint8_t *data, size_t sz, t_l7proto l7proto, const st
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char *http_methods[] = { "GET /","POST /","HEAD /","OPTIONS /","PUT /","DELETE /","CONNECT /","TRACE /",NULL };
|
const char *http_methods[] = { "GET /","POST /","HEAD /","OPTIONS ","PUT /","DELETE /","CONNECT ","TRACE /",NULL };
|
||||||
const char *HttpMethod(const uint8_t *data, size_t len)
|
const char *HttpMethod(const uint8_t *data, size_t len)
|
||||||
{
|
{
|
||||||
const char **method;
|
const char **method;
|
||||||
|
|||||||
@@ -711,10 +711,12 @@ void parse_params(int argc, char *argv[])
|
|||||||
while ((v = getopt_long_only(argc, argv, "", long_options, &option_index)) != -1)
|
while ((v = getopt_long_only(argc, argv, "", long_options, &option_index)) != -1)
|
||||||
{
|
{
|
||||||
if (v)
|
if (v)
|
||||||
|
{
|
||||||
if (bDry)
|
if (bDry)
|
||||||
exit_clean(1);
|
exit_clean(1);
|
||||||
else
|
else
|
||||||
exithelp_clean();
|
exithelp_clean();
|
||||||
|
}
|
||||||
switch (option_index)
|
switch (option_index)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|||||||
Reference in new issue
Block a user