博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

我爱臭豆腐

热爱计算机 热爱照相
  wanghao.cublog.cn

关于作者
姓名:王浩
职业:计算机
位置:北京
个性介绍:
老老实实做人 认认真真做事
|| << >> ||
我的分类


nmap 扫描mac地址
最近干的一个工作就是要对出整个数据中心里面的服务器的网卡插在了那个交换机的那个端口上面.
经过总结发现合理使用的snmp和一些工具完全可以省去用手去看的工作.
其中一个最重要的功能是将ip地址和mac的对应表列出来.
所以我就使用了nmap这个工具.正好今天把nmap升级到了最新的版本.

linux : Latest Stable i386 Nmap RPM: nmap-3.93-1.i386.rpm
windows:Nmap 3.90 and later require WinPcap 3.1 or later. Latest stable Nmap command-line zipfile: nmap-3.93-win32.zip


使用的方法:
nmap -sP -PI -PT -oN ipandmaclist.txt 192.168.1.0/24
完事后就得到了一个txt文件里面就是ip地址和mac地址.

感谢  SiskinXu 提供的意见反馈. 由于过去笔误把参数中的-oN 写成了-on 今天给改正过来了

发表于: 2005-09-22,修改于: 2007-03-01 09:52,已浏览3559次,有评论10条 推荐 投诉


网友评论
网友: 匿名网友 时间:2005-11-04 15:47:56 IP地址:218.104.42.★
呵呵,谢谢了。

网友: chenl 时间:2005-12-19 11:31:01 IP地址:219.238.168.★
刚好最近可能会用到,谢了 :)

网友: skylove 时间:2005-12-20 16:15:27 IP地址:218.6.128.★
Failed to resolve given hostname/IP: ipandmaclist.txt.  Note that you can't use '/mask' AND '[1-4,7,100-]' style IP ranges

我这里被提示以上错误?

网友: 我爱臭豆腐 时间:2005-12-22 12:00:57 IP地址:211.157.227.★
我现在只有一个xp的系统.等我找一个linux给你试试.

网友: 时间:2006-04-11 10:18:58 IP地址:59.60.8.★
楼主中个Q啊,有些事以后问你。


不过上面的可以下载吗

网友: 我爱臭豆腐 时间:2006-04-12 13:43:25 IP地址:211.157.227.★
http://www.insecure.org/nmap/download.html
下载可以从这个地方.

网友: SiskinXu 时间:2007-02-25 13:03:03 IP地址:211.148.4.★
你的这条命令好像应该是
nmap -sP -PI -PT -oN ipandmaclist.txt 192.168.1.0/24
大小写敏感的

我在运行的时候,它总是先给个提示:
WARNING: Could not import all necessary WinPcap functions. You may need to upgrade to version 3.1 or higher from http://www.winpcap.org. Resorting to connect() mode -- Nmap may not function complelely.

我的版本的确是4.20的

得到的结果是类似于:
Host 192.168.1.1 appears to be up.
Host 192.168.1.2 appears to be up.
这样的东东,而不是 IP -- MAC 对应表。

为何?麻烦告知,谢谢!
siskin@sohu.com

Blog作者的回复:
# Nmap 4.01 scan initiated Thu Mar 01 09:44:46 2007 as: nmap -sP -PI -PT -oN test1.txt 192.168.2.0/24 
Host 192.168.2.1 appears to be up.
MAC Address: 00:09:5B:F5:74:F3 (Netgear)
Host tycrm.test.com (192.168.2.2) appears to be up.
MAC Address: 00:13:72:62:70:19 (Dell)
Host testpc1.test.com (192.168.2.3) appears to be up.
MAC Address: 00:13:72:62:70:19 (Dell)
Host zhaofengxia.test.com (192.168.2.5) appears to be up.
MAC Address: 00:16:76:39:AB:7E (Intel)
Host licongpc.test.com (192.168.2.21) appears to be up.
MAC Address: 00:11:5B:65:06:E6 (Elitegroup Computer System Co. (ECS))
Host licongpc.test.com (192.168.2.22) appears to be up.
MAC Address: 00:15:C5:4B:E4:FD (Dell)
Host tyofficepc2.test.com (192.168.2.24) appears to be up.
MAC Address: 00:13:CE:D3:5E:65 (Intel Corporate)
Host wangruihome.test.com (192.168.2.25) appears to be up.
MAC Address: 00:18:DE:61:40:2A (Unknown)
Host wanghaohome.test.com (192.168.2.28) appears to be up.
MAC Address: 00:16:6F:40:FE:71 (Intel)
Host licongpc.test.com (192.168.2.29) appears to be up.
MAC Address: 00:15:F2:BD:CA:2B (Asustek Computer)
Host sds.test.com (192.168.2.31) appears to be up.
MAC Address: 00:11:5B:AE:89:CE (Elitegroup Computer System Co. (ECS))
Host chenyuhui.test.com (192.168.2.33) appears to be up.
MAC Address: 00:16:76:B7:83:5C (Intel)
Host guowei.test.com (192.168.2.34) appears to be up.
Host licongpc.test.com (192.168.2.36) appears to be up.
MAC Address: 00:11:5B:AF:CB:90 (Elitegroup Computer System Co. (ECS))
Host lizhongshan.test.com (192.168.2.37) appears to be up.
MAC Address: 00:15:F2:BD:C1:D7 (Asustek Computer)
Host ciscoap.test.com (192.168.2.247) appears to be up.
MAC Address: 00:0E:D7:44:BC:9F (Cisco Systems)
Host 192.168.2.248 appears to be up.
MAC Address: 00:11:0A:BF:6D:02 (Hewlett Packard)
Host ps.test.com (192.168.2.249) appears to be up.
MAC Address: 00:11:5B:64:FB:9A (Elitegroup Computer System Co. (ECS))
# Nmap run completed at Thu Mar 01 09:44:59 2007 -- 256 IP addresses (18 hosts up) scanned in 13.675 seconds
 这个是我刚刚试验完的.您可以看看. .另外我感觉你的winpcap的版本可能是不对.


网友: siskinxu 时间:2007-02-25 13:03:51 IP地址:211.148.4.★
nmap -sP -PI -PT -oN ipandmaclist.txt 192.168.1.0-255

好像说不支持 /mask 模式

Blog作者的回复:
我使用的是在xp下面的nmap.
版本如下:
C:\>nmap -V

Nmap version 4.01 ( http://www.insecure.org/nmap )
在使用/mask的参数的时候是好用的.


网友: 本站网友 时间:2007-12-27 02:28:50 IP地址:121.34.165.★
SUDO  

网友: 本站网友 时间:2008-05-03 17:55:18 IP地址:58.61.195.★
用不了呢
WARNING: Failed to locate Winpcap. Nmap may not function properly until this is
installed!  WinPcap is freely available from http://winpcap.polito.it.

Starting nmap 3.93 ( http://www.insecure.org/nmap ) at 2008-05-03 17:50 China St
andard Time

Blog作者的回复:
兄弟您是不是没有安装winpcap啊?
你去安装一个吧.


 发表评论