Support Forums
[TUT] MD5 Encrypter & Finder [VB.NET] - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: [TUT] MD5 Encrypter & Finder [VB.NET] (/showthread.php?tid=6956)

Pages: 1 2


[TUT] MD5 Encrypter & Finder [VB.NET] - Fragma - 05-10-2010

In this tutorial I will guide you through making your own MD5 Encrypter & Finder.

MD5 Encrypter will Encrypt plain text into MD5 Hash.

MD5 Finder will search through 3 online databases for the desired hash and show the results in plain text.

Screenshots of what your program might look like:
[Image: md52.jpg]
[Image: md5.jpg]

Ok we will start with the MD5 Encrypter.

First off add the function:
Code:
Function MD5Hash(ByVal strToHash As String) As String
        Dim md5Obj As New Security.Cryptography.MD5CryptoServiceProvider
        Dim bytes() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)
        bytes = md5Obj.ComputeHash(bytes)
        Dim strResult As String = ""
        For Each b As Byte In bytes
            strResult += b.ToString("x2")
        Next
        Return strResult
    End Function

Now for Button1_click (Encrypt button) You need to add this code:
Code:
TextBox1.Text = MD5Hash(TextBox1.Text)

In the example above i have added a Copy text button. Here is the code for that if you wish to add it:
Code:
TextBox1.SelectAll()
TextBox1.Copy()

For button3_click add:
Code:
Form2.show()

Ok now for the MD5 Finder..

First off i will list the names for each object otherwise you might get confused...

Timer1 = md5c
Timer2 = checkHost
Timer3 = gdata
Timer4 = passcrack
Textbox = txtHash
listView = listView

You need the following Imports:
Code:
Imports System
Imports System.Web

Declare the following web browsers:
Code:
Dim webbrowser As New WebBrowser
Dim gdatabrow As New WebBrowser
Dim passcracking As New WebBrowser

In Form2_load add this code:
Code:
loadList()

        button1.Text = "Wait.."
        button1.Enabled = False
        checkHost.Start()
        webbrowser.Navigate("http://www.md5crack.com")
        gdatabrow.Navigate("http://gdataonline.com/seekhash.php")
        passcracking.Navigate("http://www.passcracking.com/index.php")

Ok now the following bits of code act like a bot on each site.
Code:
Private Sub md5crack()
webbrowser.Document.GetElementById("term").SetAttribute("value", Trim(txtHash.Text))
        webbrowser.Document.GetElementById("crackbtn").InvokeMember("click")
md5c.Start()
End Sub

Code:
Private Sub gdataonline()
        gdatabrow.Document.GetElementById("hash").SetAttribute("value", Trim(txtHash.Text))
        gdatabrow.Document.Forms(0).InvokeMember("submit")
        gdata.Start()
    End Sub

Code:
Private Sub pcracking()
        passcracking.Document.GetElementById("datafromuser").SetAttribute("value", Trim(txtHash.Text))
        passcracking.Document.Forms(0).InvokeMember("submit")
        passcrack.Start()
    End Sub

Ok now the rest is what gets all the information & puts it in the Listview

For md5c_tick:

Code:
If webbrowser.Document.Body.InnerText.Contains("Your Results") Then

            Dim t2find As New System.Text.RegularExpressions.Regex("\("".*""\)")
            Dim storage As String = Me.webbrowser.Document.Body.InnerText
            Dim result As String = t2find.Match(storage).Value
            Dim reslen As Integer = result.Length

            If String.IsNullOrEmpty(result) Then

                ListView.Items(0).SubItems.Add("Not Found")
            Else
                Dim pText As String = result.Substring(2, reslen - 4)
                ListView.Items(0).SubItems.Add(pText)
            End If
            md5c.Stop()
            webbrowser.Navigate("http://www.md5crack.com")

        End If

For button1_click:
Code:
loadList()

        checkHost.Start()

        md5crack()
        gdataonline()
        pcracking()

For checkHost_tick:
Code:
If webbrowser.ReadyState = WebBrowserReadyState.Complete AndAlso gdatabrow.ReadyState = WebBrowserReadyState.Complete AndAlso passcracking.ReadyState = WebBrowserReadyState.Complete Then
            'If passcracking.ReadyState = WebBrowserReadyState.Complete Then
            System.Threading.Thread.Sleep(2000)
            txtHash.Text = ""
            txtHash.ReadOnly = False
            look.Text = "Crack"

            look.Enabled = True
            checkHost.Stop()
        End If

For gdata_tick:
Code:
If gdatabrow.Document.Body.InnerText.Contains("RESULTS:") Then

            Dim t2find As New System.Text.RegularExpressions.Regex(txtHash.Text & ".*\s")
            Dim storage As String = Me.gdatabrow.Document.Body.InnerText
            Dim result As String = t2find.Match(storage).Value
            Dim reslen As Integer = result.Length

            Dim pText As String = result.Substring(32, reslen - 32)
            If pText.Contains("?????") Then
                ListView.Items(1).SubItems.Add("Not Found")
            Else
                ListView.Items(1).SubItems.Add(pText)
            End If


            gdata.Stop()
            gdatabrow.Navigate("http://gdataonline.com/seekhash.php")

        End If

For passcrack_tick:
Code:
If passcracking.Document.Body.InnerText.Contains(txtHash.Text) Then

            Dim t2find As New System.Text.RegularExpressions.Regex("<TD\sbgColor=#ff0000>.*<\/TD>")
            Dim storage As String = passcracking.Document.Body.InnerHtml
            Dim result As String = t2find.Match(storage).Value
            Dim reslen As Integer = result.Length



            If String.IsNullOrEmpty(result) Then
                ListView.Items(2).SubItems.Add("Not Found")
            Else
                Dim pText As String = result.Substring(20, reslen - 25)
                ListView.Items(2).SubItems.Add(pText)
            End If
            passcrack.Stop()
            passcracking.Navigate("http://www.passcracking.com/index.php")

        End If

Now all there is to do is the coding for loadlist which is:
Code:
Private Sub loadList()
ListView.Clear()
        ListView.Columns.Add("Website").Width = 100
        ListView.Columns.Add("Result").Width = 156

        ListView.Items.Add("md5crack")
        ListView.Items.Add("gdataonline")
        ListView.Items.Add("passcracking")
end sub

And finally to dispose of the webbrowsers once the form closes:
Code:
Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
   webbrowser.Dispose()
   gdatabrow.Dispose()
   passcracking.Dispose()
end sub

And thats everything! If I've made any mistakes please let me know.

Credits for the Finder go to whoever released it on Leetcoders.

Enjoy.


RE: [TUT] MD5 Encrypter & Finder [VB.NET] - Julie - 05-10-2010

Useful code, thanks for this dude !


RE: [TUT] MD5 Encrypter & Finder [VB.NET] - Fragma - 05-11-2010

Glad someone liked it. Smile


RE: [TUT] MD5 Encrypter & Finder [VB.NET] - Eve - 05-11-2010

You have many skills. Smile


RE: [TUT] MD5 Encrypter & Finder [VB.NET] - m EGa^ - 05-11-2010

Thanks for this DubStep Tongue , useful. And good job


RE: [TUT] MD5 Encrypter & Finder [VB.NET] - Julie - 05-13-2010

I tested and it works, thanks again :p


RE: [TUT] MD5 Encrypter & Finder [VB.NET] - Fragma - 05-13-2010

Glad you guys like it. If you need any help with anything just ask.


RE: [TUT] MD5 Encrypter & Finder [VB.NET] - JesusOfSuburbia - 05-14-2010

Thank's for this share..i will try to make this in future!


RE: [TUT] MD5 Encrypter & Finder [VB.NET] - Extasey - 05-14-2010

This isn't teaching! It's copy and pasting!
Maybe your should go into a little further details explaining what certain functions and codes actually do, instead of saying "Now for Button1_click (Encrypt button) You need to add this code:"


RE: [TUT] MD5 Encrypter & Finder [VB.NET] - Huawei - 05-16-2010

This is cool one, thanks friend.