简体   繁体   English

是否可以从 Python 读取 Windows 中的防火墙规则?

[英]Is it possible to read firewall rules in Windows from Python?

I am making an auditing type tool and I want to pull the firewall rules of the computer.我正在制作一个审计类型的工具,我想提取计算机的防火墙规则。 I am using Python and I can only find sources on how to add rules to the firewall, but not read them.我正在使用 Python,我只能找到有关如何向防火墙添加规则的来源,但无法阅读它们。 Is this possible?这可能吗?

i'm not using python that's why i can't help you with coding, but as everything in windows, firewall rules are storing in registry too, firewall rules are storing under;我没有使用 python 这就是为什么我不能帮助你编码,但是作为 Windows 中的所有东西,防火墙规则也存储在注册表中,防火墙规则存储在下面;

HKLM\System\CurrentlControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules.

I believe if you can read windows registry with python,then you can read the rules.我相信如果您可以使用python读取Windows注册表,那么您就可以阅读规则。

Detailed source : https://schatzforensic.com/insideout/2014/12/was-the-firewall-blocking-traffic-identifying-active-firewall-rules-using-registry-analysis/#:~:text=The%20firewall%20rules%20are%20stored,%5CParameters%5CFirewallPolicy%5CFirewallRules.详细来源: https : //schatzforensic.com/insideout/2014/12/was-the-firewall-blocking-traffic-identifying-active-firewall-rules-using-registry-analysis/# :~: text=The%20firewall %20rules%20are%20stored,%5CParameters%5CFirewallPolicy%5CFirewallRules。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM