Python & firewall control (Win32)

Tom Anderson twic at urchin.earth.li
Thu Jun 16 13:55:51 EDT 2005


On Thu, 16 Jun 2005, Tim Williams wrote:

> Does anyone know of (personal/desktop) firewall that can be controlled 
> via Python, or a Python Firewall package, or even something like DAXFi 
> but not dormant ?
>
> The XP native firewall appears to have an API, but I'm not convinced I 
> want to go that route unless it is relatively simple.

http://wipfw.sourceforge.net/

import os
def deny(src, dst, proto="all"):
 	cmd = "ipfw add deny " + proto + " from " + src + " to " + dst
 	os.system(cmd)

ipfw for Windows is technically in beta, but ipfw itself is rock solid.

tom

-- 
The few survivors on ousfg's side ended up in a monastery of immortal 
monks who yearned for a life better than street-fighting social groups, 
learning to grow extra hands and feet on the way to immortality.
  -- Lyndsey Pickup



More information about the Python-list mailing list