-1

没有什么特别的原因,除了我对密码学和计算感兴趣之外,我想用 Java 或 Visual Basic 或 C# 制作我自己的暴力破解程序,看看它是否可以破解密码。我对性能不感兴趣,我知道这是一种完全不切实际的方法——老实说,这只是一个有趣的项目。但是,我脑子里只有一个粗略的想法,我什至无法将其放入伪代码中。我最精通Java,但即使有人可以为我提供很棒的伪代码!

我不想为程序提供一个长度,但我会提供一个最大长度。我知道该程序将不得不做很多工作,但我也认为我有点想太多了。

4

4 回答 4

0

好的,所以我刚刚找到了一个我想在 C++ 中执行的示例,并且我设法将其转换为以下 Visual Basic .NET 代码,它可以完美运行。然而,输出似乎有点慢,我原以为程序会使用接近 100% 的处理能力,但事实并非如此。有人可以告诉我为什么会这样以及我该如何改变它吗?

Public Class Form1
    Dim chars() As Char = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYX".ToCharArray
    Dim csize As Integer = chars.Length - 1
    Dim upto As String
    Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
        upto = "                                                  "

        Dim max_length As Integer = 50

        For i = 1 To max_length
            bf_recursion(0, i)
            Update()
        Next

    End Sub

    Private Sub bf_recursion(ByVal index As Integer, ByVal depth As Integer)
        Dim current() As Char = upto.ToCharArray()

        For i = 0 To csize
            current(index) = chars(i)
            upto = CStr(current)

            Console.WriteLine(CStr(current))
            '\\lblOutput.Text = CStr(current)

            If index <> (depth - 1) Then
                bf_recursion(index + 1, depth)
            End If
        Next
    End Sub
End Class
于 2012-12-20T15:26:16.123 回答
0

你要做的第一件事就是弄清楚你想要暴力破解什么。我会选择一种单向散列方案,例如 MD5 或 SHA-1,可以在高速率下强制执行。在选择了要“破解”哪种方式的哈希方案后,您必须找到某种密码列表,例如http://www.whatsmypass.com/the-top-500-worst-passwords-of-all-时间。获得列表后,您需要对值进行散列并将它们存储在某处。在您拥有这个存储的“真实”数据集后,您可以创建蛮力循环并进行比较。当您找到匹配项时,输出该匹配项。您现在已经通过蛮力“破解”了一个虚假的个人密码。祝你好运!

于 2012-12-19T21:06:24.007 回答
0

哈桑-G:是的,我可以

Dim chars() As Char = "1234567890abcdefghijklmnopqrstuvwxyz".ToCharArray
    Dim csize As Integer = chars.Length - 1
    Dim upto As String
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        upto = "                                                  "

        Dim max_length As Integer = 25

        For i = 1 To max_length
            bf_recursion(0, i)
            Update()
        Next

    End Sub

    Private Sub bf_recursion(ByVal index As Integer, ByVal depth As Integer)
        Dim current() As Char = upto.ToCharArray()

        For i = 0 To csize
            current(index) = chars(i)
            upto = CStr(current)

            TextBox1.Text = (CStr(current))
            TextBox1.Refresh()
            Me.Refresh()
            '\\lblOutput.Text = CStr(current)

            If index <> (depth - 1) Then
                bf_recursion(index + 1, depth)
            End If
        Next
    End Sub
于 2015-03-14T12:32:17.053 回答
-1
while (true) 
{

 string[] mystring = new string[27];
                    mystring[0] = "";
                    mystring[1] = "a";
                    mystring[2] = "b";
                    mystring[3] = "c";
                    mystring[4] = "d";
                    mystring[5] = "e";
                    mystring[6] = "f";
                    mystring[7] = "g";
                    mystring[8] = "h";
                    mystring[9] = "i";
                    mystring[10] = "j";
                    mystring[11] = "k";
                    mystring[12] = "l";
                    mystring[13] = "m";
                    mystring[14] = "n";
                    mystring[15] = "o";
                    mystring[16] = "p";
                    mystring[17] = "q";
                    mystring[18] = "r";
                    mystring[19] = "s";
                    mystring[20] = "t";
                    mystring[21] = "u";
                    mystring[22] = "v";
                    mystring[23] = "w";
                    mystring[24] = "x";
                    mystring[25] = "y";
                    mystring[26] = "z";



                    if (counter == 27)
                    {
                        counter = 0;
                        counter2++;
                    }

                    if (counter2 == 27)
                    {
                        counter2 = 0;
                        counter3++;
                    }

                    if (counter3 == 27)
                    {
                        counter3 = 0;
                        counter4++;
                    }

                    if (counter4 == 27)
                    {
                        counter4 = 0;
                        counter5++;
                    }

                    if (counter5 == 27)
                    {
                        counter5 = 0;
                        counter6++;
                    }

                    if (counter6 == 27)
                    {
                        throw new Exception();
                    }



                    guessedpassword =  mystring[counter6] + mystring[counter5] + mystring[counter4] + mystring[counter3] + mystring[counter2] + mystring[counter];


                    counter++;
    }

这是我写的一些代码。破解效率很低,但是很简单。

于 2015-02-24T20:38:44.743 回答