halo / LinkLiar

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

Possibly broken in Monterey #44

Closed OKNoah closed 2 years ago

OKNoah commented 3 years ago

When I try the command ifconfig en0 ether f9:e8:15:e3:39:dd (as sudo or not), I get the message

ifconfig: ioctl (SIOCAIFADDR): Operation not supported on socket

So I downloaded this app hoping it might work, just no joy. No error or anything, the MAC just stays the same no matter the settings.

halo commented 3 years ago

Hi! Thank you for your report. I'm always glad to see beta testers 😄

Under the hood, LinkLiar does exactly that - run the ifconfig command. And if the command works, LinkLiar will work. If it doesn't work manually, LinkLiar won't be able to do much either.

So, first you'd need to figure out whether it is generally supported on Monetery. You might remember that spoofing stopped working altogether some time ago and it was a mistake by Apple. It could be the same now.

What I do know is that not all MAC addresses work. So please try a dozen different addresses and if all fail, we're probably out of luck until this issue get's wider attention and eventually reaches Apple (still hoping they did not deactivate this on purpose, but I do not think they would do that)

Final question: did it work on that very machine before installing Monterey?

halo commented 2 years ago

Hi! 👋🏻 Any news on this?

Dbrunello commented 2 years ago

Hello, on Monterey and in mac m1 link Liar Don't work.

halo commented 2 years ago

Hi @Dbrunello

Thank you for your report. Please be more specific on what you mean by "don't work".

Also, please read my previous post (higher up on this page) carefully and try the things I suggested there and let me know the results.

Thank you!

Dbrunello commented 2 years ago

ok, the Mac address of my wifi card don't change with o error or anything.

halo commented 2 years ago

Ok, MAC address spoofing may not be possible with Monterey at all.

https://developer.apple.com/forums/thread/684745

I suspect that Apple is moving towards built-in random MAC addresses just as it has been a feature of iOS for many years. But that's just a guess.

It could also simply be the same bug that Apple accidentally introduced in 2018 and then fixed a year later.

andrew7321999 commented 2 years ago

OK, the problem is slolved for me. Currently using 12.1(21C52) Monterey, M1pro MacBook pro. you set the MAC address on Linklier, and try reboot. It works for my MacBook and MacBook pro 2017 with intel i7 processor.

Probably there is a moment that "ifconfig en0 ether xx:xx:xx:xx:xx:xx " works on terminal while its booting. make sure you add linklier on Login Items(Preference-User and Groups-Login Items) Hope this helps you.

P.s. I survive in school with using teachers wifi with arp -a command. Haha.

halo commented 2 years ago

Probably there is a moment that "ifconfig en0 ether xx:xx:xx:xx:xx:xx " works on terminal while its booting. make sure you add linklier on Login Items(Preference-User and Groups-Login Items)

That's interesting. Well, it should be enough if you have this option turned on:

screenshot

The LinkLiar "app" ist just a menu bar GUI that does nothing in itself. It is the background daemon that really does all the work. If you check that checkbox, the daemon is activated on boot (even before you log in!).

Adding the LinkLiar "app" to your login items only becomes active after you logged in. By that time, the daemon was already active.

I'll close this for now. If there are any more Monterey-related questions, feel free to re-open this issue.

cyb3rw0lf commented 2 years ago

Would be great to have the monterey fix implemented in the app as described in this post

MAC address spoofing not working in macOS 12 Monterey - https://developer.apple.com/forums/thread/684745?answerId=707230022#707230022

First, disassociate from any network: sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z

Then change your lladdr: sudo ifconfig <intf> lladdr 00:bb:cc:dd:ee:ff

Then rejoin the WLAN normally.

halo commented 2 years ago

I can confirm that changing the MAC address is not possible on Monterey while connected to a network. So, I changed LinkLiar to disassociate from any network before attempting to change the MAC address.

Originally, it looked to me that LinkLiar was working just fine on Monterey. That is because the LinkLiar daemon changed the MAC address on boot before any network was connected to. I didn't notice that after that the address could not be updated to something else.

Then rejoin the WLAN normally.

I'm not sure about this yet and will have to think about it first. I'm afraid there might be edge cases (e.g. on boot) where one doesn't want to automatically re-associate. Also, I'm not sure it's possible using Swift or possible using the CLI.

Do you know of a way to (re-)connect to a Wi-Fi without knowing the password in macOS and without using the trackpad? :)

halo commented 2 years ago

This is the pre-release, I'd appreciate if you try it out and let me know whether it works:

https://github.com/halo/LinkLiar/releases/tag/3.1.0

cyb3rw0lf commented 2 years ago

From CLI it work this way

  1. Fetch SSID name: airport -I
  2. Change MAC Address
  3. Disconnect from current WLAN airport -z
  4. Reconnect to previous WLAN /usr/sbin/networksetup -setairportnetwork en0 SSIDNAME

Maybe it also work with swift is not specifying any password (no idea)

  func connect(to name: String) {
      interface?.associate(name: SSIDNAME)
  }
cyb3rw0lf commented 2 years ago

This is the pre-release, I'd appreciate if you try it out and let me know whether it works:

https://github.com/halo/LinkLiar/releases/tag/3.1.0

For me it doesn't disassociate, so unless I manually do the disassociation it doesn't work. (same as previous build)

halo commented 2 years ago

Then you installed the new version, did it ask you to "Re-Authorize LinkLiar" (that is, the daemon)?

Let's try to confirm that you have the right version version installed.

Do you have version 3.1.0?

Screen Shot 2022-04-25 at 20 01 18

Can you try "Install Daemon"?


/usr/sbin/networksetup -setairportnetwork en0 SSIDNAME

You are right, this works! It's a bit brittle to connect to a SSID instead of a BSSID, but it should be good enough.

halo commented 2 years ago

I've updated the version to 3.2.0. It now re-associates to the network it was connected to. If you could give it another try.

I think I'll have to add an option to disable this feature, I'm not sure yet.

cyb3rw0lf commented 2 years ago

I've updated the version to 3.2.0. It now re-associates to the network it was connected to. If you could give it another try.

I think I'll have to add an option to disable this feature, I'm not sure yet.

yes it works! thanks

There's a weird behavior if I have two SSID both with auto-join and I'm connected to SSID1, when I click to change mac address on linkliar it connect to SSID2 afterwards. There might be some internal behavior that kicks in before your command? Something like if it disconnect from one SSID after a while it tried another one. Did you put a sleep or timeout between the mac change and the SSID reconnect?

Edit: It doesn't do it all the time. I noticed that even with only one SSID it disconnects twice tough:

  1. Click Random on linkliar
  2. Disconnect from SSID
  3. Reconnect to SSID
  4. Disconnect from SSID
  5. Reconnect to SSID
cyb3rw0lf commented 2 years ago

if I run the command via CLI it also connect twice actually so I think nothing we can do there but the reconnection is much faster compared than when I do it on linkliar

airport -z && sleep 1 && ifconfig en0 ether 00:bb:cc:dd:ee:dd && sleep 1 && networksetup -setairportnetwork en0 SSID1