Is it possible to write a firewall in python?

后端 未结 6 1076
深忆病人
深忆病人 2020-12-28 21:27

Is it possible to write a firewall in python? Say it would block all traffic?

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-28 21:32

    I'm sure it's probably possible, but ill-advised. As mcandre mentions, most OSes couple the low level networking capabilities you need for a firewall tightly into the kernel and thus this task is usually done in C/C++ and integrates tightly with the kernel. The microkernel OSes (Mach et al) might be more amenable than linux. You may be able to mix some python and C, but I think the more interesting discussion here is going to be around "why should I"/"why shouldn't I" implement a firewall in python as opposed to just is it technically possible.

提交回复
热议问题