5,599,478 Members 38,863 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Spoofing MAC address on the Nexus 7 FLO with KitKat

Tip us?
 
Jonhoo
Old
#1  
Junior Member - OP
Thanks Meter 1
Posts: 5
Join Date: Jun 2011
Prompt [Q] Spoofing MAC address on the Nexus 7 FLO with KitKat

I recently bought a Nexus 7 Flo tablet running the latest Android 4.4. I've since been trying to spoof a MAC address on it, but for some reason the wireless card seems to refuse to use the spoofed mac no matter what I do.

There's a more detailed discussion what I've tried in android.stackexchange.com/questions/57922/wifi-network-not-accessible-with-modified-mac-address (forum won't let me link), but I'll repeat the main points here. I have tried both ip link set wlan0 address XX:XX:XX:XX:XX:XX and busybox ifconfig wlan0 hw ether XX:XX:XX:XX:XX:XX. They both result in the MAC address being changed as far as I can tell from the output of ip link and busybox ifconfig, but when connecting to a network with MAC filtering with the spoofed MAC address being allowed, the device fails to connect. /sys/class/net/wlan0/address also shows the spoofed address. If I use the device's stock MAC and add this to the filter on the AP, then the device connects successfully.

Has anyone experienced anything similar on KitKat devices?
The Following User Says Thank You to Jonhoo For This Useful Post: [ Click to Expand ]
 
pan.droid
Old
#2  
pan.droid's Avatar
Senior Member
Thanks Meter 109
Posts: 285
Join Date: Oct 2010
Quote:
Originally Posted by Jonhoo View Post
Has anyone experienced anything similar on KitKat devices?
Haven't tried anything, yet. Just wondering if you've had any success with this since it's been a while. Thanx=)
 
Jonhoo
Old
#3  
Junior Member - OP
Thanks Meter 1
Posts: 5
Join Date: Jun 2011
Quote:
Originally Posted by pan.droid View Post
Haven't tried anything, yet. Just wondering if you've had any success with this since it's been a while. Thanx=)
No, unfortunately not. I ended up buying a Samsung Galaxy S II where I can change the MAC successfully for demo purposes. I would still really like to get this working on an up-to-date tablet though..
 
pan.droid
Old
#4  
pan.droid's Avatar
Senior Member
Thanks Meter 109
Posts: 285
Join Date: Oct 2010
Bummer. Okay, thanx.

---------- Post added at 03:54 PM ---------- Previous post was at 03:53 PM ----------

This is hopeful, but not a silver bullet... http://forum.xda-developers.com/show....php?t=2180809
 
Jonhoo
Old
#5  
Junior Member - OP
Thanks Meter 1
Posts: 5
Join Date: Jun 2011
Quote:
Originally Posted by pan.droid View Post
This is hopeful, but not a silver bullet... http://forum.xda-developers.com/show....php?t=2180809
Interesting...
There seems to be a couple of suggestions here that I will try when I get back to work next week:
- Enable Airplane mode before changing the MAC, then turn airplane mode off again and your WiFi should work
- Deleting /persist/wifi before changing the MAC
- Using this spoofing app
 
Jonhoo
Old
#6  
Junior Member - OP
Thanks Meter 1
Posts: 5
Join Date: Jun 2011
Good news everyone!
/persist/wifi/.macaddr seems to be the key to changing the MAC, *and* it allows the MAC to be changed *permanently*!

Code:
$ adb shell
$ su
# cd /persist/wifi
# echo -n "112233445566" > .macaddr
# ^D
$ ^D
$ adb reboot
And voilą, MAC changed even after reboot, and connects without a problem!
 
tmagritte
Old
#7  
Senior Member
Thanks Meter 19
Posts: 238
Join Date: Oct 2010
Quote:
Originally Posted by Jonhoo View Post
Good news everyone!
/persist/wifi/.macaddr seems to be the key to changing the MAC, *and* it allows the MAC to be changed *permanently*!

Code:
$ adb shell
$ su
# cd /persist/wifi
# echo -n "112233445566" > .macaddr
# ^D
$ ^D
$ adb reboot
And voilą, MAC changed even after reboot, and connects without a problem!
Hi,

I stumbled upon your post. I'm trying to do the same on my Nexus 5. I found your method works in changing my MAC address but it doesn't change to the string I put in the quotes. What I found is that the address I end up with is the unicode values of the first 6 characters. Is there some special format for this file?

Thanks!
 
Jonhoo
Old
#8  
Junior Member - OP
Thanks Meter 1
Posts: 5
Join Date: Jun 2011
Quote:
Originally Posted by tmagritte View Post
I found your method works in changing my MAC address but it doesn't change to the string I put in the quotes. What I found is that the address I end up with is the unicode values of the first 6 characters. Is there some special format for this file?
Hmm, that's quite strange. From what I remember, simply using echo worked fine for me.
What you can do instead is this:
Code:
echo -ne '\x11\x22\x33\x44\x55\x66' > .macaddr
Let me know if it works!
 
tmagritte
Old
#9  
Senior Member
Thanks Meter 19
Posts: 238
Join Date: Oct 2010
Quote:
Originally Posted by Jonhoo View Post
Hmm, that's quite strange. From what I remember, simply using echo worked fine for me.
What you can do instead is this:
Code:
echo -ne '\x11\x22\x33\x44\x55\x66' > .macaddr
Let me know if it works!
Brilliant!

Thanks so much!

---------- Post added at 01:31 PM ---------- Previous post was at 01:31 PM ----------

I'm guessing for some reason on the Nexus 7 it uses a text file but a binary file on the Nexus 5...
 
tmagritte
Old
#10  
Senior Member
Thanks Meter 19
Posts: 238
Join Date: Oct 2010
I also found a couple of ways to activate the new MAC address without requiring a reboot. This is useful if you want to be able to change MAC address dynamically using Tasker or similar.

The least obtrusive method I found is adding:
busybox ifconfig wlan0 down
busybox ifconfig wlan0 up

commands after the echo command. This will briefly turn off the WiFi adapter and when it comes back on it will have the new MAC address. I actually found the busybox ifconfig wlan0 up command isn't strictly necessary, at least on the Nexus 5, as it seems to get reactivated automatically after you take it down.

You can confirm the new MAC is in effect by opening a new terminal emulator window and running:
busybox ifconfig wlan0

Interestingly, if you go into Wifi Settings, under advanced settings it still shows the old MAC address but the WiFi adapter is clearly running with the new one as indicated by ifconfig and the ability to connect to a MAC filtered router.

Alternatively, toggling on then off airplane mode will also activate the new MAC and it even shows the new MAC under the advanced WiFi settings.

I like the first option as you'd be able to automate dynamic changes for a particular network without the risk of interrupting voice or cellular data connections when it happens.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

A More Competitive Spin on the Addictive 2048 Puzzle

You may recall that a few weeks ago, we talked about a rather interesting take on … more

Multiboot in Progress for the Sony Xperia Z1

As we’ve mentioned quite a few times in the past, multiboot is quite the interesting … more

Samsung EFS Tool Updated to V5, Brings Universal Device Support

You may recall that we’ve talked about XDA Recognized Contributor … more

Say Goodbye to Holo Blue Once and for All

When Google released Android 4.4 KitKat back in October of last year, they changed quite a bit … more