GithubHelp home page GithubHelp logo

fcccode / wfp-traffic-redirection-driver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bot-man-jl/wfp-traffic-redirection-driver

0.0 0.0 0.0 405 KB

WFP Traffic Redirection Driver is used to redirect NIC traffic on network layer and framing layer, based on Windows Filtering Platform (WFP).

Home Page: https://bot-man-jl.github.io/articles/?post=2018/Anonymous-Communication-Client-Design

License: GNU General Public License v3.0

PowerShell 0.08% Batchfile 0.35% C 99.57%

wfp-traffic-redirection-driver's Introduction

WFP Traffic Redirection Driver

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.

Features

  • Flexible & configurable
  • Anti traffic sniffing (WinPcap/Npcap/Rawsock Sniffing)

How to build/deploy

Requirements

  • Visual Studio 2017
  • Windows Driver Kit 10

Steps to build/deploy

  1. Build .vcxproj in Visual Studio on host computer
  2. Enable test signing on target computer
  3. Install .cer (Certificate) and .inf (Driver Config) on target computer

For more, see Windows Filtering Platform Traffic Inspection Sample.

How to use

Setup Registries

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 and RemoteEthernetAddress 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.

Start/Stop driver

  • Run net start inspect as administrator to start the driver service
  • Run net stop inspect as administrator to stop the driver service

Internals

Key ideas are posted by BOT Man in Chinese:

./sys

  • tl_drv.c: entry and init
  • protocol-headers.h: Ethernet/IPv4/ICMP/TCP/UDP header
  • inspect.h/c: handle classification/reinjection logic
  • util.h/c: helper functions
  • inspect.inf: driver config

./helpers

  • enable-promisc: enable Promisc Mode on all NICs (based on wpcap)
    • enable-promisc.exe: calling pcap_findalldevs_ex
    • wpcap.dll: modified pcap_activate_win32
  • check-promisc.ps1: check if all NICs in Promisc Mode
  • restart-nic.bat: restart NIC 以太网
  • enable-dbgprint.reg: enable dbgprint on DbgView (use once)
  • enable-testsigning.bat: enable test signing (use once)

License

Copyright (C) 2018 BOT Man

GPL-3.0 License

wfp-traffic-redirection-driver's People

Contributors

bot-man-jl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.