Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

MAC address recognition

I could only imagine that this is possible, but I have no idea where to begin.

I want to create a program that has something similar to the group policy on windows machines. I basically want a program that when it loads it reads the MAC address of the machine. If the MAC address doesn't match what is coded in the program, it exits. Basically like a simple authentication without a login. This part itself I can probably handle on my own. What I was really interested in is how would I go about changing those addresses? Like lets say my MAC address is verified and I plan to change it at some point and time. I want to be able to edit that address in the program. So lets say I spoof my MAC to a new one, the program will have that new address I previous entered in before I changed it. Do I need to create a database in like a dll file or something? Does anybody have a direction that I could go in?

Cheers 😎
Hey, you need to find out how to modify registry keys with c#.

This is the path, which requires the modification to change mac address of your windows 10:
Code
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class{4d36e972-e325-11ce-bfc1-08002be10318}\0004\NetworkAddress
(Oct 12, 2019 10:28 AM)elprofesor Wrote:  Hey, you need to find out how to modify registry keys with c#.

This is the path, which requires the modification to change mac address of your windows 10:
Code
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class{4d36e972-e325-11ce-bfc1-08002be10318}\0004\NetworkAddress

I should have specified. MAC spoofing/changing isn't part of the program. I plan to use third party programs to do this. I just want a program that can recognize a user's MAC address, and if its on the whitelist continue the programs function. If its not recognized, it just exits.
Is your app supposed to run on a local network?
(Oct 12, 2019 10:09 AM)I cry blood Wrote:  I could only imagine that this is possible, but I have no idea where to begin.

I want to create a program that has something similar to the group policy on windows machines. I basically want a program that when it loads it reads the MAC address of the machine. If the MAC address doesn't match what is coded in the program, it exits. Basically like a simple authentication without a login. This part itself I can probably handle on my own. What I was really interested in is how would I go about changing those addresses? Like lets say my MAC address is verified and I plan to change it at some point and time. I want to be able to edit that address in the program. So lets say I spoof my MAC to a new one, the program will have that new address I previous entered in before I changed it. Do I need to create a database in like a dll file or something? Does anybody have a direction that I could go in?

Cheers 😎

All depends on what your target is. If you want something scalable, i would store all valid mac addresses in a database and on start request something your application cannot work without. Send mac address in the request and if it's valid answer with the "secret" else answer with an invalid value.
(Oct 12, 2019 04:35 PM)I cry blood Wrote:  I should have specified. MAC spoofing/changing isn't part of the program. I plan to use third party programs to do this. I just want a program that can recognize a user's MAC address, and if its on the whitelist continue the programs function. If its not recognized, it just exits.

Are you trying to do something like this? (Written in C#)

Code
static void Main(string[] args)
       {
           List<string> allowedMACAddresses = new List<string> {"Mac1", "Mac2", "Mac3", "..." };
           string localAddr = GetCurrentMAC("www.google.com").ToString();

           foreach (var mAddr in allowedMACAddresses)
           {
               if (localAddr == mAddr) { /*Do Thing*/ ; break;}
           }
           
       }

       private static PhysicalAddress GetCurrentMAC(string allowedURL)
       {
           TcpClient client = new TcpClient();
           client.Client.Connect(new IPEndPoint(Dns.GetHostAddresses(allowedURL)[0], 80));
           while (!client.Connected)
           {
               Thread.Sleep(500);
           }
           IPAddress address2 = ((IPEndPoint)client.Client.LocalEndPoint).Address;
           client.Client.Disconnect(false);
           NetworkInterface[] allNetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
           client.Close();
           if (allNetworkInterfaces.Length > 0)
           {
               foreach (NetworkInterface interface2 in allNetworkInterfaces)
               {
                   UnicastIPAddressInformationCollection unicastAddresses = interface2.GetIPProperties().UnicastAddresses;
                   if ((unicastAddresses != null) && (unicastAddresses.Count > 0))
                   {
                       for (int i = 0; i < unicastAddresses.Count; i++)
                           if (unicastAddresses[i].Address.Equals(address2))
                               return interface2.GetPhysicalAddress();
                   }
               }
           }
           return null;
       }

I don't intend this to be used exactly how i've written it, you'd obviously want to add error handling.
(Oct 12, 2019 10:09 AM)I cry blood Wrote:  I could only imagine that this is possible, but I have no idea where to begin.

I want to create a program that has something similar to the group policy on windows machines. I basically want a program that when it loads it reads the MAC address of the machine. If the MAC address doesn't match what is coded in the program, it exits. Basically like a simple authentication without a login. This part itself I can probably handle on my own. What I was really interested in is how would I go about changing those addresses? Like lets say my MAC address is verified and I plan to change it at some point and time. I want to be able to edit that address in the program. So lets say I spoof my MAC to a new one, the program will have that new address I previous entered in before I changed it. Do I need to create a database in like a dll file or something? Does anybody have a direction that I could go in?

Cheers 😎

Hello I am looking for information on Device_fingerprinting techniques developped by companies like IOVATION or TRANS UNION to identify one machine among one million others.
I would like to do if they read my HDD serial and what other settings how do they do accurately
Furthermore Do they download specific programps without my consent ?


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by FreddieXxJun 15, 2022 12:46 AM 6 292 Jun 15, 2022 12:46 AM
Last Post: FreddieXx
[Python] by CryptAug 13, 2020 04:02 AM 16 340 Aug 13, 2020 04:02 AM
Last Post: Crypt
[Python] by DistrictApr 7, 2019 03:14 AM 4 226 Apr 7, 2019 03:14 AM
Last Post: lockhead