# simple MAC spoofing?

## g4j

I have a duel-booting Dell Inspiron. I would like to spoof the MAC address on the Gentoo side so that my DHCP server will see/treat the Gentoo image as a different computer. How do I do this?

----------

## tomvollerthun

Since it is a potentially criminal act (or at least very closely related to such), if you try this on computers that don't belong to you, it think it is very unlikely that you'll get a hands-on-tutorial in here.

Even if you did, I would think the answer might need to be moderated down in order to keep the forum as far away from juristic trouble as possible.

So, if it is something legal you want to achieve, I'm pretty positive that you can do it another way. Just tell us what you want.

If it's not, search the web: there are many other places where you can find hacker's handbooks and stuff like that.

cu, tom

----------

## jbc28

How is this illegal?

J

----------

## g4j

What I want is for my DHPC server to assign a particular reserved IP address when I'm booted into Windows, and a different particular address when I'm booted into Gentoo. Since the configureation of my DHPC server looks only at the MAC address, it has no way of knowing when I'm booted into which OS, and thus would assign the same IP regardless of which OS is booted.

I normally used fixed IP addresses, which works fine for desktops that never leave my home. But the notebook is sometimes at home, and sometimes on the road. Thus it needs to have a dynamic IP for when it's on the road. I figured the best solution was to used reserved IP's, but as I said my DHPC server doesn't know when my notebook is Gentoo, and when it's Windowz, so it would get the same reserved IP regardles of what is booted.

----------

## g4j

IP packets only contain MAC information while on the LAN. MAC address are dropped once the packet reaches the internet. Thus, if someone wanted to commit an internet crime, spoofing a MAC address would not be the way to do it.

----------

## ph03n1x

lmao

Spoofing macs is illegal since when  :Very Happy: 

Doing this for years at my school. We have to fill out a form to register the mac adress or our computers to access the local net. Well i bought a new laptop and was too lazy to reregister... illegal? I don't think.

```
ifconfig eth0 hw ether 00:00:00:00:00:01
```

Does the trick where 00:00:00:00:00:01 is your desired mac. A quick google or man could have showed that as well...

----------

## jbc28

To change your MAC address:

```
ifconfig eth0 hw ether 00:01:02:03:04:05
```

Doing most things on a computer you don't have permission to access is a "criminal act", I don't see that this has special status.

Hope this helps,

J

----------

## g4j

Thank you.

I assume that 

```
ifconfig eth0 hw ether 00:01:02:03:04:05
```

goes in my /etc/conf.d/net file? Does the line stand alone, or does it need to be appended to to the rest of the eth0 configureation?

Thanks again.

----------

## ph03n1x

Dont think u can add this to /etc/conf.d/net

But u can just type it in the console after the interface is up but preferably before dhcpcd is started. Maybe u need to make a lil script for that...

----------

## rwhelan

couldn't you just add that line to the /etc/init.d/net.ethX script? (inside the start function of course start() {)

----------

## bigfunkymo

It's all in how you spin it.

If you say:  "I want to make this PC use a different MAC address so I can gain access to this other network," then it carries a negative tone.

if you say: "I want my gentoo machine to use the MAC address of my other computer so my cable modem will let me online," then nobody will say you're doing something illegal even though you're pretty much asking for the same advice.

----------

## ph03n1x

You're right

But if the knowledge is available via google or man I don't hesitate too much giving it out.

Another point is you cannot really judge about a persons intention just because of the way they are asking. There might be the wannabe 1337 who is stupid enough to ask directly and will therefore get no answer. There might also be a really evil person just clever enough to ask in a way nobody would expect he/she would do any harm and he'll prolly get the info.

So it doesn't really matter in the end...

----------

## tomvollerthun

Mac-spoofing is sported by many want-to-be hackers and I never found a real need to do it. Yet. 

Obviously I have been a bit shortsighted/badly informed, so pardon me.

I just had a feeling when reading the OP, that it might just be yet another script kiddie looking for trouble to do. The other posts in this thread taught me that I was wrong.

But then, I didn't really put the poster off: Beside the OT-stuff, I just asked for more information, so we (read: you ;) could help better.

If I offended anyone, I want hereby to apologize: I didn't think my comments could be so "hot".

cu, tom

----------

## g4j

Ok, I've tried

```
ifconfig eth0 hw ether 00:00:00:00:00:01
```

