Is it possible to write a firewall in python?

后端 未结 6 1073
深忆病人
深忆病人 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:44

    I'm sure in theory you could achieve what you want, but I believe in practice your idea is not doable (if you wonder why, it's because it's too hard to "interface" a high level language with the low level kernel).

    What you could do instead is some Python tool that controls the firewall of the operating system so you could add rules, delete , etc. (in a similar way to what iptables does in Linux).

提交回复
热议问题