Sunday, October 3, 2010

How to change MAC address in Windows

So here is way to change the MAC address of your NIC (Network Interface Card). Basically there are 2 methods to do so depending on the type of NIC you have. If you have a card that support Clone MAC address, then you have to follow the below given steps:

First goto command prompt and type in ipconfig /all note the MAC address value.
Now :
1. Go to Start->My Network Places
Now on left side click on View Network Connections.

2. Right click on the NIC you want to change the MAC address and click on properties.

3. Under General tab, click on the Configure button

4. Click on Advanced tab

5. Under Property section you should see an item called Network Address or Locally Administered Address, click on it.

6. On the right side, under Value, type in the New MAC address you want to assign to your NIC. Usually this value is entered without the - sign between the MAC address numbers. for eg enter: 005544000000

7. Goto command prompt and type in ipconfig /all note the changes to MAC address value. If the changes are not in affect, then use the Second method.

8. If successful, reboot your machine.

Method 2:
This method requires editing of Windows Registry. Make a backup of your registry and store somewhere safe.

a. Goto command prompt and type ipconfig /all and

I. Record the Description for the NIC you want to change.

II. Record the Physical Address for the NIC you want to change. Physical Address is the MAC Address

b. Goto command prompt and type net config rdr hit enter key

c. Remember the number between the long number (GUID) inside the { }.
for eg: {1A9324CC-BFD7-4920-702A-DB281838637C}. You can copy and paste it to the Notepad, for future reference.

d. Go to Start -> Run, type regedt32 to start registry editor.

e. Do a backup of your registry in case you get fucked up the following steps.

f. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318} Double click on it to expand the tree. The subkeys are 4-digit numbers, which represent particular network adapters. You should see it starts with 0000, then 0001, 0002, 0003 and so on...

g. Go through each subkey that starts with 0000. Click on 0000, check DriverDesc keyword on the right to see if that's the NIC you want to change the MAC address.

The DriveDesc should match the Description you recorded from step (a.-I.) above. If you are not 100% sure about the DriverDesc, then you can verify by checking if the NetCfgInstanceID keyword value matches the GUID from step (c).

If there is no match, then move on to 0001, 0002, 0003, and so on, until you find the one you want. Usually 0000 or 0001 contains the first NIC you installed on the computer.

h. Once you selected the subkey , check if there is a keyword NetworkAddress exist in the right side of the window.

I. If "NetworkAddress" keyword does not exist, then create this new keyword by following the below steps :

i. Click on the drop down menu Edit -> Add Value.

ii. In the Add Value window, enter the following value then click OK.
Value Name: = NetworkAddress
Data Type: = REG_SZ

iii. String Editor window will pop up at this time.

iv. Enter the new MAC address you want to modify. Then click OK.
(There should not be any - sign in this address. Your entry should only consist of 12 digits

II. If NetworkAddress keyword exists, make sure it shows the keyword type is REG_SZ, and it should show as NetworkAddress:REG_SZ: This keyword might not have a value at this time.

i. Double click on the keyword NetworkAddress and the String Editor window will pop up.

ii. Enter the new MAC address you want to modify. Then click OK.
(There should not be any - sign in this address. Your entry should only consist of 12 digits.)

j. There are 2 ways to make the new MAC address active. Method I does not require a system reboot:

Method I. Goto Start->Setting->Control Panel, and double click on Network Neighborhood.

WARNING: Make sure you understand that you will lose the network connection after completing step "ii." below, and if you have a DHCP client, you will get a new IP address after completing step "iii."

i. Select the Network Adaptor who's you just changed the MAC address.

ii. Right click on the selected Network Adaptor and click Disable. Verify the status column for this adaptor changes to Disable"

iii. Right click on the selected Network Adaptor and click Enable. Verify the status column for this adaptor changes to Enabled.

iv. If for any reason it cannot be disabled or re-enabled, you have to reboot your system to make the changes effective.

II. Reboot your Windows system.

k. After your machine is rebooted, go to command prompt, type ipconfig /all to confirm the new MAC address.

If MAC Address changes does not work :
If for some reason the MAC address cannot be changed using method 2, make sure you restore the registry setting by following :
Restore the registry you just backed-up to get your system back to the original state.

Restoring the true MAC Address :

A) Remove the entry you added:

1. If you followed Method 1, then go back to the advanced properties window and remove the entry you add.

2. If you followed Method 2, then remove the NetworkAddress keyword you added in the registry.

B) Use step (j) above to activate the change you make.

C) Once rebooted, go to command prompt, type ipconfig /all to confirm the original MAC address.

If you want to change MAC in order to implement attacks like ARP spoofing, MAC duplicating etc. then I recommend you to use packet builder tools rather than this technique.
Packet builder tools help you to create fake packets with spoofed MAC that you can sent in the network.

No comments:

Post a Comment