from the command prompt. No go - device is busy. I've tried it in both  /etc/conf.d/net and /etc/init.d/net.eth0 . still no joy. In browsing around, I've also seen things like 

```
ifconfig_eth0=( "hw ether 00:04:E2:7D:93:C3" )
```

 as well as 

```
mac_eth0="00:11:22:33:44:55"

```

I've tried these from the command line, as well as incerting them in the two files mentioned above. Nothing. My searches on Google and this forum have found many references to things like "of course, you can change your MAC address with (one of the previously mentioned statements)" but no reference as to where or how to actually use the snippet of code.

Could I please have a little more guidance here? I just need Gentoo to automatically bring up eth0 with a static MAC that I assign (which would be only one bit different from the physical MAC). I'm not a programer, so if I need to script something, please be speciffic.

Thanks.

----------

## NeddySeagoon

g4j,

In linux you can suggest an IP address to the DHCP server that you would like. It will be allocated if its free, if not, you will get another one.

I don't know if Windows supports this too.

You many not need to mess with MAC spoofing at all.

MAC spoofing will not ensure you don't get the same IP as windows unless your DHCP server reserves an IP per MAC.

Most don't, they just go round and round the pool of IPs, so you get the next free IP anyway.

----------

## ph03n1x

As i tried to point out before you should do this in the following order, supposed eth0 is down:

```
ifconfig eth0 up

ifconfig eth0 hw ether 00:00:00:00:00:01

dhcpcd eth0
```

That way it will work if you already launched dhcpcd and device is in use you get of course an error

----------

## g4j

Thanks ph03n1x,

If I want the code you suggested to run at boot time, where would I put it? Is there a way to insert it into one of the config files so I don't have to call a seperate script? I've tried putting the ifconfig line in the start section of /etc/init.d/net.eth0, but that hasn't worked.

NeddySeagoon, thanks for your input. My dhcp server can be (and is) configured to reserve IP addresses per MAC. I thought that was a common feature? If I wanted Gentoo to *request* an IP (as opposed to assigning a fixed IP which would fail when I am connected to a network outside of my home) how would I do that? I assume that if I configure it to request a 192.168.... IP (which would be right for home), this request would be ignored when I bootup at work where the network is 10.....?

My desired end result is to have one known IP for Gentoo, and a different known IP for Windows - both for sake of my home network - but both must be assigned by a DHHCP server as not to cause problems when I'm connected to any network other than home. However I achieve this end result is fine.

Thanks for any input.

----------

## rwhelan

 *g4j wrote:*   

> Ok, I've tried
> 
> ```
> ifconfig eth0 hw ether 00:00:00:00:00:01
> ```
> ...

 

seems to me if you edited the file /etc/init.d/net.eth0 (assuming you were talking about your first eth card) with the ifconfig command (full path - so /sbin/ifconfig) there is a line in the iface_start() function ebegin "Bringing ${IFACE} up via DHCP" Put the command on the next line down from there.

so from this http://www.burningpc.com/before.JPG

to this http://www.burningpc.com/after.JPG

(i know i got the command typed wrong, it is just an example.)

If you are nervous about editing the file, make a copy of it first, just incase. Let me know if this works. i would be interested to know.  :Smile: 

----------

## g4j

Thanks rwhelan, but I couldn't get it to work. My net.eth0 file doesn't have the ebegin "Bringing ${IFACE} up via DHCP" line that you mentioned, so just stuck ifconfig in the start section.

I saw in a forum somewhere that it's not possible to spoof the mac on some of the newer hardware, but I don't know if that's true.

I'm starting to think that maybe quickswitch might be a better answer than trying to spoof the MAC. With quichswitch I could default to a static IP for my home network, then use QS to change to a dynamic setup for when I'm someplace other than home.

Thanks for your suggestion.

----------

## wjholden

Umm, I just want to mention that there are a ton of great reasons to spoof a MAC address.  Somebody asking about how to spoof a MAC might be trying to register an Xbox to an authenticate DHCP server or something.  At the university I work we use Cisco's Perfigo software and, until a programmer here built a manual registration form about the only way to register a device without a webbrowser was to spoof the MAC.

MAC spoofing is only a problem on really poorly set up networks.

----------

## slycordinator

Another great reason to spoof your IP is:

Lots of ISPs assign your IP based on your device's specific MAC address. So if you were to put your computer(s) behind a router you may find that you no longer have connection. Or if you had a router you were replacing you might have to spoof the old router's MAC.

----------

