mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-26 20:20:53 +03:00
Compare commits
6 Commits
0d0fe6060e
...
9fcd8f830e
Author | SHA1 | Date | |
---|---|---|---|
|
9fcd8f830e | ||
|
72d2450081 | ||
|
2ae426c7ab | ||
|
b44c697171 | ||
|
0d3b7b6542 | ||
|
a01505ca37 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0
binaries/win64/zapret-winws/autohostlist.txt
Normal file
0
binaries/win64/zapret-winws/autohostlist.txt
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1077,6 +1077,8 @@ nfqws и tpws могут сечь варианты 1-3, 4 они не распо
|
||||
Чтобы снизить вероятность ложных срабатываний, имеется счетчик ситуаций, похожих на блокировку.
|
||||
Если за определенное время произойдет более определенного их количества, хост считается заблокированным
|
||||
и заносится в autohostlist. По нему сразу же начинает работать стратегия по обходу блокировки.
|
||||
Если в процессе счета вебсайт отвечает без признаков блокировки, счетчик сбрасывается.
|
||||
Вероятно, это был временный сбой сайта.
|
||||
|
||||
На практике работа с данным режимом выглядит так.
|
||||
Первый раз пользователь заходит на сайт и получает заглушку, сброс соединения или броузер подвисает,
|
||||
|
20
nfq/desync.c
20
nfq/desync.c
@ -174,6 +174,22 @@ static void ctrack_stop_retrans_counter(t_ctrack *ctrack)
|
||||
}
|
||||
}
|
||||
|
||||
static void auto_hostlist_reset_fail_counter(const char *hostname)
|
||||
{
|
||||
if (hostname)
|
||||
{
|
||||
hostfail_pool *fail_counter;
|
||||
|
||||
fail_counter = HostFailPoolFind(params.hostlist_auto_fail_counters, hostname);
|
||||
if (fail_counter)
|
||||
{
|
||||
HostFailPoolDel(¶ms.hostlist_auto_fail_counters, fail_counter);
|
||||
DLOG("auto hostlist : %s : fail counter reset. website is working.\n", hostname);
|
||||
HOSTLIST_DEBUGLOG_APPEND("%s : fail counter reset. website is working.", hostname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return true if retrans trigger fires
|
||||
static bool auto_hostlist_retrans(t_ctrack *ctrack, uint8_t l4proto, int threshold)
|
||||
{
|
||||
@ -187,6 +203,7 @@ static bool auto_hostlist_retrans(t_ctrack *ctrack, uint8_t l4proto, int thresho
|
||||
{
|
||||
DLOG("req retrans : tcp seq %u not within the req range %u-%u. stop tracking.\n", ctrack->seq_last, ctrack->req_seq_start, ctrack->req_seq_end);
|
||||
ctrack_stop_retrans_counter(ctrack);
|
||||
auto_hostlist_reset_fail_counter(ctrack->hostname);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -550,6 +567,9 @@ static uint8_t dpi_desync_tcp_packet_play(bool replay, size_t reasm_offset, uint
|
||||
}
|
||||
if (bFail)
|
||||
auto_hostlist_failed(ctrack->hostname);
|
||||
else
|
||||
if (len_payload)
|
||||
auto_hostlist_reset_fail_counter(ctrack->hostname);
|
||||
if (tcphdr->th_flags & TH_RST)
|
||||
ConntrackClearHostname(ctrack); // do not react to further dup RSTs
|
||||
}
|
||||
|
@ -253,6 +253,21 @@ void tamper_out(t_ctrack *ctrack, uint8_t *segment,size_t segment_buffer_size,si
|
||||
if (params.oob) *split_flags |= SPLIT_FLAG_OOB;
|
||||
}
|
||||
|
||||
static void auto_hostlist_reset_fail_counter(const char *hostname)
|
||||
{
|
||||
if (hostname)
|
||||
{
|
||||
hostfail_pool *fail_counter;
|
||||
|
||||
fail_counter = HostFailPoolFind(params.hostlist_auto_fail_counters, hostname);
|
||||
if (fail_counter)
|
||||
{
|
||||
HostFailPoolDel(¶ms.hostlist_auto_fail_counters, fail_counter);
|
||||
VPRINT("auto hostlist : %s : fail counter reset. website is working.", hostname);
|
||||
HOSTLIST_DEBUGLOG_APPEND("%s : fail counter reset. website is working.", hostname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void auto_hostlist_failed(const char *hostname)
|
||||
{
|
||||
@ -331,10 +346,11 @@ void tamper_in(t_ctrack *ctrack, uint8_t *segment,size_t segment_buffer_size,siz
|
||||
// received not http reply. do not monitor this connection anymore
|
||||
VPRINT("incoming unknown HTTP data detected for hostname %s", ctrack->hostname);
|
||||
}
|
||||
if (bFail)
|
||||
auto_hostlist_failed(ctrack->hostname);
|
||||
if (bFail) auto_hostlist_failed(ctrack->hostname);
|
||||
|
||||
}
|
||||
if (!bFail) auto_hostlist_reset_fail_counter(ctrack->hostname);
|
||||
|
||||
}
|
||||
}
|
||||
ctrack->bTamperInCutoff = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user