PDA

View Full Version : SP2 Firewall exception for all ports against an IP


Dstrider
January 21st 05, 05:57 PM
How is it possible set to an exception that allows access to all ports on an
XP SP2 machine from a specific IP (or range of IPs)?

Matija Hrovat
January 21st 05, 08:29 PM
Hi,
I quite honestly don't know why would you do that ?
Just open the ports that you need and set the right scope to them.
With that said, here you have an example of a code that you could use

open notepad and copy the following text in and save as .vbs
To open a range of ports:
---------------------------------------------
Dim WSHShell, PortStart, PortStop
Set WSHShell = WScript.CreateObject("WScript.Shell")

PortStart = inputbox("The first port you want to open" , "Open a range of
ports")
PortStop = inputbox("The last port you want to open" , "Open a range of
ports")
for i = PortStart to PortStop

WSHShell.run ("netsh firewall add portopening protocol = all port = " & i &
" name = BLA" & i & " mode = enable scope = CUSTOM addresses = 1.1.1.1")
next
---------------------------------------------

To delete a range of ports:
---------------------------------------------
Dim WSHShell, PortStart, PortStop
Set WSHShell = WScript.CreateObject("WScript.Shell")

PortStart = inputbox("The first port you want to delete" , "Delete a range
of ports")
PortStop = inputbox("The last port you want to delete" , "Delete a range of
ports")
for i = PortStart to PortStop

WSHShell.run "netsh firewall delete portopening protocol = all port = " & i


next
---------------------------------------------
Not a pretty one but it will do the job :-)

You can get additional help on opening ports in command prompt by typing:
netsh firewall add portopening /?

!!!!!!!!!!!!!!!!!Once again rather than opening ALL the ports open those you
need:!!!!!!!!!!!!!!!!!!!!
http://docs.hp.com/en/5990-7252/ch01s01.html

Hope this helps.

--

------------------------------------------------------------
For direct e-mailing remove "-spam" from my e-mail address
--
Best Regards,
Matija Hrovat


"Dstrider" > wrote in message
...
> How is it possible set to an exception that allows access to all ports on
> an
> XP SP2 machine from a specific IP (or range of IPs)?

Google