mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-26 12:10:53 +03:00
Compare commits
12 Commits
74b6281770
...
9e84bf7a42
Author | SHA1 | Date | |
---|---|---|---|
|
9e84bf7a42 | ||
|
4559169e78 | ||
|
1987209613 | ||
|
913372a574 | ||
|
0ea4709726 | ||
|
9eef0ca113 | ||
|
88d7fd4088 | ||
|
1144f9afdc | ||
|
380d104407 | ||
|
31d4eaaa14 | ||
|
b2f94b083c | ||
|
4bdce508af |
@ -355,3 +355,7 @@ config: <HOSTLIST_NOAUTO> marker
|
|||||||
binaries: remove zapret-winws. add win32.
|
binaries: remove zapret-winws. add win32.
|
||||||
blockcheck, install_easy.sh: preserve user environment variables during elevation
|
blockcheck, install_easy.sh: preserve user environment variables during elevation
|
||||||
blockcheck: do not require root if SKIP_PKTWS=1
|
blockcheck: do not require root if SKIP_PKTWS=1
|
||||||
|
|
||||||
|
v68:
|
||||||
|
|
||||||
|
readme.md : move russian version to markdown
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
# Multilanguage README
|
||||||
|
___
|
||||||
|
[![en](https://img.shields.io/badge/lang-en-red.svg)](https://github.com/bol-van/zapret/tree/master/docs/readme.en.md)
|
||||||
|
[![ru](https://img.shields.io/badge/lang-ru-green.svg)](https://github.com/bol-van/zapret/tree/master/docs/readme.md)
|
||||||
|
|
||||||
|
|
||||||
## What is it for
|
## What is it for
|
||||||
|
|
||||||
A stand-alone (without 3rd party servers) DPI circumvention tool.
|
A stand-alone (without 3rd party servers) DPI circumvention tool.
|
||||||
@ -149,7 +155,7 @@ follows all standards. For example, we are routed to squid. Connection goes thro
|
|||||||
## nfqws
|
## nfqws
|
||||||
|
|
||||||
This program is a packet modifier and a NFQUEUE queue handler.
|
This program is a packet modifier and a NFQUEUE queue handler.
|
||||||
For BSD systems there is dvtws. Its built from the same source and has almost the same parameters (see bsd.eng.md).
|
For BSD systems there is dvtws. Its built from the same source and has almost the same parameters (see bsd.en.md).
|
||||||
nfqws takes the following parameters:
|
nfqws takes the following parameters:
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -302,7 +308,7 @@ Split mode is very similar to disorder but without segment reordering :
|
|||||||
|
|
||||||
Mode `split2` disables sending of fake segments. It can be used as a faster alternative to --wsize.
|
Mode `split2` disables sending of fake segments. It can be used as a faster alternative to --wsize.
|
||||||
|
|
||||||
In `disorder2` and 'split2` modes no fake packets are sent, so ttl and fooling options are not required.
|
In `disorder2` and `split2` modes no fake packets are sent, so ttl and fooling options are not required.
|
||||||
|
|
||||||
`seqovl` adds to the first sent original segment (1st for split, 2nd for disorder) seqovl bytes to the beginning and decreases
|
`seqovl` adds to the first sent original segment (1st for split, 2nd for disorder) seqovl bytes to the beginning and decreases
|
||||||
sequence number.
|
sequence number.
|
||||||
@ -477,7 +483,7 @@ to extract the host name. But it works with auto hostlist profiles.
|
|||||||
`--dpi-desync-cutoff` allows you to set the threshold at which it stops applying dpi-desync.
|
`--dpi-desync-cutoff` allows you to set the threshold at which it stops applying dpi-desync.
|
||||||
Can be prefixed with 'n', 'd', 's' symbol the same way as `--wssize-cutoff`.
|
Can be prefixed with 'n', 'd', 's' symbol the same way as `--wssize-cutoff`.
|
||||||
Useful with `--dpi-desync-any-protocol=1`.
|
Useful with `--dpi-desync-any-protocol=1`.
|
||||||
If the connection falls out of the conntrack and --dpi-desync-cutoff is set, dpi desync will not be applied.
|
If the connection falls out of the conntrack and `--dpi-desync-cutoff` is set, `dpi desync` will not be applied.
|
||||||
|
|
||||||
Set conntrack timeouts appropriately.
|
Set conntrack timeouts appropriately.
|
||||||
|
|
||||||
@ -1274,11 +1280,11 @@ Now its possible to run `/data/local/tmp/zapret/tpws` from any app such as taske
|
|||||||
|
|
||||||
### FreeBSD, OpenBSD, MacOS
|
### FreeBSD, OpenBSD, MacOS
|
||||||
|
|
||||||
see docs/bsd.eng.md
|
see docs/bsd.en.md
|
||||||
|
|
||||||
### Windows (WSL)
|
### Windows (WSL)
|
||||||
|
|
||||||
see docs/windows.eng.md
|
see docs/windows.en.md
|
||||||
|
|
||||||
### Other devices
|
### Other devices
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
12
nfq/nfqws.c
12
nfq/nfqws.c
@ -552,14 +552,18 @@ static bool parse_ws_scale_factor(char *s, uint16_t *wsize, uint8_t *wscale)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __OpenBSD__
|
||||||
static void cleanup_args()
|
static void cleanup_args()
|
||||||
{
|
{
|
||||||
wordfree(¶ms.wexp);
|
wordfree(¶ms.wexp);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void cleanup_params(void)
|
static void cleanup_params(void)
|
||||||
{
|
{
|
||||||
|
#ifndef __OpenBSD__
|
||||||
cleanup_args();
|
cleanup_args();
|
||||||
|
#endif
|
||||||
|
|
||||||
ConntrackPoolDestroy(¶ms.conntrack);
|
ConntrackPoolDestroy(¶ms.conntrack);
|
||||||
|
|
||||||
@ -851,7 +855,9 @@ static unsigned int hash_jen(const void *data,unsigned int len)
|
|||||||
static void exithelp(void)
|
static void exithelp(void)
|
||||||
{
|
{
|
||||||
printf(
|
printf(
|
||||||
|
#ifndef __OpenBSD__
|
||||||
" @<config_file>|$<config_file>\t\t\t; read file for options. must be the only argument. other options are ignored.\n\n"
|
" @<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"
|
" --debug=0|1|syslog|@<filename>\n"
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
" --qnum=<nfqueue_number>\n"
|
" --qnum=<nfqueue_number>\n"
|
||||||
@ -982,6 +988,7 @@ bool parse_tlspos(const char *s, enum tlspos *pos)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __OpenBSD__
|
||||||
// no static to not allow optimizer to inline this func (save stack)
|
// no static to not allow optimizer to inline this func (save stack)
|
||||||
void config_from_file(const char *filename)
|
void config_from_file(const char *filename)
|
||||||
{
|
{
|
||||||
@ -1006,6 +1013,7 @@ void config_from_file(const char *filename)
|
|||||||
exit_clean(1);
|
exit_clean(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -1071,12 +1079,14 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __OpenBSD__
|
||||||
if (argc>=2 && (argv[1][0]=='@' || argv[1][0]=='$'))
|
if (argc>=2 && (argv[1][0]=='@' || argv[1][0]=='$'))
|
||||||
{
|
{
|
||||||
config_from_file(argv[1]+1);
|
config_from_file(argv[1]+1);
|
||||||
argv=params.wexp.we_wordv;
|
argv=params.wexp.we_wordv;
|
||||||
argc=params.wexp.we_wordc;
|
argc=params.wexp.we_wordc;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const struct option long_options[] = {
|
const struct option long_options[] = {
|
||||||
{"debug",optional_argument,0,0}, // optidx=0
|
{"debug",optional_argument,0,0}, // optidx=0
|
||||||
@ -1826,7 +1836,9 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// do not need args from file anymore
|
// do not need args from file anymore
|
||||||
|
#ifndef __OpenBSD__
|
||||||
cleanup_args();
|
cleanup_args();
|
||||||
|
#endif
|
||||||
argv=NULL; argc=0;
|
argv=NULL; argc=0;
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
#ifndef __OpenBSD__
|
||||||
#include <wordexp.h>
|
#include <wordexp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TLS_PARTIALS_ENABLE true
|
#define TLS_PARTIALS_ENABLE true
|
||||||
|
|
||||||
@ -96,7 +98,9 @@ bool dp_list_have_autohostlist(struct desync_profile_list_head *head);
|
|||||||
|
|
||||||
struct params_s
|
struct params_s
|
||||||
{
|
{
|
||||||
|
#ifndef __OpenBSD__
|
||||||
wordexp_t wexp; // for file based config
|
wordexp_t wexp; // for file based config
|
||||||
|
#endif
|
||||||
|
|
||||||
enum log_target debug_target;
|
enum log_target debug_target;
|
||||||
char debug_logfile[PATH_MAX];
|
char debug_logfile[PATH_MAX];
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#ifndef __OpenBSD__
|
||||||
#include <wordexp.h>
|
#include <wordexp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "tpws.h"
|
#include "tpws.h"
|
||||||
#include "pools.h"
|
#include "pools.h"
|
||||||
@ -81,7 +83,9 @@ void dp_list_destroy(struct desync_profile_list_head *head);
|
|||||||
|
|
||||||
struct params_s
|
struct params_s
|
||||||
{
|
{
|
||||||
|
#ifndef __OpenBSD__
|
||||||
wordexp_t wexp; // for file based config
|
wordexp_t wexp; // for file based config
|
||||||
|
#endif
|
||||||
|
|
||||||
int debug;
|
int debug;
|
||||||
enum log_target debug_target;
|
enum log_target debug_target;
|
||||||
|
12
tpws/tpws.c
12
tpws/tpws.c
@ -122,7 +122,9 @@ static int get_default_ttl(void)
|
|||||||
static void exithelp(void)
|
static void exithelp(void)
|
||||||
{
|
{
|
||||||
printf(
|
printf(
|
||||||
|
#ifndef __OpenBSD__
|
||||||
" @<config_file>|$<config_file>\t\t; read file for options. must be the only argument. other options are ignored.\n\n"
|
" @<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"
|
" --bind-addr=<v4_addr>|<v6_addr>\t; for v6 link locals append %%interface_name\n"
|
||||||
" --bind-iface4=<interface_name>\t\t; bind to the first ipv4 addr of interface\n"
|
" --bind-iface4=<interface_name>\t\t; bind to the first ipv4 addr of interface\n"
|
||||||
" --bind-iface6=<interface_name>\t\t; bind to the first ipv6 addr of interface\n"
|
" --bind-iface6=<interface_name>\t\t; bind to the first ipv6 addr of interface\n"
|
||||||
@ -215,13 +217,17 @@ static void exithelp(void)
|
|||||||
);
|
);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
#ifndef __OpenBSD__
|
||||||
static void cleanup_args()
|
static void cleanup_args()
|
||||||
{
|
{
|
||||||
wordfree(¶ms.wexp);
|
wordfree(¶ms.wexp);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
static void cleanup_params(void)
|
static void cleanup_params(void)
|
||||||
{
|
{
|
||||||
|
#ifndef __OpenBSD__
|
||||||
cleanup_args();
|
cleanup_args();
|
||||||
|
#endif
|
||||||
|
|
||||||
dp_list_destroy(¶ms.desync_profiles);
|
dp_list_destroy(¶ms.desync_profiles);
|
||||||
|
|
||||||
@ -364,6 +370,7 @@ static bool parse_pf_list(char *opt, struct port_filters_head *pfl)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __OpenBSD__
|
||||||
// no static to not allow optimizer to inline this func (save stack)
|
// no static to not allow optimizer to inline this func (save stack)
|
||||||
void config_from_file(const char *filename)
|
void config_from_file(const char *filename)
|
||||||
{
|
{
|
||||||
@ -388,6 +395,7 @@ void config_from_file(const char *filename)
|
|||||||
exit_clean(1);
|
exit_clean(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void parse_params(int argc, char *argv[])
|
void parse_params(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -427,12 +435,14 @@ void parse_params(int argc, char *argv[])
|
|||||||
dp = &dpl->dp;
|
dp = &dpl->dp;
|
||||||
dp->n = ++desync_profile_count;
|
dp->n = ++desync_profile_count;
|
||||||
|
|
||||||
|
#ifndef __OpenBSD__
|
||||||
if (argc>=2 && (argv[1][0]=='@' || argv[1][0]=='$'))
|
if (argc>=2 && (argv[1][0]=='@' || argv[1][0]=='$'))
|
||||||
{
|
{
|
||||||
config_from_file(argv[1]+1);
|
config_from_file(argv[1]+1);
|
||||||
argv=params.wexp.we_wordv;
|
argv=params.wexp.we_wordv;
|
||||||
argc=params.wexp.we_wordc;
|
argc=params.wexp.we_wordc;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const struct option long_options[] = {
|
const struct option long_options[] = {
|
||||||
{ "help",no_argument,0,0 },// optidx=0
|
{ "help",no_argument,0,0 },// optidx=0
|
||||||
@ -1133,8 +1143,10 @@ void parse_params(int argc, char *argv[])
|
|||||||
IpsetsDebug();
|
IpsetsDebug();
|
||||||
VPRINT("\n");
|
VPRINT("\n");
|
||||||
|
|
||||||
|
#ifndef __OpenBSD__
|
||||||
// do not need args from file anymore
|
// do not need args from file anymore
|
||||||
cleanup_args();
|
cleanup_args();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user