MAC address spoofing failing

8,276

If you wish to change mac address the simplest way is to use command

sudo ifconfig wlo1 down
sudo ifconfig wlo1 hw ether  xx:xx:xx:xx:xx:xx
sudo ifconfig wlo1 up

xx:xx:xx:xx:xx:xx - represents "new" mac address

You do not need macchanger. Try this:

  1. disconnect from wifi via NM

  2. in terminal run command

    sudo ifconfig wlo1 hw ether  xx:xx:xx:xx:xx:xx
    
  3. connect to wifi via NM

Share:
8,276

Related videos on Youtube

Reepca
Author by

Reepca

Updated on September 18, 2022

Comments

  • Reepca
    Reepca almost 2 years

    I've been trying to spoof my MAC address for a while now, because I want my brother's laptop to be using my data allowance at college (I don't use much bandwidth, most of mine goes to waste) and for some reason there isn't an option at their internet access site to un-register a device, and it can only be registered to one person at a time. Here is what I have tried (the network interface in question is named wlo1):

    First I tried the simple approach. I clicked on the wireless icon in the top-right corner, clicked "edit" connections, made a new connection with the same SSID but with a different MAC address in the "cloned MAC Address" field. I saved it and attempted to connect to it, but after about a minute of failed attempts it gave up and connected to it using the old MAC address.

    Then I tried the CLI approach. I found that no matter what, any time that network-manager started, my changes made with ifconfig were reset. Additionally, all changes made with ifconfig while network-manager was running were completely ignored. sudo ifconfig wlo1 hw ether XX:XX:XX:XX:XX:XX would change it (according to ifconfig wlo1) despite giving an error message (SIOCSIFHWADDR: Too many open files in system , and YES I've checked ulimit and it isn't a problem with that), but would have no impact on network-manager, and any attempt to restart network-manager resulted in all changes being reset. Finally, thinking that a CLI utility dedicated to this task should be up to it, I tried the following:

    sudo service network-manager stop
    sudo ifconfig wlo1 down
    sudo macchanger -a wlo1
    sudo ifconfig wlo1 up
    sudo service network-manager start
    

    sudo macchanger -a wlo1 failed with the output:

    Current MAC:   <random MAC address from previous attempt> (Action Technology (SZ) Co., Ltd)
    Permanent MAC: <consistent same thing as always> (unknown)
    [ERROR] Could not change MAC: interface up or insufficient permissions: Too many open files in system
    

    I'd like to remind you once again that I did check ulimit -n, and it is not a problem there.

    So, in summary: attempts at manually changing with ifconfig and other tools think they fail, but apparently actually change the MAC address, without having any effect whatsoever on my connections. network-manager can't successfully spoof a MAC address because... I have no idea. It silently fails to connect and I'm too dumb to know where to look for error messages. I have no clue why something this simple is so difficult for my software to do. Frankly, I suspect that this is Broadcom bullcrap at it again, in which case my options amount to kicking a cat or something. I hope that is not the case.

    Relevant information:

    • Laptop: some HP thing of my brother's, Pavillion something with a 17" screen.
    • Wireless Card: Broadcom BCM43142
    • Driver: WL

    • Distribution: Ubuntu 15.10

    • Patience: Very stretched. If I still had much patience, I wouldn't be writing this.

    How can I try to find what is causing the problem and fix it? I don't know where the bugs lie, and frankly they seem to be everywhere. Is there a way to confirm or disprove that the issue lies in the driver? I did some looking-up and found that /var/log/syslog had TONS of <warn> (wlo1): failed to set MAC address to XX:XX:XX:XX:XX:XX messages, where those X's are basically anything. It failed to set MAC addresses even to the same value it already was!

    Is the WL driver just especially suckish? Am I going to have to go talk to an administrator to try to get my brother's laptop un-registered?

    More information: I successfully changed the MAC address of a different system, a desktop with an ethernet connection. I did this using the GUI provided by network-manager. As indicated above, the /var/log/syslog of the laptop with the problems is full of error messages indicating that network-manager is having problems setting MAC addresses. If it's at all possible, a solution that lets me keep using network-manager would be great. I'm not sure how to proceed without network-manager, and I am not sure whether changing the MAC address via ifconfig is actually changing it or only causing it to appear to be changed, since it gives an error message but still shows up with the new value. Should I try to get a working setup that doesn't use network-manager, or try to further track down the problems it has been having?

    • MKay
      MKay about 8 years
      Try macchanger, is a software that is preinstalled in pentesting distro like Kali, but it should be also in Ubuntu repo.
    • muru
      muru about 8 years
      @MKay "sudo macchanger … failed …"
    • MKay
      MKay about 8 years
      From Precise to Xenial it seems to be in repos link for wily package
  • Reepca
    Reepca about 8 years
    As I said in my question, this produces the error message SIOCSIFHWADDR: Too many open files in system. Runing ifconfig wlo1 indicates, however, that it did still change it to the new address. But then I have to ask... what next? Attempting to make a connection at this point results in a connection error until some action is taken with network-manager, at which point it resets the MAC address. I suppose that if I were running without network-manager, this likely wouldn't be a problem, but this is a laptop, and the niceties seem useful. I'm going to add some more info to the question.
  • 2707974
    2707974 about 8 years
    See My edited answer
  • Reepca
    Reepca about 8 years
    Attempting to connect via network-manager causes the MAC address to be reset.