Jump to content

Если программы по определению производителя сет. уст-в по MAC


Recommended Posts

Posted

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

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

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

Спасибо

Posted

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

 

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";

Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...
На сайте используются файлы cookie и сервисы аналитики для корректной работы форума и улучшения качества обслуживания. Продолжая использовать сайт, вы соглашаетесь с использованием файлов cookie и с Политикой конфиденциальности.