How cagritaskn/goodbyedpi-turkey works
Project type and purpose
• This is a native, user‐mode network tool written in C that bypasses Deep Packet Inspection (DPI) on Windows. It is not a full‐stack web app but a systems/driver‐based utility (“GoodbyeDPI Turkey version”) that hooks into Windows networking via the open‐source WinDivert library to modify, redirect, or inject packets at line speed without VPN overhead.
File structure
• Root
• README.md, REVERT.md, LICENSE – documentation and legal notices
• .github – CI/workflow and issue templates
• Makefile (in src/) – build orchestration
• src/
• goodbyedpi.c / goodbyedpi.h – main dispatcher
• dnsredir.c/h – DNS‐redirection module
• ttltrack.c/h – TTL‐tracking module
• fakepackets.c/h – fake‐packet injection module
• blackwhitelist.c/h – allow/block list module
• service.c/h – Windows service wrapper
• utils/ – shared helper functions (string, hash table, I/O)
• External artifacts (not in tree) – WinDivert.dll, WinDivert64.sys driver files, CMD scripts for installation.
README for insights
• Describes two launch modes:
• Windows Service – auto‐start at boot (via service_install_*.cmd)
• Batch Script – one‐off execution (turkey_dnsredir.cmd)
• Describes six alternative “modes” for different ISPs / DPI strategies.
• Relies on WinDivert to capture & inject network packets in user mode.
Main components & their interactions
a. Components
1. Windows Service Launcher (service.c)
2. User‐Mode Controller / CLI (batch scripts)
3. WinDivert Driver (WinDivert64.sys / WinDivert.dll)
4. Packet‐Processing Engine (goodbyedpi.c)
5. DPI‐Bypass Modules:
– DNS Redirection (dnsredir)
– TTL Tracking (ttltrack)
– Fake Packet Injection (fakepackets)
– Black/Whitelist Filtering (blackwhitelist)
6. Utilities (utils/*)
7. External DNS Servers (Yandex, Cloudflare)
b. Relationships & Data Flow
• Control Flow: User runs .cmd → installs or starts Windows Service → Service loads goodbyedpi.exe
• Packet Flow: All outbound/inbound packets first hit the WinDivert driver → passed to goodbyedpi engine → routed into one (or more) DPI‐bypass modules → modified or re‐injected via WinDivert → reaches normal network stack or application.
• Modules can cooperate: e.g., dnsredir patches DNS queries, ttltrack stamps TTL on SYN/ACK, fakepackets injects dummy traffic to confuse passive DPI.
c. Architectural Patterns & Principles
– Modular decomposition: each bypass technique isolated in its own C module with a clear interface
– Single entry‐point dispatcher (goodbyedpi) that loads/chooses modules based on command‐line flags
– Separation of concerns: service wrapper vs. core logic vs. utilities
– Use of third‐party kernel intercept driver (WinDivert) as abstraction layer
d. Key technologies
– C99 / Win32 API / Windows Service API
– WinDivert (packet capture & injection)
– Makefile for build
– Batch scripts (.cmd) for installation & configuration
Detail
• Module as its own sub‐component, don’t collapse everything into “packet modifier.”
• Which utility libraries (utils) feed into all modules.