WFP Traffic Redirection Driver is used to redirect NIC traffic on network layer and framing layer, based on Windows Filtering Platform (WFP).
This project is forked from Windows Filtering Platform Traffic Inspection Sample.
- Flexible & configurable
- Anti traffic sniffing (WinPcap/Npcap/Rawsock Sniffing)
- Visual Studio 2017
- Windows Driver Kit 10
- Build
.vcxproj
in Visual Studio on host computer - Enable test signing on target computer
- Install
.cer
(Certificate) and.inf
(Driver Config) on target computer
For more, see Windows Filtering Platform Traffic Inspection Sample.
Setup values under the key:
HKLM\System\CurrentControlSet\Services\inspect\Parameters
All values are shown in the following table:
Value | Type | Example |
---|---|---|
LocalRealAddress | REG_SZ | 10.109.16.202 |
LocalFakeAddress | REG_SZ | 10.109.19.108 |
RemoteRealAddress | REG_SZ | 10.109.18.799 |
RemoteFakeAddress | REG_SZ | 10.109.17.253 |
LocalRealPort | REG_DWORD | 80 |
LocalFakePort | REG_DWORD | 202 |
RemoteRealPort | REG_DWORD | 80 |
RemoteFakePort | REG_DWORD | 799 |
LocalEthernetAddress | REG_SZ | 74-27-ea-00-00-02 |
RemoteEthernetAddress | REG_SZ | 74-27-ea-00-00-03 |
Note that:
- Address, Port and EthernetAddress stand for IP address, TCP/UDP port and ethernet MAC address respectively.
- Local means src of outbound / dst of inbound traffic, while Remote means dst of outbound / src of inbound traffic.
- For outbound traffic, Real address/port are replaced with Fake; for inbound traffic, Fake address/port are restored by Real.
- Config cascade:
- Port values are used at network layer only if enabling RemoteAddress modification.
- Value
LocalEthernetAddress
andRemoteEthernetAddress
are used for outbound traffic at framing layer only if enabling LocalAddress modification.
- Setting value of zero (
0.0.0.0
/0
/00-00-00-00-00-00
) will disable address/port modification.
- Run
net start inspect
as administrator to start the driver service - Run
net stop inspect
as administrator to stop the driver service
Key ideas are posted by BOT Man in Chinese:
tl_drv.c
: entry and initprotocol-headers.h
: Ethernet/IPv4/ICMP/TCP/UDP headerinspect.h/c
: handle classification/reinjection logicutil.h/c
: helper functionsinspect.inf
: driver config
- enable-promisc: enable Promisc Mode on all NICs (based on wpcap)
enable-promisc.exe
: calling pcap_findalldevs_exwpcap.dll
: modified pcap_activate_win32
check-promisc.ps1
: check if all NICs in Promisc Moderestart-nic.bat
: restart NIC以太网
enable-dbgprint.reg
: enabledbgprint
on DbgView (use once)enable-testsigning.bat:
enable test signing (use once)
Copyright (C) 2018 BOT Man
GPL-3.0 License