get ip from mac

T

Tom Anderson

That is how you find out your OWN MAC. The way he found out the remote
MAC required some unspecified fiddle to get the machine to reveal it to
the outside world, perhaps via a human on the telephone.

Yes, that's what i was thinking. It could be a bit more automatic than a
technician with a phone, but that would also work. If he's only monitoring
a small number of machines, it might even be the easiest way to do it.
The MAC is confidential in the sense the Java Applet sandbox will IIRC
not let you find out the MAC of your own machine and tattle to another
machine, unless you sign the applet.

That's certainly true.

But it is possible to do it without running *any code at all* on the
remote machine - you can get the remote machine's MAC address from your
own local ARP cache.

Here's a script to do it under unix:

#! /bin/bash
addr=$1
arp -a | grep $addr | cut -d " " -f 4

I've called it getmac - here it is in action:

cramerlab$ getmac mrclmcb174.mcbl.ucl.ac.uk
0:d:93:40:b1:e6

You do need to have the remote machine in your ARP cache, which means
either pinging it somehow, or waiting for it to advertise itself.

tom
 
B

BigZero

Yes, that's what i was thinking. It could be a bit more automatic than a
technician with a phone, but that would also work. If he's only monitoring
a small number of machines, it might even be the easiest way to do it.


That's certainly true.

But it is possible to do it without running *any code at all* on the
remote machine - you can get the remote machine's MAC address from your
own local ARP cache.

Here's a script to do it under unix:

#! /bin/bash
addr=$1
arp -a | grep $addr | cut -d " " -f 4

I've called it getmac - here it is in action:

cramerlab$ getmac mrclmcb174.mcbl.ucl.ac.uk
0:d:93:40:b1:e6

You do need to have the remote machine in your ARP cache, which means
either pinging it somehow, or waiting for it to advertise itself.

tom

Well this script not worked for me
it gives error arp: command not found
i try this on the Linux 2.6.11-1.1369_FC4 i686 athlon i386 GNU/Linux


Thanks
VM
 
T

Tom Anderson

Well this script not worked for me
it gives error arp: command not found
i try this on the Linux 2.6.11-1.1369_FC4 i686 athlon i386 GNU/Linux

I would guess the arp command isn't on your path. It is on my Mac, but
i've just tried on a linux box (i think it's Debian), and it isn't on
that.

So, instead, find your arp command and invoke it with its full path.
Mine's at:

/usr/sbin/arp

If yours isn't, try:

locate */arp

And look for likely candidates.

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,743
Latest member
WoodrowMea

Latest Threads

Top