MAC Address / Spoofing

I am trying to test MAC address spoofing  for security.  I've changed  mine using  the free utility at:  Every utility sees the new MAC address and not the old one ( even ipconfig /all).

My question really is:  Is the MAC physically changed of the card or is windows just fooled?   I attach the code I use to get the MAC Address and it sees the new MAC address too.   How can I read the original MAC address in Delphi?


function GetMACAdress: string;
      NCB: PNCB;
      Adapter: PAdapterStatus;
      URetCode: PChar;
      RetCode: char;
      I: integer;
      Lenum: PlanaEnum;
      _SystemID: string;
      TMPSTR: string;
      Result := '';
      _SystemID := '';
      Getmem(NCB, SizeOf(TNCB));
      Fillchar(NCB^, SizeOf(TNCB), 0);
      Getmem(Lenum, SizeOf(TLanaEnum));
      Fillchar(Lenum^, SizeOf(TLanaEnum), 0);
      Getmem(Adapter, SizeOf(TAdapterStatus));
      Fillchar(Adapter^, SizeOf(TAdapterStatus), 0);
      Lenum.Length := chr(0);
      NCB.ncb_command := chr(NCBENUM);
      NCB.ncb_buffer := Pointer(Lenum);
      NCB.ncb_length := SizeOf(Lenum);
      RetCode := Netbios(NCB);
      i := 0;
            Fillchar(NCB^, SizeOf(TNCB), 0);
            Ncb.ncb_command := chr(NCBRESET);
            Ncb.ncb_lana_num := lenum.lana[I];
            RetCode := Netbios(Ncb);
            Fillchar(NCB^, SizeOf(TNCB), 0);
            Ncb.ncb_command := chr(NCBASTAT);
            Ncb.ncb_lana_num := lenum.lana[I];
    // Must be 16
            Ncb.ncb_callname := '*               ';
            Ncb.ncb_buffer := Pointer(Adapter);
            Ncb.ncb_length := SizeOf(TAdapterStatus);
            RetCode := Netbios(Ncb);
    //---- calc _systemId from mac-address[2-5] XOR mac-address[1]...
            if (RetCode = chr(0)) or (RetCode = chr(6)) then
                  _SystemId := IntToHex(Ord(Adapter.adapter_address[0]), 2) + '-' +
                        IntToHex(Ord(Adapter.adapter_address[1]), 2) + '-' +
                        IntToHex(Ord(Adapter.adapter_address[2]), 2) + '-' +
                        IntToHex(Ord(Adapter.adapter_address[3]), 2) + '-' +
                        IntToHex(Ord(Adapter.adapter_address[4]), 2) + '-' +
                        IntToHex(Ord(Adapter.adapter_address[5]), 2);
      until (I >= Ord(Lenum.Length)) or (_SystemID <> '00-00-00-00-00-00');
      GetMacAdress := _SystemID;

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The MAC Address is not physically changed on the network card.  Since we need to use Windows to access the MAC address value is stored somewhere in the Windows registry other applications are fooled by the spoofed MAC address.  In fact in most Windows Server Operating Systems you can change your MAC address in the network card settings by specifying the "Hardware Address" and putting a spoofed MAC address.  

I have seen some license management servers (specifically by IBM) who read the MAC address directly from hardware and therefore are not fooled.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SarusSystemsAuthor Commented:
Thank you for the informative reply.   It  seems I need to find code that will read the MAC address directly from hardware and not be fooled by Windows.  I 'own' the client and server so if I could find the 'real' MAC address, I can use it to log onto my server.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.