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

C# 

HWID Login

Hi, this is just something someone wanted me to make for them a while back, I want to contribute to the community so I decided to share this.

Note: I got some of the code from online, but I can't remember where I got it from, but, credits to whoever wrote it.

Oh, btw, remember to import System.Management (using System.Management;) to be able to use the code shown below


Code
public string GetHDDSerial() // Public string that contains the variable of the hardware id string from URL.txt
       {
           ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia");
           foreach (ManagementObject wmi_HD in searcher.Get())
           {
               if (wmi_HD["SerialNumber"] != null)
                   return wmi_HD["SerialNumber"].ToString();
           }

           return string.Empty;
       }

     
       private void lgnhwid_Click(object sender, EventArgs e)
       {

           System.Net.WebClient Wc = new System.Net.WebClient();
           string pplbanned = Wc.DownloadString("Web URL"); // Banned Hardware ID's from server
           string pplallowed = Wc.DownloadString("Web URL"); // Whitelisted Hardware ID's from server

           if (pplbanned.Contains(GetHDDSerial())) // this if statement checks if the System Hardware ID matches with the string from the server
           {
               MessageBox.Show("You have been banned from '[name]'!", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
               Environment.Exit(-1);
           }
           else if (pplallowed.Contains(GetHDDSerial()))
           {
               MessageBox.Show("You're allowed to use '[name]', Welcome.", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
               HWDI_Login frm = new HWDI_Login();
               frm.Show();
               this.Hide();
           }
           else
           {
               MessageBox.Show("You're not whitelisted, make sure you sent Your" +
                   " Hwid to [name] and you bought our [product].", Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
               Environment.Exit(-1);
           }
           
       }

       private void HWDI_Login_Load(object sender, EventArgs e)
       {
           var mbs = new ManagementObjectSearcher("Select ProcessorId From Win32_processor");  // Get System Hardware id
           ManagementObjectCollection mbsList = mbs.Get();
           string id = "";
           foreach (ManagementObject mo in mbsList)
           {
               id = mo["ProcessorId"].ToString();
               break;
           }

           System_HWDI.Text = "System Hardware ID: " + id;
       }
This will be easily bypassed. You should atleast make it encrypted, do more "server-sided" checks.
(Feb 14, 2018 10:24 PM)throwit Wrote:  This will be easily bypassed. You should atleast make it encrypted, do more "server-sided" checks.

Anything coming from the server and going to the server can be spoofed if it is static.
Hey, thanks for the contribution!

Just a tiny improvement (since I'm a nitpicker):

Instead of querying all properties from the PhysicalMedia WMI class:
Code
"SELECT * FROM Win32_PhysicalMedia"

You should simply just query the property you need:
Code
"SELECT SerialNumber FROM Win32_PhysicalMedia"
Not even using SSL again, which is one thing lots of people forget here.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
Here’s another unique identifier that Microsoft uses in conjunction with your windows serial code https://pastebin.com/1bSdXFYP
[Image: Syr3DlV.png]
holy shit ty for this bro!
(Feb 15, 2018 10:28 AM)chrizator Wrote:  Hey, thanks for the contribution!

Just a tiny improvement (since I'm a nitpicker):

Instead of querying all properties from the PhysicalMedia WMI class:
Code
"SELECT * FROM Win32_PhysicalMedia"

You should simply just query the property you need:
Code
"SELECT SerialNumber FROM Win32_PhysicalMedia"

Ah, wow, didn't even know you could do that, thanks!

(Feb 15, 2018 10:01 PM)gigajew Wrote:  Here’s another unique identifier that Microsoft uses in conjunction with your windows serial code

:0, thanks, I might use this! :D

(Feb 15, 2018 10:21 PM)JohnFreeman34 Wrote:  holy shit ty for this bro!

No problem man! ;)

(Feb 15, 2018 10:38 AM)0xDEAD10CC Wrote:  Not even using SSL again, which is one thing lots of people forget here.

Ah, I'm sorry to disappoint.
Overall this good to a point, thanks for contribution.
(Feb 16, 2018 08:06 PM)Minto Wrote:  -snip-

try checking your on stuff by using fiddler, you can isolate and read the packets.
also, make sure your useing something like dotfuscator, i use smart assembly
this kinda thing takes alot to get it working as safe as you can, make sure reflector cant just pull your code
C# usually boils down to security through obscurity.
Not that i know anything lol 🤫
"You can pick your friends, you can pick your nose, but you can't pick your friend's nose, because they usually get mad, butt we all know there hiding secrets in there" -James Bond
Sorry for being rude but I can bypass this by returning true data with a debugger...
(Feb 2, 2019 02:42 PM)iAmNoob123123 Wrote:  Sorry for being rude but I can bypass this by returning true data with a debugger...

Perhaps stop grave-digging? Yeah, We get it. It can be bypassed with a debugger. So can a lot of things. HWID is only 1 layer of protection. Anyone who solely relies on these dated methods probably doesn't even have anything worth protecting.
fuck.
[Image: wyEbCMi.png]
Not trying to be a dick, It just comes naturally.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by DerrpySep 20, 2017 11:16 PM 8 253 Sep 20, 2017 11:16 PM
Last Post: Rhez
[.NET] by SleekzFeb 5, 2015 07:49 PM 11 3,189 Feb 5, 2015 07:49 PM
Last Post: Menalix
[.NET] by xDowwdeenNov 18, 2014 04:59 AM 28 1,718 Nov 18, 2014 04:59 AM
Last Post: Zyklon A