Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-06-25 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.