使用Python搜索具有MAC地址的主机 [英] Search for host with MAC-address using Python

查看:99
本文介绍了使用Python搜索具有MAC地址的主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网络中搜索所有给定的MAC地址,全部都在Python脚本中进行.我已经有了网络中所有活动IP地址的映射,但是我不知道如何收集MAC地址.有什么想法吗?

I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas?

推荐答案

您需要 ARP . Python的标准库不包含任何代码,因此您要么需要调用一个外部程序(您的操作系统可能具有一个"arp"实用程序),要么需要自己构建数据包(可能使用 Scapy .

You need ARP. Python's standard library doesn't include any code for that, so you either need to call an external program (your OS may have an 'arp' utility) or you need to build the packets yourself (possibly with a tool like Scapy.

这篇关于使用Python搜索具有MAC地址的主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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