Like `iptables` table for linux, is there any plan...
# general
z
Like
iptables
table for linux, is there any plan to build a table for windows systems ?
s
Does windows have something like
iptables
?
z
Nope, but at least I am looking for something which helps me find the firewall open ports in windows..
s
Does windows have any tooling or APIs to display it?
I think osquery would happily accept a PR with this functionality. But I don't know anyone working on one
z
This thread could help: https://serverfault.com/questions/207620/windows-equivalent-of-iptables In windows there is something called
netsh advfirewall
, maybe this can be a good API to use for osquery to develop a table in this regard..
s
The ToB extension is a wrapper around netsh
z
The table
PortBlacklist
only allows us to know if a port is blocked, and also I am not willing to manage port blocking or unblocking. I just need to know the open ports. That's it.
s
These rules are all held in the registry, it should be relatively straightforward to parse them. The major complication is that Windows applies different policies depending if it is on a public, private, or domain-joined network
z
I am potentially looking at a power shell script:
Copy code
$fw = New-Object -ComObject HNetCfg.FWPolicy2 
$fw.Rules | where {$_.Enabled -like $true} | Format-Table LocalPorts
Will this be able to find all the rules that are held in registry ?
s
Not sure. I believe the rules are in
HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules
but I don’t have a Windows machine to verify with at the moment
z
Thanks, will check it!