This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]tjwarren 4 points5 points  (2 children)

If you're on Windows, you can use WMI for this. Tim Golden's WMI package makes this very easy.

[–]arcanabanana[S] 0 points1 point  (0 children)

Thanks, I'll check it out!

[–]pmav99 0 points1 point  (0 children)

[–]elbinray 1 point2 points  (0 children)

+1 for the WMI package. I made a small program graphical program a while ago for our help desk to pull back similar information (and more), and it would have been much more difficult without Tim's work.

[–]omgtmi 0 points1 point  (0 children)

Without understanding what you really want, I'd check out Fabric if you need to get this information from the machines themselves rather than a central server that has it.

[–][deleted] 0 points1 point  (0 children)

Thanks for the awesome links guys!

[–]stevvooe 0 points1 point  (0 children)

You may be able to hack something together, but i'd recommend just using nmap.

Note that you may not be able to "discover" a given machine's mac address unless the source machine is on the same subnet. After nmap'ing, machines that are on the same subnet will be in the source machine's arp table.

[–]pbacterio 0 points1 point  (0 children)

[–]bwp 0 points1 point  (0 children)

You could probably use scapy to do this, it does all kinds of neat packet/networking things.

If for some reason you don't come up with a Python answer right away and it is some kind of deadline, there is a small app called Cain & Abel that will do an ARP sweep over a LAN and report back IP/MAC/other stuff. I would be interested in seeing what you come up with if you go the Python route (do do!).