How to select vendor when using macchanger in linux

1.1k views Asked by At

Currently, I am using this command to spoof my MAC address:

macchanger eth0 -A

However, I want to be able to select which vendor I use. I know that the switch -l displays a list of all available vendors, but say I want to use one from Cisco, what command do I use to actually use that specific vendor rather than the system choosing a random vendor for me each time?

1

There are 1 answers

0
keyboardcat On

You could add a function like this to .bashrc Then you can: macspoof Apple eth0

macspoof () {
  Vendor=$(macchanger -l | grep $1 | shuf -n 1 | awk '{print $3}')
  Tail=$(echo $RANDOM | md5sum | sed 's/.\{2\}/&:/g' | cut -c 1-8)
  Mac="$Vendor:$Tail"
  sudo macchanger -m $Mac $2
}