I've successfully spoofed my MAC address on HTC Sensation using
Code:
su
ip link set wlan0 XX:XX:XX:XX:XX:XX
But the problem is that I can not connect to any network after this. LogCat says:
Code:
04-26 00:20:08.752: W/wpa_supplicant(14564): [EAP-MSG] EAP [email protected]: eap_methods not available
If I restart Wi-Fi interface using settings or with cmmands
Code:
busybox ifconfig wlan0 down
busybox ifconfig wlan0 up
MAC address resets to its default value. May be there is a way to restart wpa_supplicant separately? I have no ideas, so all thoughts are welcome.
P.S. With spoofed MAC address I can not even connect to open networks. Unfortunately I can not provide a logcat for that case.
Did you manage to make it?
I've encountered just the same problem. Waiting for a solution...
Nope, I did not solve this problem.
Sent from my HTC Sensation Z710e using xda app-developers app
Related
I use:
busybox ip link set wlan0(or eth0) address XX:XX:XX:XX:XX:XX
To change Mac address on android, it need root, terminal emulator and busybox.
It work at the first time or second. But need to be done aigain every time we want to connect a wireless.
Insted of turn the wifi off and on and quickly run the command.(the command need to run before the wifi turn on complete).
I use the terminal with su:
svc wifi disable
svc wifi on
(need to wait 0.5s to proced)
busybox ip link set wlan0(or eth0) address XX:XX:XX:XX:XX:XX
and its done .
it will be great if an app developer can make an app to run this command automatically when we want to connect to wifi. it will make the mac address not permanent but almost.
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?
Jonhoo said:
Has anyone experienced anything similar on KitKat devices?
Click to expand...
Click to collapse
Haven't tried anything, yet. Just wondering if you've had any success with this since it's been a while. Thanx=)
pan.droid said:
Haven't tried anything, yet. Just wondering if you've had any success with this since it's been a while. Thanx=)
Click to expand...
Click to collapse
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..
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/showthread.php?t=2180809
pan.droid said:
This is hopeful, but not a silver bullet... http://forum.xda-developers.com/showthread.php?t=2180809
Click to expand...
Click to collapse
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
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!
Jonhoo said:
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!
Click to expand...
Click to collapse
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!
tmagritte said:
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?
Click to expand...
Click to collapse
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!
Jonhoo said:
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!
Click to expand...
Click to collapse
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...
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.
tmagritte said:
The least obtrusive method I found is adding:
busybox ifconfig wlan0 down
busybox ifconfig wlan0 up
Click to expand...
Click to collapse
I tried using the approach above to reset the MAC on-the-fly, but it doesn't seem to work on my Nexus 5 4.4.4.
For now I'm sticking with "reboot" at the end of my .sh script, which works well. Any thoughts / advice are appreciated. Thanks!
great but
Jonhoo said:
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!
Click to expand...
Click to collapse
helo i tried u r method and i succeed the problem its gaining random mac address not specified mac address i would like to copy iPhone mac address to my android but it is failed please help me
Hi everyone,
Does anyone know how to remove this method of mac change and go back to the original?
Many thanks!
plz tell me how to change mac address....
You're on ROOT?
nijom said:
You're on ROOT?
Click to expand...
Click to collapse
Yep, I had rooted My Moto E, and used the below commands in terminal :-
su //to get the root access
busybox ifconfig wlan0 hw ether 00:11:22:33:44:55 //to change the mac address
busybox ifconfig // It shows the mac changed
Now if I go to system -> Wireless mac address to crosscheck, it's still shows me the old one
I had rebooted the phone, and checked the mac address under terminal using "busybox ifconfig" - it's restored to old (real one) :crying:
Any suggestions, where I am doing it wrong ?
Thanks!
kamalpal said:
Yep, I had rooted My Moto E, and used the below commands in terminal :-
su //to get the root access
busybox ifconfig wlan0 hw ether 00:11:22:33:44:55 //to change the mac address
busybox ifconfig // It shows the mac changed
Now if I go to system -> Wireless mac address to crosscheck, it's still shows me the old one
I had rebooted the phone, and checked the mac address under terminal using "busybox ifconfig" - it's restored to old (real one) :crying:
Any suggestions, where I am doing it wrong ?
Thanks!
Click to expand...
Click to collapse
Check it out, this might help you http://forum.xda-developers.com/showthread.php?t=2286440
Hi guys
anyone can change mac of s5830I?
I try apps and busybox command but I cant.
can you help me
TNX
my English is bad
danial199 said:
Hi guys
anyone can change mac of s5830I?
I try apps and busybox command but I cant.
can you help me
Click to expand...
Click to collapse
The MAC address is hard-coded on your network interface controller (NIC) and cannot be changed permanently with simple command line from your terminal nor in software level approach. However we can assign a temporary solution for your MAC, which will be reverted back to it's original state after Reboot/Power off .
Requirements :
- Rooted phone
- Busy box app from play store installed
- Terminal emulator from play store :
Know normally your card's interface should be eth0 ( older devices ) or in case of newer phones ( wlan0)
after granting super user permission in terminal ( Su) , type >> netcfg
Code:
busybox iplink show eth0
you may change it to wlan0 , if you are on this interface
Code:
busybox ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX
change the XX to your preference value ( i,e : 00:11:22:33:44:55)
Because of kernel design and absence of monitoring mode support for mac spoofing , this method won't work on protected networks ( ONLY open networks )
and if the lines above don't work for you , try to disable and enable your eth0:
Wifi is ON
su >
Code:
busybox ifconfig eth0 down
busybox ifconfig eth0 hw ether (address)
busybox ifconfig eth0 up
ehsanotaku said:
The MAC address is hard-coded on your network interface controller (NIC) and cannot be changed permanently with simple command line from your terminal nor in software level approach. However we can assign a temporary solution for your MAC, which will be reverted back to it's original state after Reboot/Power off .
Requirements :
- Rooted phone
- Busy box app from play store installed
- Terminal emulator from play store :
Know normally your card's interface should be eth0 ( older devices ) or in case of newer phones ( wlan0)
after granting super user permission in terminal ( Su) , type >> netcfg
Code:
busybox iplink show eth0
you may change it to wlan0 , if you are on this interface
Code:
busybox ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX
change the XX to your preference value ( i,e : 00:11:22:33:44:55)
Because of kernel design and absence of monitoring mode support for mac spoofing , this method won't work on protected networks ( ONLY open networks )
and if the lines above don't work for you , try to disable and enable your eth0:
Wifi is ON
su >
Code:
busybox ifconfig eth0 down
busybox ifconfig eth0 hw ether (address)
busybox ifconfig eth0 up
Click to expand...
Click to collapse
Tnx for answer
after change mac I cant connect to wifi
want a new password but pass is true
danial199 said:
Tnx for answer
after change mac I cant connect to wifi
want a new password but pass is true
Click to expand...
Click to collapse
You are trying to access protected network , which comes with encryption ( WEP/WPA/WPA2 etc etc ) ? What error you are getting from Android OS ? Are you absolutely certain your MAC address is white listed inside the router/modem settings on open network protocol settings of course ?
ehsanotaku said:
You are trying to access protected network , which comes with encryption ( WEP/WPA/WPA2 etc etc ) ? What error you are getting from Android OS ? Are you absolutely certain your MAC address is white listed inside the router/modem settings on open network protocol settings of course ?
Click to expand...
Click to collapse
wpa2
when i connect to network want a password but the password is true
There isnt any listed mac address inside the router
danial199 said:
wpa2
when i connect to network want a password but the password is true
There isnt any listed mac address inside the router
Click to expand...
Click to collapse
Already explained about protected networks and the reason behind it in the first post . You need to set it to 'Open network' ( means no wpa/wpa2/wep etc,,etc) inside the router/modem you are seeking an access.
Maybe not so
I have tried several apps and every possible command in terminal (as root) and although all can successfully change the MAC address, the device is always unable to connect to an access point thereafter. This is a known issue, but unresolved and too frequently denied. I half suspect their are some "political" purposes for withholding the resolution; many have inquired about this, yet only receive pedantic or useless replies. I wonder if there is any correlation to the wifi chipset, or if it's a built-in Android limitation. I know my chipset is very difficult to identify ('demesg | grep wlan0' yields nothing familiar) and that it also seems incapable of monitor mode.
I have scoured many forums for the solution to this and found only a suggestion to change certain files, all which appear to vary between devices, etc.
What I'd like at this point, is and explanation if not a solution. Anyway, I think the OP may have been misunderstood, ergo my 'two cents'.
Hi all,
In order to keep both WiFi and LTE connections working, I tried to start WiFi connections manually. I found following commands working successfully on a Nexus 4 with Android 4.3 (rooted, with busybox):
netcfg wlan0 up
cd /data/misc/wifi/.
wpa_supplicant -B -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
dhcpcd wlan0
However, I met problems when attempting to apply the same methods on a Nexus 6P with Android 8.1 (rooted, with busybox). I run ifconfig instead of netcfg, but I am not sure about following steps.
Should I still use wpa_supplicant? I found it in /system/bin/hw rather than /system/bin. Besides, the configuration file wpa_supplicant.conf has a different format from Android 4.3 (no longer containing ssid and passwords). What is the correct way to assign wlan0 an ssid?
dhcpcd is not available as well. How should I request an IP address for wlan0?
Thanks!