/ _ \ \_\(_)/_/ _//"\\_ more on JOHLEM.net / \ 0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0 Firewall Management Commands: ------------------------------ 1. **Get-NetFirewallProfile** Display the status and settings of the firewall profiles (Domain, Private, Public). Syntax: Get-NetFirewallProfile 2. **Set-NetFirewallProfile** Configure the firewall settings for a specific profile. Syntax: Set-NetFirewallProfile -Profile Domain,Private,Public -Enabled True Example: Set-NetFirewallProfile -Profile Public -Enabled False 3. **Get-NetFirewallRule** List all firewall rules, or filter by specific criteria. Syntax: Get-NetFirewallRule Example: Get-NetFirewallRule -DisplayName "Remote Desktop" 4. **New-NetFirewallRule** Create a new firewall rule to allow or block traffic. Syntax: New-NetFirewallRule -DisplayName "Allow Web Traffic" -Direction Inbound -Protocol TCP -LocalPort 80,443 -Action Allow Example: New-NetFirewallRule -DisplayName "Block Telnet" -Direction Inbound -Protocol TCP -LocalPort 23 -Action Block 5. **Remove-NetFirewallRule** Remove an existing firewall rule by name. Syntax: Remove-NetFirewallRule -DisplayName "RuleName" Example: Remove-NetFirewallRule -DisplayName "Allow Web Traffic" 6. **Enable-NetFirewallRule** Enable an existing firewall rule. Syntax: Enable-NetFirewallRule -DisplayName "RuleName" Example: Enable-NetFirewallRule -DisplayName "Allow Web Traffic" 7. **Disable-NetFirewallRule** Disable an existing firewall rule. Syntax: Disable-NetFirewallRule -DisplayName "RuleName" Example: Disable-NetFirewallRule -DisplayName "Allow Web Traffic" 8. **Get-NetFirewallPortFilter** Display all firewall rules that apply to a specific port. Syntax: Get-NetFirewallPortFilter -Protocol TCP -LocalPort 80 9. **Set-NetFirewallRule** Modify an existing firewall rule. Syntax: Set-NetFirewallRule -DisplayName "Allow Web Traffic" -Direction Outbound Example: Set-NetFirewallRule -DisplayName "Allow Web Traffic" -Direction Inbound -Action Block 10. **Get-NetFirewallApplicationFilter** Display all firewall rules that apply to a specific application. Syntax: Get-NetFirewallApplicationFilter -Program "C:\Path\To\Application.exe" 11. **New-NetFirewallRule** for Program Create a new firewall rule to allow or block a specific application. Syntax: New-NetFirewallRule -DisplayName "Allow App" -Direction Inbound -Program "C:\Path\To\Application.exe" -Action Allow 12. **Get-NetFirewallAddressFilter** Display all firewall rules that apply to a specific IP address or range. Syntax: Get-NetFirewallAddressFilter -RemoteAddress "192.168.1.0/24" 13. **New-NetFirewallRule** with IP Address Create a new firewall rule to allow or block traffic from specific IP addresses. Syntax: New-NetFirewallRule -DisplayName "Block IP Range" -Direction Inbound -RemoteAddress "192.168.1.0/24" -Action Block 14. **Get-NetFirewallSecurityFilter** Display firewall rules that apply to specific security criteria, such as authentication or encryption requirements. Syntax: Get-NetFirewallSecurityFilter 15. **New-NetIPsecQuickModeCryptoSet** (Advanced) Configure advanced security settings for IPsec rules. Syntax: New-NetIPsecQuickModeCryptoSet -Name "SecureSet" -Integrity ESP -Encryption AES128 16. **Get-NetFirewallSetting** Display general firewall settings, such as logging options. Syntax: Get-NetFirewallSetting 17. **Set-NetFirewallSetting** Configure general firewall settings, such as enabling logging. Syntax: Set-NetFirewallSetting -LoggingAllowed True 18. **Get-NetFirewallInterfaceFilter** Display firewall rules that apply to specific network interfaces. Syntax: Get-NetFirewallInterfaceFilter -InterfaceAlias "Ethernet" 19. **New-NetFirewallRule** for Interface Create a firewall rule that applies to a specific network interface. Syntax: New-NetFirewallRule -DisplayName "Allow Traffic on Ethernet" -InterfaceAlias "Ethernet" -Action Allow 20. **New-NetFirewallRule** with Logging Create a firewall rule and enable logging for it. Syntax: New-NetFirewallRule -DisplayName "Log HTTP Traffic" -Protocol TCP -LocalPort 80 -Action Allow -LogFile "C:\FirewallLogs\HTTP.log" +----------------------------------------------------------+ | Note: Firewall management commands allow for granular | | control of inbound and outbound traffic, filtering| | by ports, programs, IP addresses, and interfaces, | | with options for advanced security configurations.| +----------------------------------------------------------+