How bol-van/zapret-win-bundle works
This repository is a Windows deployment bundle for the zapret / zapret2 DPI-bypass tools. It is not a typical application codebase; it is mostly packaged binaries, batch launchers, shell scripts, and support files that assemble a user-mode traffic manipulator around the WinDivert driver.
1. Core runtime boundary
The central architectural boundary is between the Windows kernel and user space. WinDivert (WinDivert64.sys) captures and reinjects network packets, while winws.exe and winws2.exe run in user space and decide how to transform traffic to evade DPI.
2. Two parallel engines: zapret1 and zapret2
The repo ships two generations of the bypass engine:
• zapret-winws/ for the first engine, centered on winws.exe
• zapret-winws/ plus blockcheck/zapret2/ for the second engine, centered on winws2.exe
Both are packaged separately because they use different Lua logic, presets, and blockcheck flows.
3. Traffic-processing pipeline
The main data flow is:
Windows network traffic -> WinDivert driver -> winws / winws2 -> packet mangling rules -> reinjection onto the network.
The engine can rewrite, split, fake, or reorder packets depending on the chosen strategy, especially for TLS, QUIC, WireGuard, STUN, Discord media, and DHT traffic.
4. Rule logic and protocol knowledge in Lua
The lua/ directory is the policy layer. Scripts such as zapret-antidpi.lua, zapret-auto.lua, zapret-obfs.lua, and zapret-tests.lua contain the traffic classification and obfuscation behavior. This is the main place where protocol-specific bypass strategies live.
5. Embedded fake traffic payloads
The files/fake/ directories contain binary packet templates used as decoys or crafted protocol fragments. These include TLS ClientHello variants, QUIC initial packets, WireGuard initiation/response, STUN, DTLS, HTTP, and zero-filled blobs. They are part of the bypass mechanism, not sample data.
6. Strategy presets and interactive launchers
Files like preset1_example.cmd, preset2_example.cmd, and preset2_wireguard.cmd are launch entry points for specific bypass strategies. They sit above the engines and assemble the command-line arguments, filters, and options for a chosen scenario.
7. Service mode vs interactive mode
The service*.cmd scripts create and control Windows services for non-interactive startup, while the preset .cmd files are intended for manual, interactive runs. This is an important operational boundary: the same engine can run either as a foreground tool or as an autostart service.
8. Blockcheck subsystem for strategy discovery
blockcheck/ and blockcheck2/ are analysis toolchains used to detect what kind of DPI interference exists and which bypass method works. They are separate from the runtime bypass path and should be thought of as a diagnostics/probing subsystem.
9. Probing and test harnesses
Blockcheck uses shell scripts plus bundled tools like curl, mdig.exe, and ip2net.exe to generate and observe traffic patterns against target services. The blockcheck2.d/standard and custom directories define test suites for HTTP, TLS 1.2/1.3, QUIC, and other protocols.
10. Windows portability layers
The repo includes a minimal cygwin/ tree so the shell-based tooling can run on Windows. It also includes admin/elevation helpers such as elevator.exe and cygwin-admin.cmd, because many operations require administrator privileges to load the driver and manipulate traffic.
11. Platform-specific bundles
There are separate platform support folders:
• arm64/ for Windows 11+ ARM64
• win7/ for older Windows 7 / Server 2008 R2 compatibility
• windivert-hide/ for driver-related hiding/removal utilities
These folders reflect deployment constraints rather than separate products.
12. Operational dependencies and constraints
The architecture depends on:
• Windows x64 / ARM64 support
• WinDivert kernel driver
• elevated privileges
• sometimes testsigning mode or secure boot adjustments
• the Windows networking stack and, for some scenarios, service installation
The README’s antivirus warning matters because the driver-hooking model is behaviorally similar to security-sensitive software.
13. Overall architectural shape
At a high level, this repo is a packaged DPI-bypass platform with three layers:
• capture layer: WinDivert driver
• decision/action layer: winws / winws2 plus Lua and fake-packet assets
• orchestration/diagnostics layer: batch scripts, Cygwin shell scripts, blockcheck, and service installers
The key diagram should show these layers explicitly, with blockcheck separated from the live packet modification path.
Main entry points: winws.exe winws · winws2.exe winws2 · WinDivert64.sys WinDivert · blockcheck2.sh Blockcheck2
Components 19
Live bypass runtime
Windows packet-capture and traffic-mangling path used during actual DPI bypass.
- Windows traffic · Normal Windows network packets entering the bypass stack.
- WinDivert · Kernel capture/reinject boundary for intercepted packets.
zapret-winws/WinDivert64.sys - winws · First-generation packet mangler and reinjection engine.
zapret-winws/winws.exe - winws2 · Second-generation bypass engine with updated Lua and presets.
zapret-winws/winws2.exe
Launchers and services
Batch entry points that assemble arguments and start the runtime in manual or service mode.
- zapret1 presets · Interactive preset scripts that assemble command lines for winws.
zapret-winws/preset1_example.cmd - zapret2 presets · Interactive preset scripts for winws2 scenarios such as WireGuard.
zapret-winws/preset2_example.cmd - Service mode · Windows service create/start/stop scripts for unattended startup.
zapret-winws/service_create.cmd
Policy assets
Lua rule logic and bundled fake traffic payloads used by the engines.
- Lua policy · Protocol classification and obfuscation logic for the first engine.
zapret-winws/lua/zapret-antidpi.lua - Lua policy 2 · Updated policy layer used by the second engine and blockcheck2.
blockcheck/zapret2/lua/zapret-antidpi.lua - Fake payloads · Bundled crafted packet templates for decoy TLS, QUIC, WireGuard, STUN, and related traffic.
zapret-winws/files/quic_initial_www_google_com.bin - Fake payloads 2 · Expanded fake-traffic corpus used by blockcheck2 experiments.
blockcheck/zapret/files/fake/tls_clienthello_www_google_com.bin
Blockcheck
Probing and strategy-discovery toolchains separate from the live bypass path.
- Blockcheck · Shell-driven diagnostics flow for discovering effective bypass strategies.
blockcheck/zapret/blockcheck.sh - Blockcheck2 · Second-generation probing suite with standard and custom test sets.
blockcheck/zapret2/blockcheck2.sh - Test suites · Standard blockcheck2 scenarios for HTTP, TLS, QUIC, and multi-stage probing.
blockcheck/zapret2/blockcheck2.d/standard/10-http-basic.sh - Custom lists · User-selectable probe target lists for blockcheck2.
blockcheck/zapret2/blockcheck2.d/custom/list_http.txt
Windows support
Platform-specific installers, driver bundles, and portability helpers.
- Cygwin · Embedded POSIX-like runtime used to execute shell tooling on Windows.
cygwin/bin/bash.exe - Elevators · Admin/elevation helpers needed for driver and network operations.
tools/elevator.exe - Platform bundles · Architecture-specific driver and tooling bundles for ARM64 and Win7 compatibility.
arm64/WinDivert64.sys - Hide tools · Driver-related removal or hiding utilities packaged separately.
windivert-hide/Monkey64.sys
Connections 24
- Windows traffic → WinDivert: captures · Windows packets are intercepted at the driver boundary.
- WinDivert → winws: feeds · WinDivert supplies packets to the first user-space engine.
- WinDivert → winws2: feeds · WinDivert supplies packets to the second user-space engine.
- winws → Windows traffic: reinjects · Processed traffic is sent back to the network stack.
- winws2 → Windows traffic: reinjects · Processed traffic is sent back to the network stack.
- zapret1 presets → winws: launches · Interactive presets construct command lines for winws.
- zapret2 presets → winws2: launches · Interactive presets construct command lines for winws2.
- Service mode → winws: starts · Service scripts manage unattended startup for the runtime.
- Service mode → winws2: starts · Service scripts manage unattended startup for the runtime.
- Lua policy → winws: configures · Lua policy defines packet-classification and bypass behavior.
- Lua policy 2 → winws2: configures · Lua policy defines packet-classification and bypass behavior.
- Fake payloads → winws: supplies decoys · Binary templates provide crafted payloads for obfuscation.
- Fake payloads 2 → winws2: supplies decoys · Binary templates provide crafted payloads for obfuscation.
- Blockcheck → Lua policy: evaluates · Diagnostics probe strategy effectiveness against live interference.
- Blockcheck2 → Lua policy 2: evaluates · Diagnostics probe strategy effectiveness against live interference.
- Test suites → Blockcheck2: drives · Standard suites define the probe sequence for blockcheck2.
- Custom lists → Blockcheck2: drives · Custom lists provide target sets for blockcheck2 probes.
- Cygwin → Blockcheck: runs · Shell tooling depends on the bundled Cygwin runtime.
- Cygwin → Blockcheck2: runs · Shell tooling depends on the bundled Cygwin runtime.
- Elevators → Service mode: enables · Privilege helpers support service installation and driver operations.
- Platform bundles → WinDivert: packages · Platform-specific bundles ship matching driver and support binaries.
- Hide tools → WinDivert: manages · Auxiliary utilities operate on the bundled driver installation.
- Blockcheck → winws: profiles · Diagnostics output informs the runtime configuration.
- Blockcheck2 → winws2: profiles · Diagnostics output informs the runtime configuration.