Help - Search - Members - Calendar
Full Version: "Permanent" MAC Spoof?
InsanelyMac Forum > Discuss and Learn > Internet(s), Servers, and Networks
Tyrone Shoe
Well, I called out one of our network admins for lying about something during a meeting a couple of weeks ago and all of a sudden, my personal laptop stopped being able to access our company's network. I thought it was an issue with my thinkpad's wireless card and OSX but then I got suspicious one day when he made some snarky comments in a meeting about how "I couldn't even get my computer on the internet"

drama aside, I fiddled, changed my WIFI card's MAC address and suddenly my network was back... what a coincidence :-)

I have been manually doing an ifconfig en0 ether xxxxxxxx to spoof my MAC every morning when I set up my laptop but that's a real pain in the arse, particularly if I have to reboot. I'm not the best *NIX/Linux user but I tried fiddling with the rc.common and the other startup scripts to see if I could plug in an ifconfig line to automatically spoof my MAC on boot but it didn't work.

Any suggestions on the best way to make this automatic?
gazasaurusu
QUOTE(Tyrone Shoe @ Jan 31 2008, 03:31 AM) *
Well, I called out one of our network admins for lying about something during a meeting a couple of weeks ago and all of a sudden, my personal laptop stopped being able to access our company's network. I thought it was an issue with my thinkpad's wireless card and OSX but then I got suspicious one day when he made some snarky comments in a meeting about how "I couldn't even get my computer on the internet"

drama aside, I fiddled, changed my WIFI card's MAC address and suddenly my network was back... what a coincidence :-)

I have been manually doing an ifconfig en0 ether xxxxxxxx to spoof my MAC every morning when I set up my laptop but that's a real pain in the arse, particularly if I have to reboot. I'm not the best *NIX/Linux user but I tried fiddling with the rc.common and the other startup scripts to see if I could plug in an ifconfig line to automatically spoof my MAC on boot but it didn't work.

Any suggestions on the best way to make this automatic?


Do a {censored} in his desk drawer, then tell everyone he's a fecophiliac. It will be with him for the rest of his pointless life.
Tyrone Shoe
Not quite the answer I was hoping for but, I actually know a girl from college who got drunk and crapped in a closet. We call her the party pooper now.
Sabr
Hmmm... I'm not on my Hack right now, but I think there's an rc.local file too. Have you tried adding the ifconfig command to that instead?
Tyrone Shoe
I did a find but these were the only rc files I could find

/private/etc/rc.common
/private/etc/rc.netboot
/System/Library/PrivateFrameworks/Install.framework/Versions/A/Resources/rc.installer_cleanup
/usr/share/man/man8/rc.8.gz
/usr/share/vim/vim70/syntax/rc.vim
DukeRaoul
QUOTE(Tyrone Shoe @ Jan 31 2008, 03:31 AM) *
Well, I called out one of our network admins for lying about something during a meeting a couple of weeks ago and all of a sudden, my personal laptop stopped being able to access our company's network. I thought it was an issue with my thinkpad's wireless card and OSX but then I got suspicious one day when he made some snarky comments in a meeting about how "I couldn't even get my computer on the internet"

drama aside, I fiddled, changed my WIFI card's MAC address and suddenly my network was back... what a coincidence :-)

I have been manually doing an ifconfig en0 ether xxxxxxxx to spoof my MAC every morning when I set up my laptop but that's a real pain in the arse, particularly if I have to reboot. I'm not the best *NIX/Linux user but I tried fiddling with the rc.common and the other startup scripts to see if I could plug in an ifconfig line to automatically spoof my MAC on boot but it didn't work.

Any suggestions on the best way to make this automatic?


That admin guy sounds like a small-pond power trip jerk. And a typical idiot - had to brag about his dirty trick and give himself away, lol.

I have heard of this MAC spoofing on linux, from a ROTC computer security guy. A very worthwhile idea... maybe save a bash script, executable, somewhere like desktop for easy access. I don't know about rc files, but if that can be figured out, great!
If you have a line or set of lines of Terminal code that does this, you can make it an executable bash script this way:

Using TextEdit, make a new file. When completed it must be saved in plain text UTF-8 format, with the file extension ".bash" after its name.
Without any blank line breaks, type in the ifconfig commands and stuff, in the order they would be done. Then save it as above ^^
Using Terminal, navigate to the directory of the .bash file you just made (cd space /ThatFolder). Then enter "sudo chmod +x your.bashfile"

