Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
MD5 Cracker - frmMain.vb

frmMain.vb

Caricato da:
Scarica il programma completo

  1. Imports System
  2. Imports System.IO
  3. Imports System.Text
  4. Imports System.Security
  5. Imports System.Security.Cryptography
  6. Public Class frmMain
  7.  
  8.     Public Function MD5(ByVal Word) As String
  9.         Dim Bytes() As Byte = ASCIIEncoding.ASCII.GetBytes(Word)
  10.         Dim md5h As New MD5CryptoServiceProvider
  11.         Dim Byt() As Byte = md5h.ComputeHash(Bytes)
  12.         Dim i As Integer = (Byt.Length * 2 + (Byt.Length / 8))
  13.         Dim StrBuild As StringBuilder = New StringBuilder(i)
  14.         Dim i2 As Integer
  15.         For i2 = 0 To Byt.Length - 1
  16.             StrBuild.Append(BitConverter.ToString(Byt, i2, 1))
  17.         Next i2
  18.         Return StrBuild.ToString().TrimEnd(New Char() {" "c}).ToLower
  19.     End Function
  20.  
  21.     Private Sub cmdload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdload.Click
  22.         Try
  23.             lstwords.Items.Clear()
  24.             OFD.ShowDialog()
  25.             Dim Sr As StreamReader = New StreamReader(OFD.FileName)
  26.             Dim Str As String = ""
  27.             While Not Sr.EndOfStream
  28.                 Str = Sr.ReadLine
  29.                 lstwords.Items.Add(Str)
  30.             End While
  31.         Catch ex As Exception
  32.             MessageBox.Show("Impossibile caricare il file!", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
  33.         End Try
  34.     End Sub
  35.  
  36.     Private Sub cmdattack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdattack.Click
  37.         On Error Resume Next
  38.         Dim Stat As Boolean
  39.         Stat = False
  40.         If Len(txthash.Text) = 0 Or lstwords.Items.Count = 0 Then
  41.             MessageBox.Show("Inserire un hash da crakkare,o controllare che vi sia almeno un elemento nella lista!", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
  42.         Else
  43.             Dim i As Integer
  44.             For i = 0 To lstwords.Items.Count
  45.                 Dim Str As String
  46.                 Str = lstwords.Items.Item(i)
  47.                 If MD5(Str) = txthash.Text Then
  48.                     MessageBox.Show("L'hash " & txthash.Text & " corrisponde alla parola " & lstwords.Items.Item(i), Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
  49.                     lblwordstat.Text = lstwords.Items.Item(i)
  50.                     Stat = True
  51.                 End If
  52.             Next i
  53.             If Stat = False Then
  54.                 lblwordstat.Text = "Non trovata"
  55.             End If
  56.             MessageBox.Show("Attacco dizionario eseguito!", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
  57.         End If
  58.     End Sub
  59. End Class