Jump to content
Калькуляторы

Если программы по определению производителя сет. уст-в по MAC Нужно узнать по MACу что за зверь на том конце

Собс-но вопрос в названии темы.

Нужна прога или какой-нить перечень устройств в файле.

Прграмму SMAC 2.7 не предлагать (уж очень устаревший список)

Спасибо

Share this post


Link to post
Share on other sites

А локально работающая есть?

Share this post


Link to post
Share on other sites

У меня самописные скриптики на эту тему:

 

run.sh

#!/bin/bash

echo "Downloading oui.txt from ieee.org..."
wget http://standards.ieee.org/regauth/oui/oui.txt
#cp -ai oui.txt.last oui.txt

if [ -f oui.txt ];
then
   echo "File oui.txt found. Generating php code...";
   cat oui.txt | iconv -f ISO-8859-1 -t UTF-8 | grep -F 'base 16' | sed 's/(base\ 16)//' | sed 's/\t/\ /g' > oui.txt.utf8
   php -f generate_php.php > mac_vendor.php
   echo "Testing php file...";
   php -f test_mac_vendor.php
else
   echo "ERROR! File oui.txt not found. exit.";
   exit 1;
fi

mv oui.txt oui.txt.last
rm oui.txt.utf8

 

generate_php.php

<?php
$src=fopen('oui.txt.utf8','r');
if(!$src)
   die("can't open input file\n");
else
   echo "<?php\n/*
   Source file: http://standards.ieee.org/regauth/oui/oui.txt
   Generated by script: ".__FILE__."\n    ".date('r')."
*/\n".'$mac_vendor=array('."\n";

while(!feof($src))
{
   $str=trim(fgets($src));
   $vals=explode(" ",$str,2);
   if($str!=""&&isset($vals[0]))
   {
$hex=trim($vals[0]);

if(isset($vals[1]))
    $val=trim($vals[1]);
else
    $val="";

if("$val"=="")
    $val="private";
$dec=hexdec($hex);
$val=str_replace("'","\'",$val);

echo "$dec=>'$val',\n";
   }
}
echo ");\n ?>";

 

test_mac_vendor.php

<?php
include 'mac_vendor.php';
echo "00-00-00 is ".$mac_vendor[0]."\n";

Share this post


Link to post
Share on other sites
skyprox:/# nmap 192.168.0.254

Starting Nmap 4.62 ( http://nmap.org ) at 2011-05-23 21:51 MSD
Interesting ports on 192.168.0.254:
Not shown: 1714 closed ports
PORT   STATE SERVICE
23/tcp open  telnet
MAC Address: 00:17:9A:B7:7E:E3 (D-Link)

Nmap done: 1 IP address (1 host up) scanned in 1.522 seconds

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this