feross / SpoofMAC

:briefcase: Change your MAC address for debugging
https://feross.org/spoofmac/
3.03k stars 269 forks source link

Can't change mac address of typc adapter #106

Closed yukar1z0e closed 2 years ago

yukar1z0e commented 3 years ago

when try to change the mac address of the typc network adapter, the program exit with the following error.

ifconfig: ioctl (SIOCAIFADDR): Operation not supported on socket
Traceback (most recent call last):
  File "/opt/homebrew/bin/spoof-mac", line 138, in <module>
    sys.exit(main(arguments, root_or_admin))
  File "/opt/homebrew/bin/spoof-mac", line 118, in main
    set_interface_mac(device, target_mac, port)
  File "/opt/homebrew/Cellar/spoof-mac/2.1.1_3/libexec/lib/python3.9/site-packages/spoofmac/interface.py", line 540, in set_interface_mac
    spoofer.set_interface_mac(device, mac, port)
  File "/opt/homebrew/Cellar/spoof-mac/2.1.1_3/libexec/lib/python3.9/site-packages/spoofmac/interface.py", line 450, in set_interface_mac
    subprocess.check_call([
  File "/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ifconfig', 'en9', 'ether', '23:47:c4:dd:fb:7c']' returned non-zero exit status 1.
kennhardy commented 2 years ago

I do get exactly the same. Did you get anywhere with this? It works fine on en0 (Wi-Fi) but on on USB-C adapter. Running on MacOS Monterey and Big Sur:

» sudo spoof-mac set 00:16:3E:52:42:2B en9                                                                                                                      
ifconfig: ioctl (SIOCAIFADDR): Can't assign requested address
Traceback (most recent call last):
  File "/opt/homebrew/bin/spoof-mac", line 138, in <module>
    sys.exit(main(arguments, root_or_admin))
  File "/opt/homebrew/bin/spoof-mac", line 118, in main
    set_interface_mac(device, target_mac, port)
  File "/opt/homebrew/Cellar/spoof-mac/2.1.1_4/libexec/lib/python3.10/site-packages/spoofmac/interface.py", line 540, in set_interface_mac
    spoofer.set_interface_mac(device, mac, port)
  File "/opt/homebrew/Cellar/spoof-mac/2.1.1_4/libexec/lib/python3.10/site-packages/spoofmac/interface.py", line 450, in set_interface_mac
    subprocess.check_call([
  File "/opt/homebrew/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ifconfig', 'en9', 'ether', '00:16:3E:52:42:2B']' returned non-zero exit status 1.