Not able to spoof MAC address in Kali Linux

7,150

Just save this code in to a bash script (changeMac.sh) and try running it with elevated permissions (sudo bash changeMac.sh) when you wanna change the mac address.

service NetworkManager stop
ifconfig wlan0 down
macchanger -r wlan0
ifconfig wlan0 up
service NetworkManager start
Share:
7,150

Related videos on Youtube

levi1696
Author by

levi1696

Updated on September 18, 2022

Comments

  • levi1696
    levi1696 over 1 year

    The MAC address is spoofed when the network interface is down or not connected to any AP. But as soon as I connect to any access point it changes the spoofed MAC address to the original address.

    I tried the following to spoof my MAC address:

    ifconfig wlan0 down
    macchanger -a wlan0
    ifconfig wlan0 up
    

    Even tried to stop and start network-manager with the above command still nothing.

    I also changed the MAC changer command with this:

    ifconfig wlan0 hw ether XX:XX:XX:XX:XX:XX
    

    And still no luck.

    The /etc/NetworkManager/system-connections/ has stored the original MAC address and changes the spoofed address to the original. When I disconnect from the network, the MAC address is changed back to the spoofed address.

    When I open the “Settings > Networks,” and go to the AP's settings, I am able to set a clone address and it works perfectly. But I want to be able to change the MAC address from the terminal itself, so I don’t always have to go to the settings to change it.

    I even tried to forget the AP and set a new connections with spoofed MAC address, still it always seems to revert back to the original address.