文件名称:Linux-MAC20081224
- 所属分类:
- Linux/Unix编程
- 资源属性:
- [MacOS] [C/C++] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 14kb
- 下载次数:
- 0次
- 提 供 者:
- dari*****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
在linux下,c语言编写,可以根据对方的IP,查看其MAC地址,也可以扫描局域网在线IP的MAC和主机名。原理:建立socket ,构造netbios-ns包,循环sendto()把数据发送给对方并recvfrom()读取返回信息。根据返回的netbios回应包,读取对方的主机名,组名和mac地址。
显示结果如下:
IP: 192.168.116.124 Host Name: BRN_8EEE6A/BRN_8EEE6A MAC: 00-80-77-8E-EE-6A
IP: 192.168.116.130 Host Name: XIAOXIAO/MSHOME MAC: 00-12-3F-D5-5E-A6
IP: 192.168.116.131 Host Name: NA MAC: NA [time out!]
一个网段扫描MAC,可以建立一个socket,连续向多个不同IP发送NBNS包,然后等待接受,根据返回包就可以扫描一个网段多个IP的MAC啦。
而windows下可以运行命令:nbtstat -A ip-address来查看
windows c 要改改头文件 -C language, based on each other s IP, to see its MAC address, can also scann more online IP-LAN MAC and host name.
Principle: To establish a socket, constructed netbios-ns package, cycle to use sendto () function sent the data to the other side ,
and use recvfrom () to read back-information. Netbios respond in accordance with the return package, read each other s host name, group name and mac address.
显示结果如下:
IP: 192.168.116.124 Host Name: BRN_8EEE6A/BRN_8EEE6A MAC: 00-80-77-8E-EE-6A
IP: 192.168.116.130 Host Name: XIAOXIAO/MSHOME MAC: 00-12-3F-D5-5E-A6
IP: 192.168.116.131 Host Name: NA MAC: NA [time out!]
一个网段扫描MAC,可以建立一个socket,连续向多个不同IP发送NBNS包,然后等待接受,根据返回包就可以扫描一个网段多个IP的MAC啦。
而windows下可以运行命令:nbtstat -A ip-address来查看
windows c 要改改头文件 -C language, based on each other s IP, to see its MAC address, can also scann more online IP-LAN MAC and host name.
Principle: To establish a socket, constructed netbios-ns package, cycle to use sendto () function sent the data to the other side ,
and use recvfrom () to read back-information. Netbios respond in accordance with the return package, read each other s host name, group name and mac address.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Linux-MAC20081224
.................\data.pcap
.................\data.txt
.................\dd
.................\scan_moreip_mac.c
.................\data.pcap
.................\data.txt
.................\dd
.................\scan_moreip_mac.c