Red Security
vb.net hwid-get server check - Printable Version

+- Red Security (https://redsecurity.info/cc)
+-- Forum: Programming (https://redsecurity.info/cc/forumdisplay.php?fid=5)
+--- Forum: Visual Basic & .NET Framework (https://redsecurity.info/cc/forumdisplay.php?fid=17)
+--- Thread: vb.net hwid-get server check (/showthread.php?tid=233)



vb.net hwid-get server check - viruss - 10-01-2017

Code:
Imports System.IO
Imports System.Net
Imports System.Threading
Imports System.Management
Imports System.Security
Imports System.Security.Policy




Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim hw As New clsComputerInfo

        Dim cpu As String
        Dim mb As String
        Dim mac As String
        Dim hwid As String

        cpu = hw.GetProcessorId()
        mb = hw.GetMotherboardID()
        mac = hw.GetMACAddress()
        hwid = cpu + mb + mac

        Dim hwidEncrypted As String = Strings.UCase(hw.getMD5Hash(cpu & mb & mac))

        txtHWID.Text = hwidEncrypted
        'HWID Generated
        WebBrowser1.Navigate("http://45.32.168.102/forum/hwid.php")
    End Sub




    Private Class clsComputerInfo
        'Get processor ID
        Friend Function GetProcessorId() As String
            Dim strProcessorID As String = String.Empty
            Dim query As New SelectQuery("Win32_processor")
            Dim search As New ManagementObjectSearcher(query)
            Dim info As ManagementObject
            For Each info In search.Get()
                strProcessorID = info("processorID").ToString()
            Next
            Return strProcessorID
        End Function
        ' Get MAC Address
        Friend Function GetMACAddress() As String
            Dim mc As ManagementClass = New ManagementClass("Win32_NetworkAdapterConfiguration")
            Dim moc As ManagementObjectCollection = mc.GetInstances()
            Dim MacAddress As String = String.Empty
            For Each mo As ManagementObject In moc
                If (MacAddress.Equals(String.Empty)) Then
                    If CBool(mo("IPEnabled")) Then MacAddress = mo("MacAddress").ToString()
                    mo.Dispose()
                End If
                MacAddress = MacAddress.Replace(":", String.Empty)
            Next
            Return MacAddress
        End Function
        ' Get Motherboard ID
        Friend Function GetMotherboardID() As String
            Dim strMotherboardID As String = String.Empty
            Dim query As New SelectQuery("Win32_BaseBoard")
            Dim search As New ManagementObjectSearcher(query)
            Dim info As ManagementObject
            For Each info In search.Get()
                strMotherboardID = info("product").ToString()
            Next
            Return strMotherboardID
        End Function
        ' Encrypt HWID
        Friend Function getMD5Hash(ByVal strToHash As String) As String
            Dim md5Obj As New System.Security.Cryptography.MD5CryptoServiceProvider
            Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)
            bytesToHash = md5Obj.ComputeHash(bytesToHash)
            Dim strResult As String = ""
            For Each b As Byte In bytesToHash
                strResult += b.ToString("x2")
            Next
            Return strResult
        End Function
    End Class



    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        WebBrowser1.Document.GetElementById("username").SetAttribute("value", TextBox1.Text)
        WebBrowser1.Document.GetElementById("hwidin").SetAttribute("value", txtHWID.Text)
        WebBrowser1.Document.GetElementById("submit").InvokeMember("click")



       

    End Sub
End Class



web server files:


hwid.php


Code:
<html>

<head>
<title>PHP hwid check</title>

<style type="text/css">
a {
    color: #0060B6;
    text-decoration: none;
}

a:hover 
{
     color:#00A0C6; 
     text-decoration:none; 
     cursor:pointer;  
}

#footer
{
    clear: both;
background: white;
    padding: 0;
border: 1px groove #aaaaaa;
    text-align: center;
    vertical-align: 10px;
    line-height: normal;
    margin: 0;
    position: fixed;
    bottom: 0px;
left: -1px;
    width: 100%;
height: 60px;
}

#text
{
    clear: both;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    line-height: normal;
    margin: 0;
    position: relative;
    top: 70px;
left: -10px;
    width: 100%;
padding-bottom: 40px;
}

input{
   text-align:center;
}
</style>

</head>

<body>

<div class="text" id="text">
<font color="black" size="5"><b>Thaisen's MyBB "API" v1.0.0.0</b></font>
<br>
<br>
<form action="hwid_get.php" method="get">
<input type="text" name="username" id="username" placeholder="Username to check"><br>
<input type="text" name="hwidin" id="hwidin" placeholder="HWID"><br>
<div style="padding-top: 7px;"></div>
<input name="submit" id="submit" type="submit">
</form>
</div>


</body>

</html>


PHP Code:
<?php
$link 
mysqli_connect('localhost','mybbuser','your-password-here','mybbdb');
$database mysqli_select_db($link,'database_name');

$user $_GET['username'];
$hwid $_GET['hwidin'];

$sql "SELECT * FROM mybb_users WHERE username = '"mysqli_real_escape_string($link,$user) ."'" ;
$result $link->query($sql);

if(
strlen($hwid) < 1)
{
    echo 
"HWID value left empty";
}
else
{
    if (
$result->num_rows 0) {
        while(
$row $result->fetch_assoc()) {
            if (
strlen($row['hwid']) > 1)
            {
                if (
$hwid != $row['hwid'])
                {
                    echo 
"HWID is not correct";
                }
                else
                {
                    echo 
"HWID is correct";
                }
            }
            else
            {
                
$sql "UPDATE mybb_users SET hwid='$hwid' WHERE username='$user'";
                if(
mysqli_query($link$sql))
                {
                    echo 
$row['hwid'];
                }
                else
                {
                    echo 
"ERROR: Could not able to execute $sql. " mysqli_error($link);
                }
            }
        }
    }
}



?>

<html>
<head>
<title>PHP account check return</title>
<meta http-equiv="refresh" content="1" />
</head>

<body>


</body>

</html>


[code-sh=PHP]<html>
<head>
 <title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'?>
</body>
</html>[/code-sh] 

please note not 100% done




RE: vb.net hwid-get server check - Mr.Kurd - 10-01-2017

Thank you my friend, I'll wait you until you done Wink


RE: vb.net hwid-get server check - viruss - 10-01-2017

here is what the database look like after

   


here is what app look like when done

   


RE: vb.net hwid-get server check - Mr.Kurd - 10-01-2017

(10-01-2017, 02:45 PM)viruss Wrote: here is what the database look like after




here is what app look like when done

Okay its so nice bro, thank you, I'll wait you until u done/