macchanger icon indicating copy to clipboard operation
macchanger copied to clipboard

Random MAC with specified oui?

Open DiagonalArg opened this issue 8 years ago • 3 comments

I am using a network that cuts off connections of non-mobile devices after half an hour. I'd like to be able to set the MAC on my laptop to make it look like an iphone or HTC phone, for instance. I can generate a random mac looking like an iphone 5S this way:

echo "f4:37:b7$(openssl rand 3 | hexdump -e '/1 ":%02x"')"

So I think this should work for me:

macchanger -m "f4:37:b7$(openssl rand 3 | hexdump -e '/1 ":%02x"')" <interface>

It would be nice if there were an easier way to do this, perhaps a -oui=<OUI> option that sets the mac to some random value with the given <OUI>.

Thanks for considering it. And thanks for your work!

DiagonalArg avatar Aug 14 '16 18:08 DiagonalArg

A work-around that you may or may not find less ugly than your code above would be to first use macchanger to set vendor/OUI part and next use it to randomize the non-OUI part. Something like:

macchanger -m "f4:37:b7:00:00:00" eth0
macchanger -e eth0

thoger avatar Aug 15 '16 13:08 thoger

Thanks. Either of those will work for now.

Perhaps you'll keep the --oui=<OUI> suggestion in mind for the future.

In any case, all efforts appreciated.

DiagonalArg avatar Aug 18 '16 16:08 DiagonalArg

I wrote "plausible" to generate a random MAC address using an OUI from the Wireshark manuf database. https://github.com/alrs/plausible

alrs avatar Sep 02 '16 07:09 alrs