Skip to content

Instantly share code, notes, and snippets.

@dstreefkerk
dstreefkerk / Create-MitigationFirewallRules.ps1
Last active February 22, 2024 18:18
A script to automatically generate Windows Firewall with Advanced Security outbound rules to prevent malware from being able to dial home.
#Requires -Version 5 -Module NetSecurity -RunAsAdministrator
<#
.SYNOPSIS
Create-MitigationFirewallRules - Creates Windows Firewall rules to mitigate certain app whitelisting bypasses and to prevent command interpreters from accessing the Internet
.DESCRIPTION
A script to automatically generate Windows Firewall with Advanced Security outbound rules
to prevent malware from being able to dial home.
These programs will only be allowed to communicate to IP addresses within the private IPv4 RFC1918 ranges: