-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macOS Sonoma 14.4 broke macchanger, and ifconfig!? wtfh #2
Comments
Thanks for reporting this issue! I just upgraded to Sonoma 14.4.1 and can confirm the issue. |
I tried to find an alternative to the It would be great if you could test if this code correctly performs disassociation from Wi-Fi. If you have access to older versions of macOS it would also be great to have a positive sign that they are working there. The below code can be compiled using #include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
int main(int argc, char** argv) {
int fd = socket(AF_INET, SOCK_DGRAM, 0);
struct io80211_ioctl {
char ifname[16];
uint64_t type;
uint32_t length;
void* data;
} ioc;
strcpy(ioc.ifname, "en0");
ioc.type = 22;
ioc.length = 0;
ioc.data = NULL;
int res = ioctl(fd, 0x802869c8, &ioc);
if(res == -1) {
perror("ioctl");
return res;
}
return 0;
} |
Genius, how did you even pull this? Works now ! |
Great to hear that, @DarkNero69. Do you have the possibility to test the code on an older system? |
Hey, sorry for the delayed reply. Unfortunately i don't have another computer or any other system. I only got macbook air m1 :/ but this can easily be tested in public computers, though i don't have the time to hit up library at the moment haha |
@shilch The fix is tested to be working on my MBP 13-inch, 2020 running i5. |
Thanks @aaronleetw, @DarkNero69! I developed a new version that supports macOS Sonoma 14.4+ on branch Please let me know if the new version does the job: git clone -b v0.2-draft https://github.com/shilch/macchanger
cd macchanger
make
./macchanger |
@shilch Works on my end! Thank you for your work. |
@shilch It works for me too! I'm not very experienced with the terminal, but I managed to get it working hehe. Amazing work, thank you! It's much simpler and faster to use now =) |
Thank you! I've tested the new v0.2-draft branch on 14.3.1, 14.4 and 14.4.1 and it is functioning OK. Attempting to build on OS X El Capitan 10.11.6 yields the following errors:
However, the previous macchanger.sh functions OK on El Capitan 10.11.6. |
I also noticed that on macOS versions with the v0.2-draft branch, when invoked without root privileges, it will fail to change the MAC address (expected behavior) but it will still disassociate from WiFi (I am not sure if this is desirable?). |
@shilch Hi there, the branch v0.2-draft didn't work on my macOS(Sonoma 14.4.1).
|
Thank you for this. It works with the wifi adapter on my M2 Macbook Air, Sonoma 14.5. But, it does not work with my Belkin USB-C ethernet adapter, i get the error message "interface_set_ether: Can't assign requested address". Any leads? |
Hello. Sorry i haven't been replied to anything yet. First of all, thank you so much for developing such an amazing thing! I haven't changed my mac address lately, but i just tested it by typing "sudo macchanger" to terminal. It seems like it works, managed to change to some random mac address. Thanks! |
Sorry for not responding in a while. @artkiver The compilation error occurs because the ether_addr_t did not exist in El Capitan. That should be an easy fix which I will add. @geek4what Which device are you using? Is the en0 an Airport device? @nilssonalex The tool uses the interface APIs provided by the operating system. If the network driver for this 3rd party device does not implement the possibility to change the mac address, there's nothing that macchanger can do. You would need a driver which has this feature. |
The |
wifi en0. |
For wifi this works great. However, if I try to change the mac address of a wired network, I still get the following error: I use 14.5. The interface is listed as a USB 10/100/1000 device. |
It's because macchanger can't disassociate from the wifi network. Disconnect from wifi yourself, then run macchanger and it will work. Tested on M1 Max MBP running macOS 15 Sequoia beta |
Sadly this didn't work for me in macOS 15 beta (I never tried on macOS 14) |
v0.2-draft, Macbook Pro 16 2021 M1 Pro works fine for wifi en0, but for en4
USB 10/100/1000 LAN: Bus: USB |
Just so I can understand correctly, with nothing plugged into your Mac (no hardwire internet connections, or network adapters), you can run Thanks |
Were you connected to wifi on en0 before you ran the command? And what does it show you when you run en4? |
@johndekroon @dennis777 @ASolod82 Thanks for your tests! Can you please check if it works / there are errors for the following cases:
|
Certainly! Here are the results tested on my 21 MacBook Pro M1 Max macOS 15.0 beta (shouldn't be any different for 14 as airport is deprecated there as well) Using the v0.2-draft versionResult: Does not disassociate from wifi, thus not changing the Mac address Using the master version but disassociating using this snippetResult: does not disassociate but prints a message
So then as expected, the macchanger doesn't work because it doesn't disassociate using that snippet seems like ioctl() call isn't working in disassoc.c Using the master version but disassociating using the macOS UIHope this helps! Let me know if theres anything else I can test @shilch |
Thanks @dennis777, I guess that Apple changed the interface to disassociate WiFi in one of the recent versions ("Operation not supported on socket" hints at an API change). |
Ah okay I didn't know about this tool until after I updated to the beta. I will play around with those dumped headers and see if I can come up with anything in the meantime. But my experience with C is extremely limited. I wish I understood it better 😅 Thank you |
The Is it possible to make it installable by brew? Also the |
Which model of Mac do you use and what version of macOS? |
v0.2-draft not working for me. I have macOS 14.6.1 (23G93) and trying to change mac for my ehternet en6. interface_set_ether: Can't assign requested address |
Still seemed to be functioning OK for me with 14.7. However with macOS 15.0, it seems as if WiFi must be manually turned off, then back on, otherwise this error is encountered:
My guess is something changed with macOS Sequoia that broke the recent disassoc.c iteration? |
Need to manually disassociate to work on 15.2. |
Hi everybody, sorry for the silence. I found a solution that automatically disassociates the wifi on newer macOS versions. Successfully tested on 15.2. I pushed the draft to a new branch Please let me know if this solution works for you and which version of macOS you are using.
|
@ldoench Once a working v0.2 is released I will make macchanger brew-installable. |
@shilch Confirmed it works 15.2! Thank you! Was the solution to rewrite it in Objective-C? Does apple not expose some API in C that is required to do the disassociation? |
@dennis777 Perfect! Actually, I just realized that I hardcoded the interface name for disassociation to The solution was to use CoreWLAN.framework, which is used by the WiFi dropdown in the status bar. The previous solution I posted reimplemented the disassociation from IO80211.framework, but that library seems to be broken as of some time ago. CoreWLAN.framework does not expose a C API (officially). There are still traces of the Apple internal MobileWiFi.framework, but I believe it has been discontinued and I don't want to depend on it for macchanger to break again. |
@shilch Makes sense Apple dropped IO80211 support. I wonder if packet sniffing and frame injections are possible using the CoreWLAN.framework? Sniffing should be as there is a built in sniffer but I don't know If frames injections are. Do you think it's possible to for example send the deauth frames? |
After having a short look, it looks like this is possible using a |
That is the project I found years ago and am trying to rewrite but unfortunately no dice. I think apple may have disabled frame injections on a hardware level or something because the application doesn't even scan. Previously it would just crash. Also it's not possible to even compile the project now due to some signing issue. Anyway thanks just was curious if you knew more. |
I've confirmed that the v0.2-draft2 branch is working like a charm for me on 15.2 as well. Unfortunately, last summer, someone broke into my car and stole two laptops (including a 2012 MacBook Pro I used for testing older OS versions) so I can't test more extensively at the moment. I noticed someone else in the thread mentioned brew; and I am a MacPorts maintainer and have considered creating a Portfile for macchanger for MacPorts. Especially now that it seems to be functioning again without issue on the most -CURRENT non-beta OS release, I may look into that again (though others are welcome to contribute such things)! I would generally dissuade security minded folks (as I assume most who are randomizing MAC addresses presumably are) from using brew entirely given that it has analytics on by default (information on how to disable them here: https://docs.brew.sh/Analytics) whereas MacPorts only has anonymous analytics gathered if users choose of their own volition to install mpstats (more information on that here: https://ports.macports.org/port/mpstats/) Moreover, MacPorts was co-founded by jkh (Jordan Hubbard) who was a co-founder of FreeBSD and previously "Director of Engineering of Unix Technologies" at Apple for a dozen some odd years and can be thought of as the complementary /usr/ports in a BSD system for OS X/macOS whereas brew is a bit NIH syndrome. In particular, MacPorts makes an effort to automate testing on many versions of macOS/OS X (going back to at least Leopard, though some users report still having success with it on Tiger) whereas brew only tends to focus on the current and last two macOS releases. |
I already submitted Feedback to Apple, but figured I would report things here too in case someone may discover a workaround.
macchanger worked without issues on macOS 14.3.1.
After updating to 14.4:
Worse, this doesn't seem to be unique to macchanger; ifconfig seems broken on macOS 14.4 Sonoma as well:
Tested as broken on two Apple Silicon devices which previously functioned OK with macchanger on 14.3.1.
The text was updated successfully, but these errors were encountered: