Python 数据包嗅探器
我应该使用什么 Python 模块来嗅探数据包?我不需要任何太复杂的东西,我只需要从发送到我的计算机的一些数据包中获取数据。我使用的是Python 2.6和Windows 7,并且安装了WinPcap 4.1.2。
到目前为止,我已经看到人们建议 pcapy 和 pypcap,但是当我尝试安装它们时,它们都失败并告诉我缺少 msvcr71.dll,即使它在我的计算机上。另外, python-libpcap sourceforge 页面似乎不可用,所以我无法尝试。
What Python module should I be using to sniff packets? I don't need anything too complex, I just need to get the data out of some packets being sent to my computer. I am using Python 2.6 and Windows 7, and I have installed WinPcap 4.1.2.
So far I've seen people suggest pcapy and pypcap, but when I try to install those, they both fail and tell me I am missing msvcr71.dll even though it is on my computer. Also, the python-libpcap sourceforge page seems to be unavailable, so I can't try that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
显然您想使用现成的包装器,但请记住,您始终可以使用 Ctypes 直接访问捕获函数。
看:
http://www.python.org/doc/current/library/ctypes.html
希望这有帮助
Obviously you want to use a ready-made wrapper, but keep in mind that you can always use Ctypes to directly access the capture functions.
See:
http://www.python.org/doc/current/library/ctypes.html
Hope this helps
dirtybags.net 的 py-pcap 不依赖于 pcap 库,因此它可能适合您。不过,我不确定它有多快或者它是否可以在 Windows 上运行。
http://dirtbags.net/py-pcap.html
py-pcap from dirtbags.net doesn't depend on a pcap lib so it might work for you. Though, I'm not sure how fast it is or if it works on windows.
http://dirtbags.net/py-pcap.html