9

I applied a Windows firewall rule that blocks all tcp connection and thus kicked myself out of remote desktop on a dedicated server. I managed to get into recovery via VNC, which is basically a windows xp recovery system.

I have access to the physical files of the Windows Server 2008 R2 installation, but I don't know how to disable the firewall so I can reboot from recovery and connect to the W2K8 via remote desktop.

How can I edit the firewall properties of Windows Server 2008 while the OS is essentially powered off and I have filesystem access to the system files?

4 Answers 4

16

You can disable Windows Firewall using the Registry; the relevant settings are in

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy

Under there, you will find three keys: DomainProfile, PublicProfile and StandardProfile; each of them contains a value called EnableFirewall, which controls the firewall state for that profile. If you set all three values to 0, Windows Firewall will be completely disabled.

If you want to do this for an offline system, you'll need to load that system's Registry into Regedit; the file to load is C:\Windows\System32\config\SYSTEM. You'll also need to find the right ControlSet to configure, because CurrentControlSet is only available at runtime; when operating on an offline Registry, you'll need to choose the correct one between the various ControlSet00x you'll find under HKEY_LOCAL_MACHINE\SYSTEM. HKEY_LOCAL_MACHINE\SYSTEM\Select can help you here.

1
  • I wish I'd seen this two years ago. Great answer! Thanks.
    – Kul-Tigin
    Aug 6, 2014 at 18:13
0

It's possible to remotely disable Windows firewall using the Psexec:

psexec \\ComputerHostnameOrIp cmd

The above command assumes you are a network admin, or you can specify a username and password too:

PsExec.exe \\IP cmd -u username -p password

Now Psexec lets you to run commands on a remote computer, such as the following command which disables the firewall

netsh advfirewall set currentprofile state off
-1

Go to Control Panel and then open the Windows Firewall. Under Windows Firewall page click on “Turn Windows Firewall on or off” option. Then, turn off the firewall for both public and private network.

1
  • 1
    His system isn't running...
    – Massimo
    Mar 19, 2012 at 20:10
-1

From command line (run as administrator), netsh advfirewall set currentprofile state off

1
  • 3
    That would be good... on a running system :-)
    – Massimo
    Mar 19, 2012 at 20:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .