Thursday, February 3, 2011

How to discover the mac address of machines in a network?

Hi all,

How to discover the mac address of machines in a network?

I need to discover the machines that are available just with only BIOS installed (NO Operating System)

And I need to find the mac address of such machines that are up.

  • You will have to access the information available on your managed switches.

    If you have an unmanaged network, I dont see a way to do that.

    This is assuming the target computers are capable of Wake On LAN. In this case, link to the server is established (look for the flashy link LED), and the network card is listening to WOL broadcasts. AFAIK, the card does not answer to anything in this state. If there is no WOL, the card most probably is off (no Link LED), and it wont work at all.

    From Posipiet
  • If the machines are not powered up, this is impossible.

    If they are powered up, I would guess this is impossible as well, as you need a minimal network stack to at least answer things like ARP queries etc, which isn't working without an OS installed.

    What might work (I don't know and can't test right now) is that the NIC and the switch communicate when the NIC is plugged in or powered up and the switch learns the MAC address this way. If this is the case you would need a manageable switch and query it for connected mac addresses.

    Bart Silverstrim : You *might* get it without a network stack if it's asking for bootp or pxe boot. Depends on the machine as to whether this would work though, I'd think.
    From SvenW
    1. View info on your switch / router, if switch is advanced enough .
      (In Cisco switches command is show mac-address-table).
    2. If machines have PXE enabled BIOS / Networking card, read info from DHCP logs, as they will try to get DHCP lease. If you do not have DHCP, just dump all broadcast traffic with Wireshark and filter DHCP traffic. All newly powered machines without OS will show in traffic.
    From Kristaps
  • As others have said, if you have unmanaged switches, or BootP/PXE, there's no easy way to get the MACs of machines with no OS.

    If your running machines are running windows, it's easy to script (usually via WMI)

    There are a bunch of examples here: http://gallery.technet.microsoft.com/ScriptCenter/en-us/site/search?f[0].Type=SearchText&f[0].Value=MAC+address&x=0&y=0

    From gWaldo
  • From a Unix machine, listening to the no-OS computers on the same LAN, and if possible via a Hub (not a Switch), you can try

    arp
    cat /proc/net/arp
    

    Also you may want to try wireshark (from a OS-ed machine). Again, better to use a Hub in order to catch any communications from the BIOS machines, including broadcasts.

    From ring0
  • The basic problem here is that this is Layer 2 information, so only switches see it. Some switches will provide an interface that lets you peek at this info, but if they don't the only way to get it is to intercept in the physical layer, by eg installing a hub between the switch.

    If you're using managed switches this information is likely available from the switch. Some end-user integrated routers/switches (such as the kind that often package ADSL modems as well) will sometimes have a DHCP client list which includes MAC addresses.

    If you're using unmanaged switches, and you really want to know this info, I recommend you buy a hub, and temporarily replace the switch with it. You can then connect a computer running wireshark to the hub and capture ARP packets to record MAC addresses. Alternately you could use Echolot to do this for you - it selectively tracks ARP packets and builds a MAC address database.

    imoatama : Edit - just reread the part about them being BIOS only. This presents further challenges beyond the problem of intercepting the layer 2 data - the clients may not even send any data over the network. If the clients have a bios that does DHCP, or sends ARP packets out, it should be possible to see them from the switch. I'm not sure what BIOS editions support this, I know some do though.
    From imoatama
  • I was going to suggest switch MAC address table, but someone's already covered that one above.

    If any of the computers are running an OS and have an IP addresses, you can connect into the same LAN, you could use NMAP (or a GUI version like Zenmap) from http://nmap.org/... if you run this on the same LAN, you should get MAC address info for any machines that respond.

    It would be useful to understand more about why you need to get the MAC addresses, in case there is a better way of achieving the same result.

  • scan with nmap all network and then check the arp table (arp -a in linux distro's)

    From MihaiM
  • You can collect ARP information with for example a continuously running arpalert. With that, you will have the set of ARP addresses seen after start.

    Powered off machines will not send you ARP replies.

    To speed up the process, you can use an nmap ping scan (nmap -sP) on your network from the server you are running arpalert on, in order to trigger all possible (live and running) hosts to respond your arp query. With running nmap ping scan regularly later, you have better chances catching a shortly living host.

    snippet from arpalert:

    If the MAC is not in list, arpalert launches a pre-defined user script with the MAC address and IP address as parameters.

    snippet from nmap:

    Nmap ("Network Mapper") is a free and open source (license) utility for network exploration or security auditing

    Look around here:

    From asdmin

0 comments:

Post a Comment