I had always thought that spoofing a MAC address was difficult. After all, one security precaution to wireless routers is to only let certain MAC addresses into the router.
Today I wanted to spoof a MAC address, though not for illegal purposes such as hacking into a wireless network. The university that I’m working at for the summer requires that you activate ports in the research labs by sending a request to the department’s ITS people containing the MAC address of the computer you’re trying to hook up and waiting a few days. Unfortunately I didn’t have a few days because the hard drive on the computer that we used had crapped out. It’s an old computer (pre-2000) so booting a live cd of Ubuntu was out of the question. I had my laptop and needed to connect to the internet but I couldn’t connect using the dead computer’s ethernet port since my MAC didn’t match. On top of that, we were in the sub-basement of the building, so there were no Wifi points around.
Reading through the man pages for ifconfig, I found out it’s extremely simple to spoof a MAC, at least in Linux. All commands need to be run as root, so either su to root or prefix each command with sudo.
First, disable your device (mine was eth0) by using
ifconfig eth0 down
Then, enter the line
ifconfig eth0 hw ether 00:01:02:03:04:05
and of course substitute in the MAC address that you desire. Then, just do
ifconfig eth0 up
dhclient eth0
and you’re done! You’ll now connect with your new MAC. Don’t worry, your MAC will reset on the next boot.
So anyway, I was online and looked up external hard drive enclosures to see if it would be reasonable to try one out just to make sure it wasn’t the motherboard or cables that was fried. After looking, I decided to take off the computer’s cover and poke around a bit, but didn’t actually change anything other than unplugging and replugging a few cables. Next boot it found the drive! Strange, but at least I was able to make a last backup of the data on the hard drive before we replace the computer within the next few days.