Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Nope, that's not DOS, that's Windows. And it simply does not work. It asks the remote host via Microsoft propritary protocols for its MAC address. Already a simple samba server simply responds with a faked MAC of 00-00-00-00-00-00, and if the host does not respond to MS protocols, it returns "host not found":

Microsoft Windows 2000 Version 5.00.2195
(C) Copyright 1985-2000 Microsoft Corp.

H:\>nbtstat -a enterprise

Local Area Connection:
Node IpAddress: 192.168.1.20 Scope Id: []

           NetBIOS Remote Machine Name Table

       Name               Type         Status
    ---------------------------------------------
    ENTERPRISE     <00>  UNIQUE      Registered
    ENTERPRISE     <03>  UNIQUE      Registered
    ENTERPRISE     <20>  UNIQUE      Registered
    ENTERPRISE     <00>  UNIQUE      Registered
    ENTERPRISE     <03>  UNIQUE      Registered
    ENTERPRISE     <20>  UNIQUE      Registered
    ..__MSBROWSE__.<01>  GROUP       Registered
    XXXXX          <1D>  UNIQUE      Registered
    XXXXX          <1B>  UNIQUE      Registered
    XXXXX          <1C>  GROUP       Registered
    XXXXX          <1E>  GROUP       Registered
    XXXXX          <00>  GROUP       Registered
    XXXXX          <1D>  UNIQUE      Registered
    XXXXX          <1B>  UNIQUE      Registered
    XXXXX          <1C>  GROUP       Registered
    XXXXX          <1E>  GROUP       Registered
    XXXXX          <00>  GROUP       Registered

    MAC Address = 00-00-00-00-00-00


H:\>nbtstat -a galileo7

Local Area Connection:
Node IpAddress: 192.168.1.20 Scope Id: []

    Host not found.

H:\>ping galileo7

Pinging galileo7.xxxxx.xxx 192.168.1.1 with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time<10ms TTL=64
Reply from 192.168.1.1: bytes=32 time<10ms TTL=64
Reply from 192.168.1.1: bytes=32 time<10ms TTL=64
Reply from 192.168.1.1: bytes=32 time<10ms TTL=64

Ping statistics for 192.168.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum =  0ms, Average =  0ms

H:\>

Reading the ARP cache can help here, but you must have communicated with a host before its MAC is in the ARP cache:

H:\>arp -a

Interface: 192.168.1.20 on Interface 0x1000003
  Internet Address      Physical Address      Type
  192.168.1.1           00-12-17-XX-XX-4e     dynamic
  192.168.1.10          00-08-54-XX-XX-d8     dynamic
  192.168.1.12          00-01-e6-XX-XX-41     dynamic

H:\>

The same trick also works on Linux:

$ /sbin/arp -v
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.1.20             ether   00:1e:90:XX:XX:c3   C                     br0
galileo7.xxxxx.xxx       ether   00:12:17:XX:XX:4e   C                     br0
Entries: 2      Skipped: 0      Found: 2

$ /sbin/arp -v -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.1.20             ether   00:1e:90:XX:XX:c3   C                     br0
192.168.1.1              ether   00:12:17:XX:XX:4e   C                     br0
Entries: 2      Skipped: 0      Found: 2

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^2: How can I find a MAC address from aremote IP ? by afoken
in thread How can I find a MAC address from aremote IP ? by magoo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (12)
    As of 2014-09-19 12:47 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (138 votes), past polls