[mpenning@Bucksnort ~]$ arp -an
? (4.121.8.3) at 08:00:27:f5:5b:6b [ether] on eth0
? (4.121.8.4) at 08:00:27:f5:5b:6b [ether] on eth0
? (4.121.8.1) at 00:1b:53:6b:c9:c4 [ether] on eth0
[mpenning@Bucksnort ~]$
在python中。。。在
^{pr2}$
在perl中。。。在
my $SUBNET = '192.168.1.0/24'; # Insert your subnet here
`nmap -sP $SUBNET`;
my $p = `arp -an`;
for my $line (split('\n', $p)) {
$line=~/\((\S+?)\)\s+at\s+(\S+)/;
$ipaddr = $1;
$mac = $2;
# do something with with each mac and ip address
}
这有帮助吗?在
在python中。。。在
^{pr2}$在perl中。。。在
UNIX系统上的
ethers
文件将以太网地址映射到IP号(或主机名)。如果您的/etc/ethers
得到了正确的维护,您可以在那里查找它。在相关问题 更多 >
编程相关推荐