3

I'm trying to spoof my MAC address on a modified version of Linux (Android). The main problem is that because it has been stripped down, the ifconfig command has been taken out, and I only can use the ip busybox command.

I've been trying to use:

ip link set address xx:xx:xx:xx:xx:xx dev tiwlan0

However I get this error:

ip: socket: Operation not permitted

Any ideas what's wrong?

1

You can try this if you have chroot and mount command in the Andriod's busybox. (If not, just add them and rebuild the busybox.)

  1. Untar a full Linux filesystem into a disk (networked/nfs) in Android.
  2. Mount it
  3. chroot to that system

You should now have a new shell with full Linux capabilities.

I have a lot of luck and fun with the rootfs from here:

http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/

You should be able get the Ubuntu for ARM release from somewhere on the net as well.

1
  • Actually, that's what I just did. I've got a debian system running inside Android now. I successfully set the new mac address, but it doesn't seem to change anything. I feel like it may not be sending out the new mac address to the hotspot, even though it shows it when I run ifconfig tiwlan0. Would I have to change it permenantly as suggested by many tutorials online by putting a few lines in the /etc/network/interfaces? If I did that within the debian, environment though, it wouldn't carry over to the normal android use, since Android doesn't have an interfaces file in etc.
    – GuyNoir
    Jan 5 '10 at 17:19
4

What I found to work was in stock Android (no root either) get the Android Terminal Emulator from the Market. Type in ip link show to find your WLAN card; mine was eth0 so I will use that as an example. Enter the following:

ip link set eth0 address XX:XX:XX:XX:XX:XX
ip link set eth0 broadcast XX:XX:XX:XX:XX:XX

To confirm that it switched, type in:

ip link show eth0

and it should show the new mac address. I haven't tested if it works on a MAC-filtered router, but I think it should work.

4
  • 2
    That's basically what I had tried. It showed the correct address, but it strangely wouldn't connect.
    – GuyNoir
    May 16 '10 at 1:49
  • Don't set broadcast to anything else than ff:ff:ff:ff:ff:ff, otherwise stuff breaks - including ARP for a start.
    – user1686
    Jul 21 '11 at 8:06
  • the mac resets after restarting the wifi. any ideas how to persist the changes?
    – siamii
    Aug 21 '11 at 7:35
  • Giving me request send failed:permission denied. error on Google Pixel with Pie. Aug 23 '18 at 15:56
-1

only the letters A-F and numbers 0-9 are allowed in a MAC address.

What is the format of a valid MAC address ?

A normal MAC address looks like this: 00:09:5B:EC:EE:F2. It is composed of six octets. The first half (00:09:5B) of each MAC address is known as the Organizationally Unique Identifier (OUI). Simply put, it is the card manufacturer. The second half (EC:EE:F2) is known as the extension identifier and is unique to each network card within the specific OUI. Many access points will ignore MAC addresses with invalid OUIs. So make sure you use a valid OUI code when you make up MAC addresses. Otherwise, your packets may be ignored by the Access Point. The current list of OUIs may be found here.

Make sure that that the last bit of first octet is 0. This corresponds to unicast addresses. If it is set to 1, this indicates a group address, which is normally exclusively used by multicast traffic. MAC addresses with a source set to multicast are invalid and will be dropped.

  • Examples of valid OUIs: 00:1B:23, 08:14:43, AA:00:04 because 0, 8 and A are even
  • Examples of invalid OUIs: 01:1B:23, 03:23:32

In particular, it is recommended that the first octet is 00.

1
  • 2
    Yeah, the xx:xx:xx:xx:xx:xx was just an example. I'm definitely using a correct mac address.
    – GuyNoir
    Jan 5 '10 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.