Search Ali's Blog

Monday, April 21, 2008

HOWTO change iPhone MAC address!



Update: I've published an easier way using BossPrefs

For those who need to spoof their MAC address in the iPhone, follow these instructions:
1. Install Term-vt100 on you iPhone (via the App installer & Conceited Software source, also available in cydia)
2. Open the terminal (default password is "alpine"), if it doesn't ask for password, run 'su' then type 'apline'
-- Do use local terminal rather than SSH since you're gonna change network configuration.
3. Run "ifconfig", and write down you original MAC address as appears in ifconfig output (see snapshot above)
4. Choose fake MAC address (for those who's trying to bypass MAC filtering mechanism, you need to find one, use your imagination.. or sneak to your friends laptop -- avoid MAC conflicts!)
5. Run the following commands on your iPhone
echo "ifconfig en0 ether ORIG_MAC" > ./mac_orig.sh
echo "ifconfig en0 ether FAKE_MAC" > ./mac_fake.sh
chmod +x mac_fake.sh mac_orig.sh
6. We're done, to switch to the new MAC address:
- Run (from terminal) "./mac_fake.sh"
to switch back to your original MAC address:
- Run (from terminal) "./mac_orig.sh"

NOTE: your MAC is restored after iPhone restart
If you wish to make your fake MAC constant:
1. Run
(from terminal or ssh): echo /var/root/mac_fake.sh >> /etc/rc.local
2. Run (from terminal or ssh): chmod 755 /etc/rc.local
3. Restart your iphone

--
Happy hacking.

19 comments:

ernie said...

Thanks for this useful post! Exactly what I was searching for.

th1rt33nth_w4rr10r said...

I think u forgot to put the '"' after ORIG_MAC and FAKE_MAC in the echo command..

Btw, I tried the steps, and when I got to the point where I typed ./mac_fake.sh, it gave me the error:
ifconfig: ioctl (SIOCAIFADDR) : permission denied

Help me.. I need to change my iPod Touch's mac address.. :(

Ali Ayoub said...

Apparently you're not root.
Run 'su root' and then ./mac_fake.sh

If switching to root user didn't work, please see this post:
http://blog.liub.com/2008/05/iphone-terminal-vt100-su-root-problem.html

Or search in my blog for "su root"

Hope this helps,
Ali Ayoub.

th1rt33nth_w4rr10r said...

thx so much!! it works now!! =D

DJ said...

hi! I did all the steps, even "su root ./mac_fake.sh". it asks for the password which is alpine. It seems to work because the terminal says something like: ifconfig en0 (fake mac). But when I go to my router's page and look for attached devices, the old mac address is still in use, if nothing changed...! So, what can I do? any suggestions? (I'm on 2.0.2 iTouch, if this can help...)
fred

Ali Ayoub said...

DJ,

1. make sure that your mac has changed to the fake one, from your iPhone, run:
ifconfig en0
and you should see the fake mac on ether line (like the one in the screen-shot above) if not, please follow the instructions again.

2. Try to restart your router, and then refresh the router's web page

dj said...

actually i made everything right and the address was still the original one on ifconfig en0...
maybe it depends on software 2.0... Has someone had success on 2.0.2 or 2.1?
thanks a lot!

Ali Ayoub said...

Hi dj,
I tried this on 2.0 and it works, I use this method daily without problems.
Please try this simple test and let me know if it works:
1. Log into your iPhone via ssh connection
2. Run: ifconfig en0 ether 11:22:33:44:55:66
3. Run: ifconfig en0
4. examine the output of step #3 and make sure that the MAC address (the lines which starts with 'ether') has changed

If this works, re-run step #2 with the fake MAC address you wish to use, i don't see any reason why this won't work.
if you got an error message in step #2, please copy & paste the output here so we might help.

--
Ali;

Dj said...

thanks, this time it worked!!

Ali Ayoub said...

Glad to help :)

Jacob V. said...

I tried to make it persistent every time I restart my ipod but it doesn't seem to work. When I run "./mac_fake.sh" it says Permission denied. I'm running as SU.

Tommaso said...

can this work for ipod touch too?

Ali Ayoub said...

Tommaso, I never tried in iPod touch, but I believe that it will work on it too.

Tommaso said...

it didn't worked on my ipod..
maybe because it's a 2g?

Anonymous said...

Ali, tried this in my iPhone 3GS but it's not working, do you have an update?

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

I know this posting is old but is there a way to have this method to work on iPhone 3Gs 4.1 fw please

Ali Ayoub said...

Sorry man, I no longer have an iPhone, so I cannot test/adjust it on 4.1

Zain Ali said...

Oh what is difference between cydia Terminal App and VT-100 terminal if both perform same administration functionality so how to operate terminal App in cydia with your mentioned commands