Hack Forums
[C#] HWID Login - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] HWID Login (/showthread.php?tid=5799808)



HWID Login - Minto - Feb 14, 2018

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;
       }



RE: HWID Login - throwit - Feb 14, 2018

This will be easily bypassed. You should atleast make it encrypted, do more "server-sided" checks.


RE: HWID Login - Ninja - Feb 15, 2018

(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.


RE: HWID Login - chrizator - Feb 15, 2018

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"



RE: HWID Login - 0xDEAD10CC - Feb 15, 2018

Not even using SSL again, which is one thing lots of people forget here.


RE: HWID Login - gigajew - Feb 15, 2018

Here’s another unique identifier that Microsoft uses in conjunction with your windows serial code https://pastebin.com/1bSdXFYP


RE: HWID Login - JohnFreeman34 - Feb 15, 2018

holy shit ty for this bro!


RE: HWID Login - Minto - Feb 16, 2018

(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.


RE: HWID Login - EZLib - Feb 16, 2018

Overall this good to a point, thanks for contribution.


RE: HWID Login - SlowMehMo - Feb 17, 2018

(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 🤫


RE: HWID Login - iAmNoob123123 - Feb 2, 2019

Sorry for being rude but I can bypass this by returning true data with a debugger...


RE: HWID Login - StarZ - Feb 2, 2019

(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.