Live data from Hacker News

Randomize your WiFi MAC address on Ubuntu

paulfurley.com

81–90 of 108 posts

Re: Randomize your WiFi MAC address on Ubuntu

#81
post #80

Btw. if you want to use a random mac address just for one specific network you can simply add the following to the [wifi] section of the config file for that network (/etc/NetworkManager/system-connections/): cloned-mac-address=random That way every time you connect to that network you will have a new, valid mac address.

I look forward to it when Ubuntu LTS includes a more recent NetworkManager :)

“I learned that NetworkManager 1.4.1+ can do MAC address randomization right out the box. If you’re using Ubuntu 17.04 upwards, you can get most of the way with this config file.”

Re: Randomize your WiFi MAC address on Ubuntu

#82
post #60

Note that your MAC address is only one part of the identifying information your computer gives to the DHCP server. For another approach check out DHCPcAnon: https://github.com/juga0/dhcpcanon You can contribute to the development of this project by helping to integrate it with your favorite WiFi manager.

I wish their readme would show some examples of leaked information from reference dhcp clients, so we could tangibly see why that's an improvement.

Re: Randomize your WiFi MAC address on Ubuntu

#83
post #42

Earlier quoted context omitted.

I think it's not a good idea to change your mac address as your only precaution against tracking. The DNS requests you'll make will reveal which sites you frequent. I would advise to use a VPN connection. In this case it doesn't matter that you've randomized your mac address in a way which can be clearly identified as random. And even then you can see the VPN server IP in the logs so you should also make precautions…

If you're paranoid enough to be spoofing your MAC address, surely you're paranoid enough not to rely on shady DNS servers?

You can spoof DNS requests of a victim when you are in the same network as them (the router knows which sites you visit through those DNS requests anyway). It doesn't matter which DNS server the victim uses. As long as they don't use encrypted DNS they expose the websites they visit.

Takes 5 minutes to configure your OpenWRT router to log all DNS requests: https://superuser.com/questions/632898/how-to-log-all-dns-re... Or if you are an attacker without control over that router: search for dns spoofing. I did this several times to demonstrate companies that their public networks can be hijacked.

Re: Randomize your WiFi MAC address on Ubuntu

#84

Earlier quoted context omitted.

I think it's not a good idea to change your mac address as your only precaution against tracking. The DNS requests you'll make will reveal which sites you frequent. I would advise to use a VPN connection. In this case it doesn't matter that you've randomized your mac address in a way which can be clearly identified as random. And even then you can see the VPN server IP in the logs so you should also make precautions…

Your adversary probably isn’t the NSA, it’s commercial tracking services. Their business is tracking the general public, they don’t care about one weird person. Unless avoiding this becomes common practice and then the whole story changes.

Yes, this is also my reasoning.

> Unless avoiding this becomes common practice and then the whole story changes

If that means that everyone starts to use random mac addresses, you still can't identify specific persons based on their randomized mac addresses when they change them every time they reconnect.

Re: Randomize your WiFi MAC address on Ubuntu

#85

Here is the code I use for my mac to randomize my mac address: interface="en0" new_mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/:$//; s/./0/2') # from stackoverflow sudo ifconfig $interface ether $new_mac Edit: What's the advantage of the solution in the post? If I just change my mac address every time I join a network (even the same one), they can't track me with my randomized mac addresses. So why would I pre…

Some bits of the MAC address are significant. You're generating all 48 bits randomly which could have some side effects.

Would love to know which side effects there are. I've never encountered any problems in all those years I use those randomly generated mac addresses.

Re: Randomize your WiFi MAC address on Ubuntu

#86

Earlier quoted context omitted.

Would be interested where that happens because I've never encountered something like this (binding the mac to the access) in public networks e.g. McDonald's, hotels and other shops. I did only get access codes which could be used for a specific time where I just changed my mac address. I only know about mac whitelisting in protected networks managed by wary administrators.

All of the universities I attended used MAC address whitelisting.

> I only know about mac whitelisting in protected networks managed by wary administrators.

Wouldn't make any sense for properly securing a network. As an attacker you could just create an evil twin (same ESSID), let some students connect to it and just use their mac addresses (and even drop their connections when they try to use the university wifi).

Edit: You don't even necessarily need an evil twin to get their mac addresses. You only have to listen to the wifi traffic and get some - even encrypted data packets still contain the raw mac address as far as I know. airodump-ng is the perfect tool to do that.

Re: Randomize your WiFi MAC address on Ubuntu

#87

Earlier quoted context omitted.

Your adversary probably isn’t the NSA, it’s commercial tracking services. Their business is tracking the general public, they don’t care about one weird person. Unless avoiding this becomes common practice and then the whole story changes.

Yes, this is also my reasoning. > Unless avoiding this becomes common practice and then the whole story changes If that means that everyone starts to use random mac addresses, you still can't identify specific persons based on their randomized mac addresses when they change them every time they reconnect.

No but it would make more sense to start tracking then based on their other behavior.

Re: Randomize your WiFi MAC address on Ubuntu

#88
post #70

Here is the code I use for my mac to randomize my mac address: interface="en0" new_mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/:$//; s/./0/2') # from stackoverflow sudo ifconfig $interface ether $new_mac Edit: What's the advantage of the solution in the post? If I just change my mac address every time I join a network (even the same one), they can't track me with my randomized mac addresses. So why would I pre…

new_mac=$(openssl rand -hex 4 | sed 's/\(..\)/\1:/g; s/:$//; s/./0/2'; s/^/02:/) is better. by using the 02: prefix for locally administered macs you avoid clashes with certain cards. I also used to randomize my local hostname.

Most of the time there are > I also used to randomize my local hostname

Great idea, missed that. I'll integrate that in the future.

Re: Randomize your WiFi MAC address on Ubuntu

#89
post #28

Earlier quoted context omitted.

Because maybe you had to pay to access the network and part of that involved binding your mac address. For example, calling the hotel desk to get your device to work.

Would be interested where that happens because I've never encountered something like this (binding the mac to the access) in public networks e.g. McDonald's, hotels and other shops. I did only get access codes which could be used for a specific time where I just changed my mac address. I only know about mac whitelisting in protected networks managed by wary administrators.

In Canada, the ISP shaw offers ShawOpen for subscribers. There are hotspots all over the place, access control by MAC address. So I would need to provide a consistent MAC address to that SSID.

Re: Randomize your WiFi MAC address on Ubuntu

#90
post #72
post #52

Where would MAC address capture occur on the network? MACs are local to L2 traffic, so once a frame turns into a packet and is routed, the sMAC of your PC is no longer present in the data. If you're on your home network, this has no impact what so ever.

Actually, this is no longer true. An autoconfigured IPv6 address can leak your MAC address, depending on your settings, as one mechanism for autoconfiguration embeds your MAC address right into your IPv6 address.

I have Fibre to the Home at 1Gb/sec, but so far, they do not support IPv6. That's something interesting for me to look into though, so thank you. I was providing ADS-B flight data to a website, and then I realized that they were posting my MAC, my NAT'd IP, and my GPS location to the world. That L7 will get ya every time.
Post reply on HN