如何在Windows上通过python发送ARP数据包而不需要winpcap? [英] How do I send an ARP packet through python on windows without needing winpcap?

查看:263
本文介绍了如何在Windows上通过python发送ARP数据包而不需要winpcap?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Windows上不使用其他库(例如winpcap)发送ARP数据包?



我听说Windows XP SP2会阻止原始以太网套接字,但我也听说,原始套接字仅对管理员阻止。

解决方案

在一般情况下,如果不使用外部库,则无法做到这一点。

p>

如果对数据包应包含的内容没有任何要求(即,如果有任何ARP数据包将要执行),那么您可以显然会发送ARP请求,您只需通过尝试向自己的子网中的任何IP发送内容(通过运行外部 arp -d tar.get预先确保目标IP不在ARP缓存中)就可以在以太网上。 ip.address 命令),但这可能不是您想要的。



有关原始套接字支持的更多信息,请参见 TCP / IP原始套接字文档页面 ,特别是 L

Is there any way to send ARP packet on Windows without the use of another library such as winpcap?

I have heard that Windows XP SP2 blocks raw ethernet sockets, but I have also heard that raw sockets are only blocked for administrators. Any clarification here?

解决方案

There is no way to do that in the general case without the use of an external library.

If there are no requirements on what the packet should contain (i.e., if any ARP packet will do) then you can obviously send an ARP request if you're on an Ethernet network simply by trying to send something to any IP on your own subnet (ensuring beforehand that the destination IP is not in the ARP cache by running an external arp -d tar.get.ip.address command), but this will probably not be what you want.

For more information about raw socket support see the TCP/IP Raw Sockets Docs page, specifically the Limitations on Raw Sockets section.

这篇关于如何在Windows上通过python发送ARP数据包而不需要winpcap?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