Coder Social home page Coder Social logo

wtf-wfp's Introduction

What The Filter is Going on with Windows Filtering Platform

WTF-WFP is a lightweight, easy to use, PowerShell module that helps you debug and analyze the Windows Filtering Platform. The advantage WTF-WFP has is that it enables one to understand the WFP without familiarizing oneself too much with the WFP API.

Quick Start

WTF-WFP utilizes NtObjectManager to access the WFP APIs (and a bunch of other helpful functions it exposes). To install, simply run the following from an elevated PowerShell shell:

Install-Module -Name NtObjectManager
Install-Module wtf-wfp

Now the Get-WFPInfo command should be available. You can validate and get more info via the help command:

Get-Help Get-WFPInfo

To start analyzing the WFP, select which network interface you wish to analyze, for which protocol, and in which direction (inbound or outbound). There are additional parameters, but these ones are the most basic which will probably give you most of the infromation you need. Here are a couple of examples:

To get filters for inbound Udp traffic for local IPv4 10.0.0.1

Get-WFPInfo -inbound -localAddress 10.0.0.1 -protocolType Udp

To get filters for outbound Tcp traffic from address IPv4 10.0.0.1 towards 172.16.5.5 for remote port 3389, and also save the WFP data into csv

Get-WFPInfo -outbound -localAddress 10.0.0.1 -protocolType Tcp -remoteAddress 172.16.5.5 -remotePort 3389 -csvPath "c:\wfp.csv"

Activate a trace for inbound SMB traffic, to see which filters block it:

Get-WFPInfo -inbound -localAddress 10.0.0.1 -protocolType Tcp -localPort 445 -netTrace

Note: MS Defender may alert on NtObjectManager, so you may need to turn off real time protection / set the PS Gallery as trusted / create exclusion for the module.

Parameters

Taken from the help menu:

PARAMETERS
   -inbound [<SwitchParameter>]
       Enumerates only inbound filters for the AUTH_RECV_ACCEPT_V4/6 ALE layer.

   -outbound [<SwitchParameter>]
       Enumerates only outbound filters for the AUTH_CONNECT_V4/6 ALE layer.

   -protocolType
       Enumerates only filters that match the provided protocol

   -localAddress <IPAddress>
       If included, only enumerates filters that match the specific local address, the IP family, and the local NIC

   -remoteAddress <IPAddress>
       If included, only enumerates filters that match the specific remote address.

   -localport <UInt16>
       If included, only enumerates filters that match the specific local port.

   -remoteport <UInt16>
       If included, only enumerates filters that match the specific remote port.

   -conditionFlag <UInt32>
       If included, enumerates filters using FWP_CONDITION_FLAG bitmap

   -csvPath <String>
       If included, saves the matching filters into a the given path in CSV format

   -showAppContainerFilters [<SwitchParameter>]
       As long as not present, results do not include filters that are App Container specific

   -detailed [<SwitchParameter>]
       Prints detailed info about each filter

   -netTrace [<SwitchParameter>]
       Waits for the user to recreate network issue while activating the WFP trace. The matched traced events a printed to the output, along with the filters that matched.

   -addTraceFilters [<SwitchParameter>]
       Add a match-all permit filter at each relevant filtering layer.

   -allLayers [<SwitchParameter>]
       When present, prints more filters at different layers, depending on the inbound/outbound params.

โ€ƒ```

wtf-wfp's People

Contributors

sagiesec avatar azsundevil avatar polina-b avatar milmanronv 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.