Your executable script will work just like an application, double-click to run. But you will have the Terminal left open afterward, leaving the minor hassle of pressing Command-Q to quit it. Or get fancy and make that part of the script (idk).
*edit* - You could also make your script a login item, which would be basically automatic.
Tyrone Shoe
The bash script idea is definitely an improvement although it isn't firing when i put it in my startup items :-/

I'll fiddle a bit and see if I can figure out something more elegant. If I come up with any cool solutions, I'll post here.
rob356
if you want to be really fancy, you can go to /Library/Startupitems and make a folder, then (you will need Apple's plist editor) make a new .plist in the folder. There should be other folders in Startupitems, so look in them, and you will find .plist's there, follow that format. Then move the bash script to the new folder, along with the .plist named StartupParameters. Now it should start at Boot! Even before login!
timerace
Mac OS X : How to Set the MAC Address During Startup

Follow these steps to create a script that sets the MAC Address each time the computer restarts:

1. Open Terminal (/Applications/Utilities/).
2. Type: cd /Library
3. Press Return.
4. Type: mkdir StartupItems
5. Press Return. (If you encounter an error, continue to step 6.)
6. Type: cd StartupItems
7. Press Return.
8. Type: mkdir MACADD
9. Press Return.
10. Type: cd MACADD
11. Press Return.
12. Type: pico MACADD
13. Press Return.
14. In the pico editor, paste in the following text.

Begin copying below this line.
--------------------------------------------------------------------------------

#!/bin/sh

. /etc/rc.common

##
# Configure a network interface MAC Address setting
##
#
# This script will set the MAC Address setting for the specified interface(s)
#
# The name of the interface (ex. en0) must be edited to match the interface
# to which the MACADD setting should be applied
#
##

StartService ()
{
ConsoleMessage "Configuring MACADD"

### uncomment lines and change the value following 'MACADD' as appropriate mac address

if [ "${MACADD:=-NO-}" = "-YES-" ]; then

# /sbin/ifconfig en0 lladdr xx:xx:xx:xx:xx:xx
# /sbin/ifconfig en1 lladdr xx:xx:xx:xx:xx:xx

fi

}

StopService ()
{
return 0
}

RestartService ()
{
return 0
}

RunService "$1"

--------------------------------------------------------------------------------

End copying above this line.

15. Uncomment the /sbin/ifconfig line(s) to set the MACADD for a particular interface.


Note: Removing the number sign (#) from the beginning of a line uncomments it. Typically, en0 is the interface name for the Built-in Ethernet port and en1 is interface name for the AirPort Card. This is not always the case, though. To confirm that a network port is associated with a particular interface name, open the Network Utility (/Applications/Utilities/), and click the Info tab.


16. When you have finished customizing the file, save it (press Control-O), press Return, and exit pico (press Control-X).

17. Type: chmod 755 MACADD

18. Press Return.

19. Type: pico StartupParameters.plist

20. Press Return.

21. In the pico editor paste in the following text.


Begin copying below this line.


--------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>Can set MACADD</string>
<key>OrderPreference</key>
<string>None</string>
<key>Provides</key>
<array>
<string>MACADD</string>
</array>
<key>Requires</key>
<array>
<string>Network Configuration</string>
</array>
</dict>
</plist>

--------------------------------------------------------------------------------

End copying above this line.

22. When you have finished customizing the file, save it (Control-O), press Return, and exit pico (Control-X).
23. Type: chmod 755 StartupParameters.plist
24. Press Return.
25. Type: sudo pico /etc/hostconfig
26. When prompted, enter your password.
27. Press Return.
28. In the pico editor, add this line at the bottom:

MACADD=-YES-

29. Save it (Control-O), press Return, and exit pico (Control-X).

When you restart the computer, MACADD is set for the interface that you specified.

Notes


1. The MACADD will be reset after changing a Location, waking the computer from sleep, or changing the state of the network interface. To use the script again without having to restart, enter the following command:

sudo SystemStarter start MACADD

2. If you experience any issues or wish to not set MACADD during startup, you can turn off the new script by changing the MACADD line in /etc/hostconfig to:

MACADD=-NO-




Thor
Thank you very much timerace for this detailed informations.
Do to this script I can now use my notebook Broadcom 57xx network adapter.
biggrin.gif

gizmų
Doesn't work on Marvell Yukon sad.gif
Thor
Have you tried any of the tip's here ?

http://forum.insanelymac.com/index.php?showtopic=34074
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.