Categories > Coding > C# >

[Release] Hwid Grabbing/Logger

Posts: 489

Threads: 39

Joined: May, 2020

Reputation: 4

Posted

This function retrieves the serial number of the motherboard, the primary hard drive, and the network adapter, as well as the CPU ID and the system BIOS version. It then concatenates these values into a single string and hashes it using SHA256 for security. The resulting hashed string can be used as the Hwid value.

 

using System.Management;
using System.Security.Cryptography;
using System.Text;

public static string GetHwid()
{
    string hwid = "";

    // Get the motherboard serial number
    ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT SerialNumber FROM Win32_BaseBoard");
    foreach (ManagementObject obj in searcher.Get())
    {
        hwid += obj["SerialNumber"].ToString();
        break;
    }

    // Get the primary hard drive serial number
    searcher = new ManagementObjectSearcher("SELECT SerialNumber FROM Win32_DiskDrive WHERE Index = 0");
    foreach (ManagementObject obj in searcher.Get())
    {
        hwid += obj["SerialNumber"].ToString();
        break;
    }

    // Get the network adapter MAC address
    searcher = new ManagementObjectSearcher("SELECT MACAddress FROM Win32_NetworkAdapter WHERE AdapterType = 'Ethernet 802.3'");
    foreach (ManagementObject obj in searcher.Get())
    {
        hwid += obj["MACAddress"].ToString();
        break;
    }

    // Get the CPU ID
    searcher = new ManagementObjectSearcher("SELECT ProcessorId FROM Win32_Processor");
    foreach (ManagementObject obj in searcher.Get())
    {
        hwid += obj["ProcessorId"].ToString();
        break;
    }

    // Get the system BIOS version
    searcher = new ManagementObjectSearcher("SELECT Version FROM Win32_BIOS");
    foreach (ManagementObject obj in searcher.Get())
    {
        hwid += obj["Version"].ToString();
        break;
    }

    // Hash the Hwid string for security
    using (SHA256 sha256Hash = SHA256.Create())
    {
        byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(hwid));
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < bytes.Length; i++)
        {
            builder.Append(bytes[i].ToString("x2"));
        }
        hwid = builder.ToString();
    }

    return hwid;
}
  • 0

Added

@atariXD, I also got annoyed of people marking realeases of hwid loggers and they only collect the current user name and call that the hwid with no hashing so I wanted to put a correct example out there for people to use

  • 1

nltr | Wpf/C# & Cpp Developer Former Fluxus Administrator------------------------------------------------------------------------------------💜 Developer of Kronos ðŸ’œ

Discord

Posts: 49

Threads: 7

Joined: Nov, 2022

Reputation: 2

Replied

don't use hwid/ip loggers it's probably illegal and if it not it still unethical unless you add multiple texts saying that exploit uses hwid/ip loggers

  • 0

https://media.discordapp.net/attachments/1009614172478259291/1131512749332115526/synapse.gif?width=244&height=242

Posts: 548

Threads: 51

Joined: Oct, 2022

Reputation: 29

Replied

Vouch. Cool release.

  • 0

Languages - C++, C#,Javascript, HTML, CSS, Lua ,Xaml, Python

https://dsc.gg/hackerpluto

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )