I have a problem where I know I will be given an unpatched windows box lets say its a XP and a windows 7.
They will not be connected to the internet so I want to write a script that will use netsh to block all ports, but the ones I must have open example will be port 80 and RDP 3389 along with a dns so 53.
example I know the rules to allow out and in will look like this.
netsh advfirewall firewall>
Add rule name="default rule" dir=out protocol=udp localport=5000-10000 action=block
netsh firewall> add portopening ALL 5000-10000 badports DISABLE
This will block all ports going out from 5000-10000 but I want to block all ports above X or I want to pass a list of ports I do want. a script that will take a small list I can edit and will add rules to block all out going BESIDES those three or four ports.
If more info is needed I will be happy to update my question.