You are hereRandomise your MAC address
Randomise your MAC address
Been playing with BackTrack3beta USB edition. It looks very nice at the first sight. More info will come later.
Howto randomize your MAC addresses.
IFACES=$(ifconfig | grep HWadd | awk '{ print $1 }')
# IFACES=$(ls /sys/class/net | grep -v -e sit -e lo)
for iface in ${IFACES}; do
echo "-- Changing the MAC addr of iface: ${iface}"
macchanger -a ${iface} ;
sleep 1s;
done;
You might think it's not a bad idea to put that script in /etc/rc.d/rc.local to have it start at boot. But then you notice it might be too late because your normal MAC-address is already broadcasted over the wire/air.
rc.local is in fact called as last script during boot time. This means that /etc/rc.d/rc.inet1, the script that brings up your interfaces and start a dhcp client, has already run. When sending DHCP requests you also send your MAC-address and thus show the network who you really are. Even for an ethical hacker this isn't something you'd want.
To solve this there are, as usual, different ways.
BackTrack has a built-in setting for configuring your interface settings. The file /etc/rc.d/rc.inet1.conf has a variable HWADDR[0]="00:01:23:45:67:89" to let you set a non-default MAC-address. (With [0] the number of the interface).
Personally I'd like to have a non-static MAC, something that doesn't leave traces on my machine.
So I put my random-mac-script before rc.inet1 is called.





00:01:23:45:67:89MAC is just and only the example from the configfile. With a little goodwill you'll notice that it has a certain pattern in it and is not meant to be used irl.macchanger(1)you'll notice what the-aargument does: Set random vendor MAC of the same kind.