Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Get MAC ID from IP Address

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,38708
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Get MAC ID from IP Address
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Get MAC ID from IP Address - 10/13/2006 5:34:49 AM   
  FatFingerTony

 

Posts: 5
Score: 0
Joined: 10/10/2006
From: Grand Rapids, MI
Status: offline
Here's a quick and dirty IP address to MAC ID lookup, gets it from the local ARP table.

Note: Don't use it to pull your own (the computer you're running it from) MAC, it gets confused with the local interface address listed in the ARP table.


      
 
 
Revisions: 1 | Post #: 1
 
 RE: Get MAC ID from IP Address - 10/13/2006 6:55:10 AM   
  DiGiTAL.SkReAM


Posts: 1152
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: online
I was unable to get this to work.  On my network, most machines are resolved via WINS... would that affect the output?

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to FatFingerTony)
 
 
Post #: 2
 
 RE: Get MAC ID from IP Address - 10/13/2006 7:38:40 AM   
  mcds99


Posts: 424
Score: 4
Joined: 2/28/2006
Status: offline
The reason this will not work accross a network segment is you have to be on the network segment you are using ARP on.

One of the gotch ya's of ARP.

WMI can do the same, but it does require admin like rights.

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to FatFingerTony)
 
 
Post #: 3
 
 RE: Get MAC ID from IP Address - 10/13/2006 8:02:46 AM   
  DiGiTAL.SkReAM


Posts: 1152
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: online
You are correct on both counts.  I got with our WAN/LAN group, and did a bull session and found that since our switches are VLAN'd out, I can get ARPs for all the machines inside my VLAN, but when crossing into another VLAN, I need to go througha  router, and the ARP broadcasts are stomped on.
Also, the WMI method of getting MAC addresses is valid, but again, as you said, you need admin rights on the remote machine.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to mcds99)
 
 
Post #: 4
 
 RE: Get MAC ID from IP Address - 10/16/2006 1:32:35 PM   
  FatFingerTony

 

Posts: 5
Score: 0
Joined: 10/10/2006
From: Grand Rapids, MI
Status: offline
Sorry, I should have been more specific about it's function. Yes, ARP tables only hold your local subnets ip addresses, but I needed a free MAC lookup script that would at least pull MACs from foreign IP addresses that show up on local IP range scans.

I have a set of scanner scripts (which I'll post once all my commenting is done) that this mac script is part of, and it pings a range of IPs, if they respond it hit them with three different accounts to gain WMI access, if it fails to grab WMI then it tries to grab a MAC ID to help me investigate what the heck is on our network. I've actually updated this script so that it grabs a vendor name out of a text file by matching the MACs first six digits to give me a little more info to work with. I'd post it, but I can't upload the text reference file (not enough posts to upload) and it needs some trimming, it's currently 1.5 megs and 2/3rds of it can be deleted.

(in reply to FatFingerTony)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Get MAC ID from IP Address Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts