halo / LinkLiar

:link: Link-Layer MAC spoofing GUI for macOS
http://halo.github.io/LinkLiar
MIT License
1.23k stars 84 forks source link

Does this work automatically based on an interval or it's just manual #11

Closed aziz closed 9 years ago

aziz commented 10 years ago

Can this app automatically change the Mac addrress based on an interval or everything is manual?

halo commented 10 years ago

This application needs superuser privileges to change the MAC address. Unfortunately, it is not trivial to get those privileges.

When I made this application, I didn't feel that I wanted to dig into all of that, so I worked around it by actually running a simple AppleScript under the hood to change the MAC address.

The advantage of that is, that it's just one line of code instead of a hundred. The disadvantage is that I cannot retain the privileges, but I have to ask the user again and again for every address change. So no, I cannot have intervals with the current setup because I'd have to ask for the root password at each interval.

Your question is somewhat related to this issue. In order to ensure that the MAC address always is what you want it to be, I would not only have to change it at system startup (via some privileged launch deamon) but also check the address in intervals to make sure no other process changed the address meanwhile.

What's your use case by the way?

aziz commented 10 years ago

Right now I'm using this simple shell script to randomise mac address and this plist to run it with launchctl on boot. Although, it works but monitoring, usage and setup is a pain in the ass. I would love to have a pref pane application to do this.

halo commented 10 years ago

I like this. The ideal solution would be to have LinkLiar as a GUI to change the settings (always random? random at startup? always this specific one? monitor in the background? warn in the menubar?) and to install/start/stop the daemon (asking for the root password for that, only once).

The script could be anything, bash, preferably ruby, or even an objective-c command line app (for better interface detection). It would look up the current settings in some plist file in Application Support on each interval. This would also solve issue #1

I want this too, I should ask myself whether I have time to implement this ;)

halo commented 10 years ago

So, I'm experimenting around with this but I'm not sure about some things...

People who use this tool try to not leak their MAC address at all to any network. However, only when the interfaces are activated, I can change the MAC address. E.g. I cannot change the MAC of the Airport unless the Airport is activated and not associated. That is not at boot time, but at any time. Think of Thunderbolt or USB Ethernet adapters which could be plugged in at any time. There is no way to prevent a MAC address leak.

Now, I don't want to poll every minute for all interfaces, that's just not right. I could, however, hook into whenever the Network Configuration changed (e.g. the user plugged in an Ethernet adapter) and check then. But then I could not guarantee that the MAC is not leaking. Alternatively, I could bring up the Airport, change the MAC, and deactivate it again. But that only works for the in-built interfaces.

aziz commented 10 years ago

preventing MAC address leakage might be one reason to use it. for me it's more about privacy and getting protection from trackers that are trying to track your location and behaviour based on the MAC address of devices you have.

halo commented 9 years ago

Hi! Would you mind giving the latest release a try? I need beta testers ;) My goal ist to change the MAC not per interval but whenever the interfaces change.

aziz commented 9 years ago

Great job man, I'll try it now. :+1:

halo commented 9 years ago

Make sure to use version 1.0.1 from https://github.com/halo/LinkLiar/releases (or higher if available). Because I found a bug in 1.0.0 which caused the MAC address to be randomized again whenever the synchronization between the menu and the interfaces runs...

aziz commented 9 years ago

Just did! thanks :)

halo commented 9 years ago

So it seems that there is no way to detect if the end user just entered sudo ifconfig en0 ether aa:bb:cc:dd:ee in a Terminal manually (I subscribed to every System Configuration notification but none was triggered when I did that).

But I improved the interface change detection so that when any Interface comes up or down, the MAC addresses of every interface are synchronized with what you set in the status menu.

Your preferences are stored in the usual application preferences file. You can read those settings with defaults read com.funkensturm.Link.plist and even write them manually. The file is located in ~/Library/Preferences/com.funkensturm.Link.plist.

Closing this issue for now.