Spoof MAC Address.
How can I obtain the MAC Address with C? (in Linux and in Windows)
and how could I change it?
I could change my MAC Address in Linux typing this:
and then I'm gonnna need to up the new MAC Address:
ifconfig eth0 down hw ether ff:ff:ff:ff:ff:f0
In windows, the MAC Address is in the registry:
Then search for NetworkAddress (it's in the 0009 directory)
Thanks in advance.
I can think of an alternative solution
in the terminal if you use de the "arp" command you can obtain the ethernet address
for example if you use
you will get all the arp addresses.
and if you pipe the output to a file (lets say arp.txt)
and you read the mac (ethernet) address from the file you will have your MAC address.
3:cProg nacho$ arp -a > arp.txt
you can use system() system call to do it inside your C program ;)
I am sure there is another and better solution for this. but you can try ;)
Why do you want to do this?
use ARP to find it
Originally Posted by eXeCuTeR
You cant change it without an EEPROM
hummmm....hey. I found a solution at :
this is in japanese but you can see the code.
this code shows the MAC address but it uses SIOCGIFHWADDR wich is a LINUX exclusive macro so I couldnt test it.
Does any one knows about an equivalent for SIOCGIFHWADDR in standard UNIX ?
again, you didnt say why you need to change it. In general changing it without knowing exactly what you are doing is a bad thing, as it will most likely cause it to conflict with some other NIC
I wanna try ARP Poisoning my laptop :)
Originally Posted by abachler
I know I could change it in other ways but I want to make a program to do the job for me, anytime I want to.
What is EEPROM?
Thanks nacho :)
Good idea, I'm gonna test it now.
Now I just gotta find a way to edit MAC Address in Windows.
How could I change my MAC Address in Windows through C?
Thanks and sorry.
One common reason to want to do this is that some cable internet providers MAC-lock the cable modem to your NIC's MAC when they come on site for installation. If you change your NIC, the modem will no longer allow it to connect.
As far as ARP poisoning, you do not need to change your hardware MAC to achieve it, but I am not going into any further detail than that.
Its rewritable memory like flash memory; unlike memory thats burnt into a chip and can't be modified.
That shouldent matter tho as nowadays MAC addresses tend to be set in software rather burnt into the NIC.