2014-05-21

Mac Spoofing on Mac OSX


Spoof your Mac address by typing:
ifconfig en0 ether 00:00:00:00:00:00 
The zeros can be changed to any combination of characters 0-9 and a-f, and I think the 2nd character has to be an even number.  You can then replace the en0 with whichever adapter you’d like to implement the spoofed address on, and hopefully the series of zero’s here with the actual MAC address of a target host.
arp -a
Will display your arp cache with the mac address of all your network neighborhood.

=====================

You can delete an IP address from the arp table using the arp command along with the -d option followed by an address.  For example, to delete IP 10.10.10.1:
arp -d 10.10.10.1
If you’re not sure which IP address you’re looking for then you can look at the arp table to check the IP against the MAC address by using the -a option along with arp.  For example:
arp -a
To delete all of the entries in an arp table (they do regenerate after all) you can use the -d option in conjunction with the -a option:
arp -d -a
If you then want to manually add an entry into the arp table you can use the -s option followed first by the IP address and then by the MAC address, as follows (assuming an IP of 10.10.10.10 and a MAC of 00-00-00-00-00-00):
arp -s 10.10.10.10 00-00-00-00-00-00
In some cases I’ve had to revert to using hostnames instead of MAC addresses.  To do so, first define the hostname in /etc/hosts, adding a line that has the IP followed by the name of the server, as follows:
havok.krypted.com 10.10.10.10
Then simply use the name instead of the MAC address with the -s option, as follows:
arp -s havok.krypted.com 10.10.10.10