是否可以用 python 编写防火墙?说它会阻止所有流量?
原文由 Jake 发布,翻译遵循 CC BY-SA 4.0 许可协议
Python-iptables 为 Linux 下的 iptables 提供了 python 绑定。与 iptables 的互操作性是通过使用 iptables C 库(libiptc、libxtables 和 iptables 扩展)实现的,而不是调用 iptables 二进制文件并解析其输出。
http://ldx.github.io/python-iptables/index.html
原文由 Vincenzo 发布,翻译遵循 CC BY-SA 3.0 许可协议
2 回答5.1k 阅读✓ 已解决
2 回答1.1k 阅读✓ 已解决
4 回答1.4k 阅读✓ 已解决
3 回答1.3k 阅读✓ 已解决
3 回答1.2k 阅读✓ 已解决
1 回答1.7k 阅读✓ 已解决
1 回答1.2k 阅读✓ 已解决
是的,是的。
我有一些使用 nfqueue 与 Linux iptables 交互以执行防火墙职责的 Python 代码。我可以在 iptables 中使用如下规则:
然后有一些 Python 代码如下所示:
这是一篇很好的文章,上面的代码基于:
http://blog.yancomm.net/2011/05/nfqueue-packet-mangling-with-python.html