如何在windows上通过python发送ARP数据包而不需要winpcap?
有没有办法在 Windows 上发送 ARP 数据包而不使用其他库(例如 winpcap)?
我听说 Windows XP SP2 会阻止原始以太网套接字,但我也听说只有管理员才能阻止原始套接字。 这里有什么澄清吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在一般情况下,如果不使用外部库,就无法做到这一点。
如果对数据包应包含的内容没有要求(即,是否有任何 ARP 数据包都可以),那么您显然可以在以太网上通过尝试发送某些内容来发送 ARP 请求到您自己子网上的任何 IP(通过运行外部
arp -d tar.get.ip.address
命令事先确保目标 IP 不在 ARP 缓存中),但这可能不会你想要什么。有关原始套接字支持的详细信息,请参阅 TCP/IP 原始套接字文档页面,特别是 原始套接字的限制部分。
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.
您可以使用 OpenVPN Tap 发送任意数据包,就像使用原始套接字一样。
You could use the OpenVPN tap to send arbitrary packets as if you where using raw sockets.