首页 > 编程语言 > 详细

使用Python扫描网络MAC地址对应的IP地址

时间:2015-08-31 23:03:31      阅读:376      评论:0      收藏:0      [点我收藏+]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from scapy.all import srp,Ether,ARP,conf
ipscan=‘192.168.200.1/24‘
try:
	    ans,unans = srp(Ether(dst="FF:FF:FF:FF:FF:FF")/ARP(pdst=ipscan),timeout=2,verbose=False)
except Exception,e:
	print str(e)
else:
	for snd,rcv in ans:
		#list_mac=rcv.sprintf("%Ether.src% - %ARP.psrc%")
		#print list_mac
		strmac = rcv.sprintf("%Ether.src%")
		if strmac == ‘b8:27:eb:0e:ea:a5‘:
			strip = rcv.sprintf("%ARP.psrc%")
			print strip

  

使用Python扫描网络MAC地址对应的IP地址

原文:http://www.cnblogs.com/madlas/p/4774292.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!