Windows

Verificando as regras de firewall do perfil atual:

netsh advfirewall show currentprofile

Verificando todas as regras de firewall:

netsh advfirewall firewall show rule name=all

Adicionando determinado arquivo com extensão exe nas regras do firewall

netsh advfirewall firewall add rule name="<nome_regra" dir=in action=allow program="C:\{arquivo.exe}"

Verificando configurações

netsh firewall show state
netsh firewall show config

Verificando status

netsh advfirewall show currentprofile

Caso o State do comando acima esteja ON, podemos verificar as regras de firewall

netsh advfirewall firewall show rule name=all

Desabilitando firewall de todos os perfis com Powershell.

# Powershell
Set-NetFirewallProfile -Name Domain,Private,Public -Enabled False

# Prompt de Comando (netsh)
netsh advfirewall set allprofiles state off

Windows Defender

# Habilitando
Set-MpPreference -DisableRealtimeMonitoring $false

# Desabilitando
Set-MpPreference -DisableRealtimeMonitoring $true

Last updated