Via Minko Gechev's tweet. Saving in an org block, just because…
changeMAC() {
local mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
ifconfig en0 ether $mac
ifconfig en0 down
ifconfig en0 up
echo "Your new physical address is $mac"
}
changeMAC
#+RESULTS:
Your new physical address is aa:36:ee:d2:ee:66
ps. Also see Execute org blocks as root.