Firewall Command Prompt Access Cory

In Knowledge Base Blog by Cory

Run from GFI:
netsh advfirewall firewall set rule group=”Network Discovery” new enable=Yes
netsh advfirewall firewall set rule group=”File and Printer Sharing” new enable=Yes

Disable UAC: cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

Win7: netsh firewall set service type = remoteadmin mode = enable
Win10: netsh advfirewall firewall set rule group=”Windows Remote Management” new enable=yes

nice firewall commands
Run:RDP : netsh advfirewall firewall add rule name=”Open Port 3389″ dir=in action=allow protocol=TCP localport=3389

start

set network=192.168.5.0/24
netsh advfirewall firewall set rule name=”File and Printer Sharing (Echo Request – ICMPv4-In)” new enable=yes profile=Public,Private remoteip=%network%,LocalSubnet
netsh advfirewall firewall set rule name=”File and Printer Sharing (LLMNR-UDP-In)” new enable=yes profile=Public,Private remoteip=%network%,LocalSubnet
netsh advfirewall firewall set rule name=”File and Printer Sharing (NB-Datagram-In)” new enable=yes profile=Public,Private remoteip=%network%,LocalSubnet
netsh advfirewall firewall set rule name=”File and Printer Sharing (NB-Name-In)” new enable=yes profile=Public,Private remoteip=%network%,LocalSubnet
netsh advfirewall firewall set rule name=”File and Printer Sharing (NB-Session-In)” new enable=yes profile=Public,Private remoteip=%network%,LocalSubnet
netsh advfirewall firewall set rule name=”File and Printer Sharing (SMB-In)” new enable=yes profile=Public,Private remoteip=%network%,LocalSubnet

end

netsh advfirewall firewall show rule name=”File and Printer Sharing (Echo Request – ICMPv4-In)”
netsh advfirewall firewall set rule name=”File and Printer Sharing (Echo Request – ICMPv4-In)” new enable=yes profile=Public,Private remoteip=10.27.1.0/24,LocalSubnet

netsh advfirewall firewall show rule name=”File and Printer Sharing (LLMNR-UDP-In)”
netsh advfirewall firewall set rule name=”File and Printer Sharing (LLMNR-UDP-In)” new enable=yes profile=Public,Private remoteip=10.27.1.0/24,LocalSubnet

netsh advfirewall firewall show rule name=”File and Printer Sharing (NB-Datagram-In)”
netsh advfirewall firewall set rule name=”File and Printer Sharing (NB-Datagram-In)” new enable=yes profile=Public,Private remoteip=10.27.1.0/24,LocalSubnet

netsh advfirewall firewall show rule name=”File and Printer Sharing (NB-Name-In)”
netsh advfirewall firewall set rule name=”File and Printer Sharing (NB-Name-In)” new enable=yes profile=Public,Private remoteip=10.27.1.0/24,LocalSubnet

netsh advfirewall firewall show rule name=”File and Printer Sharing (NB-Session-In)”
netsh advfirewall firewall set rule name=”File and Printer Sharing (NB-Session-In)” new enable=yes profile=Public,Private remoteip=10.27.1.0/24,LocalSubnet

netsh advfirewall firewall show rule name=”File and Printer Sharing (SMB-In)”
netsh advfirewall firewall set rule name=”File and Printer Sharing (SMB-In)” new enable=yes profile=Public,Private remoteip=10.27.1.0/24,LocalSubnet