C# - How to chceck if external firewall is enabled?
Asked Answered
A

2

1

We want to use Cisco NAC and need to check if client Desktop has a firewall installed. This may be not the default Windows Firewall.

Is there some Windows registry key that can be checked?

Aweless answered 12/5, 2011 at 8:28 Comment(0)
D
1

For non-Windows firewalls, you can use WMI API to detect the presence of a firewall if it's registered with Windows.

Namespace = "Root\SecurityCenter2"  (might be "Root\SecurityCenter" on pre-vista)
Query = "SELECT * From FirewallProduct"

And you can use this little gem to detect if it's actually on or off.

For Windows Firewall detection, it's INetFwMgr and friends.

Dannydannye answered 12/5, 2011 at 9:36 Comment(0)
I
4

Maybe just check if you can establish connection, if you can't - display a message that user should check firewall if it's installed?

Incoercible answered 12/5, 2011 at 8:31 Comment(1)
Good idea, but this is not the case. It has to be done on client computer.Aweless
D
1

For non-Windows firewalls, you can use WMI API to detect the presence of a firewall if it's registered with Windows.

Namespace = "Root\SecurityCenter2"  (might be "Root\SecurityCenter" on pre-vista)
Query = "SELECT * From FirewallProduct"

And you can use this little gem to detect if it's actually on or off.

For Windows Firewall detection, it's INetFwMgr and friends.

Dannydannye answered 12/5, 2011 at 9:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.