From 3e724c381065ba6eee72cdb6a5465f3509680d66 Mon Sep 17 00:00:00 2001 From: bol-van Date: Mon, 12 Jan 2026 10:03:35 +0300 Subject: [PATCH] update docs --- docs/manual.en.md | 39 ++++++++++++++++++++++++++++++++------- docs/manual.md | 40 +++++++++++++++++++++++++++++++++------- 2 files changed, 65 insertions(+), 14 deletions(-) diff --git a/docs/manual.en.md b/docs/manual.en.md index 89fffe9..6a4c1db 100644 --- a/docs/manual.en.md +++ b/docs/manual.en.md @@ -15,6 +15,7 @@ - [nfqws2](#nfqws2) - [General principles for setting parameters](#general-principles-for-setting-parameters) - [Full list of options](#full-list-of-options) + - [Protocol detection](#protocol-detection) - [Using multiple profiles](#using-multiple-profiles) - [Profile templates](#profile-templates) - [Filtering by lists](#filtering-by-lists) @@ -634,7 +635,7 @@ MULTI-STRATEGY: --filter-l3=ipv4|ipv6 ; profile filter: IP protocol version --filter-tcp=[~]port1[-port2]|* ; profile filter: TCP ports or port ranges (comma-separated) --filter-udp=[~]port1[-port2]|* ; profile filter: UDP ports or port ranges (comma-separated) - --filter-l7=proto[,proto] ; profile filter: list of application-layer protocols. A full list is available in the program's help text. + --filter-l7=proto[,proto] ; profile filter: list of application-layer protocols --ipset= ; profile filter: inclusion list of IP addresses or subnets from a file (supports mixed IPv4/IPv6) --ipset-ip= ; profile filter: fixed inclusion list of IP addresses or subnets (comma-separated) --ipset-exclude= ; profile filter: exclusion list of IP addresses or subnets from a file (supports mixed IPv4/IPv6) @@ -655,7 +656,7 @@ MULTI-STRATEGY: --hostlist-auto-debug= ; auto-list debug log LUA PACKET PASS MODE: - --payload=type[,type] ; in-profile filter: payload filter for subsequent instances within the profile. A list of payloads is available in the program's help text. + --payload=type[,type] ; in-profile filter: payload filter for subsequent instances within the profile --out-range=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)] ; in-profile filter: conntrack counter range for subsequent instances within the profile - outgoing direction --in-range=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)] ; in-profile filter: conntrack counter range for subsequent instances within the profile - incoming direction @@ -703,6 +704,30 @@ LOGICAL NETWORK FILTER: --nlm-list[=all] ; display a list of connected NLM networks. "all" shows all NLM networks. ``` +## Protocol detection + +nfqws2 signatures the payload types of individual packets or groups of packets. +All packets without data have payload empty, undetected - unknown. +The flow protocol is assigned after receiving the first known payload and remains with the flow for the rest of its existence. +In this case, subsequent payloads can have both a known type and an unknown one. +In payload and flow protocol filters special values are available - "all" and "known". "all" means any, "known" - not "empty" and not "unknown". + +Table of recognizable payload types and flow protocols + +| flow protocol | L4 | payloads | +| :-------------- | :-- | :------- | +| http | tcp | http_req
http_reply | +| tls | tcp | tls_client_hello
tls_server_hello | +| xmpp | tcp | xmpp_stream
xmpp_starttls
xmpp_proceed
xmpp_features | +| quic | udp | quic_initial | +| wireguarв | udp | wireguard_initiation
wireguard_response
wireguard_cookie
wireguard_keepalive | +| dht | udp | dht | +| discord | udp | discord_ip_discovery | +| stun | udp | stun | +| dns | udp | dns_query dns_response | +| mtproto | udp | mtproto_initial | +| dtls | udp | dtls_client_hello
dtls_server_hello | + ## Using multiple profiles Profiles exist to select a specific traffic manipulation strategy based on the specified filter conditions. @@ -958,7 +983,7 @@ Direct file operations from Lua code are not recommended unless absolutely neces These come in three types: `--payload`, `--in-range`, and `--out-range`. Filter values remain active from the moment they are specified until the next override. -- `--payload=type1[,type2][,type2]...` accepts a comma-separated list of known payloads, "all", or "known". The list of known payloads is available in the `nfqws2` help text. The default is `--payload=all`. +- `--payload=type1[,type2][,type2]...` accepts a comma-separated list of known [payloads](#protocol-detection), "all", or "known". The default is `--payload=all`. - `--(in-range|out-range)=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)]` sets conntrack counter ranges for inbound and outbound directions. The default is `--in-range=x`, `--out-range=a`. Ranges are specified in the following formats: `mX-mY`, `mX ; фильтр профиля : включающий список ip адресов или подсетей из файла. может быть смешанным ipv4+ipv6. --ipset-ip= ; фильтр профиля : включающий фиксированный список ip адресов или подсетей через запятую --ipset-exclude= ; фильтр профиля : исключающий список ip адресов или подсетей из файла. может быть смешанным ipv4+ipv6. @@ -711,7 +712,7 @@ MULTI-STRATEGY: --hostlist-auto-debug= ; дебаг лог автолиста LUA PACKET PASS MODE: - --payload=type[,type] ; внутрипрофильный фильтр : фильтр пейлоада для последующих инстансов внутри профиля. список пейлоадов доступен в help тексте программы. + --payload=type[,type] ; внутрипрофильный фильтр : фильтр пейлоада для последующих инстансов внутри профиля --out-range=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)] ; внутрипрофильный фильтр : диапазон счетчиков conntrack для последующих инстансов внутри профиля - исходящее направление --in-range=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)] ; внутрипрофильный фильтр : диапазон счетчиков conntrack для последующих инстансов внутри профиля - входящее направление @@ -759,6 +760,30 @@ LOGICAL NETWORK FILTER: --nlm-list[=all] ; вывести список подключенных NLM сетей. all - список всех NLM сетей ``` +## Распознавание протоколов + +nfqws2 сигнатурно распознает типы пейлоадов отдельно взятых пакетов или групп пакетов. +Все пустые пакеты имеют пейлоад empty, неизвестные - unknown. +Протокол потока присваивается после получение первого известного пейлоада и остается с потоком до конца его существования. +При этом последующие пейлоады могут иметь как известный тип, так и неизвестный. +В фильтрах по пейлоаду и протоколу потока доступны специальные значения - all и known. All означает любой, known - не empty и не unknown. + +Таблица распознаваемых типов пейлоада и протоколов потока + +| Протокол потока | L4 | Пейлоады | +| :-------------- | :-- | :------- | +| http | tcp | http_req
http_reply | +| tls | tcp | tls_client_hello
tls_server_hello | +| xmpp | tcp | xmpp_stream
xmpp_starttls
xmpp_proceed
xmpp_features | +| quic | udp | quic_initial | +| wireguarв | udp | wireguard_initiation
wireguard_response
wireguard_cookie
wireguard_keepalive | +| dht | udp | dht | +| discord | udp | discord_ip_discovery | +| stun | udp | stun | +| dns | udp | dns_query dns_response | +| mtproto | udp | mtproto_initial | +| dtls | udp | dtls_client_hello
dtls_server_hello | + ## Использование множественных профилей Профили существуют, чтобы в зависимости от указанных условий фильтра выбрать ту или иную стратегию воздействия на трафик. @@ -1086,7 +1111,7 @@ Lua код выполняется с ограниченными правами, Они бывают трех видов - `--payload`, `--in-range`, `--out-range`. Значения фильтров действуют с момента их указания до следующего переопределения. -- `--payload=type1[,type2][,type2]...` принимает список известных пейлоадов через зяпятую, "all" или "known". Список известных пейлоадов доступен в help тексте nfqws2. По умолчанию `--payload=all`. +- `--payload=type1[,type2][,type2]...` принимает список известных пейлоадов через зяпятую, "all" или "known". [Список известных пейлоадов](#распознавание-протоколов). По умолчанию `--payload=all`. - `--(in-range|out-range)=[(n|a|d|s|p)](-|<)[(n|a|d|s|p)]` задает диапазоны счетчиков conntrack по входящему и исходящему направлениям. По умолчанию `--in-range=x`, `--out-range=a`. Диапазоны задаются в формах : `mX-mY`, `mX