Autor Beitrag
Xearox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 260
Erhaltene Danke: 3



BeitragVerfasst: Mi 03.02.10 13:09 
Und zwar hab ich mir mal ein kleinen Programm geschrieben, zum entschlüsseln von MD5 Hash Werten...
Jedoch ist mir aufgefallen, das die Hash werte manchmal doppelt vergeben sind...

So und nun zur Frage...

Mein Code sieht so aus:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
type
  KeyArrayType = array [0..60of char;
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Button2: TButton;
    Edit3: TEdit;
    Label3: TLabel;
    Edit4: TEdit;
    Label4: TLabel;
    Edit5: TEdit;
    Edit6: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure ZeichenFestlegen;
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  KeyArray  : KeyArrayType;
  KeyStr    :string;

implementation

uses
  md5;

{$R *.dfm}



procedure TForm1.ZeichenFestlegen;
begin
  KeyArray[0]  := 'A';
  KeyArray[1]  := 'B';
  KeyArray[2]  := 'C';
  KeyArray[3]  := 'D';
  KeyArray[4]  := 'E';
  KeyArray[5]  := 'F';
  KeyArray[6]  := 'G';
  KeyArray[7]  := 'H';
  KeyArray[8]  := 'I';
  KeyArray[9]  := 'J';
  KeyArray[10] := 'K';
  KeyArray[11] := 'L';
  KeyArray[12] := 'M';
  KeyArray[13] := 'N';
  KeyArray[14] := 'O';
  KeyArray[15] := 'P';
  KeyArray[16] := 'Q';
  KeyArray[17] := 'R';
  KeyArray[18] := 'S';
  KeyArray[19] := 'T';
  KeyArray[20] := 'U';
  KeyArray[21] := 'V';
  KeyArray[22] := 'W';
  KeyArray[23] := 'X';
  KeyArray[24] := 'Y';
  KeyArray[25] := 'Z';
  KeyArray[26] := '1';
  KeyArray[27] := '2';
  KeyArray[28] := '3';
  KeyArray[29] := '4';
  KeyArray[30] := '5';
  KeyArray[31] := '6';
  KeyArray[32] := '7';
  KeyArray[33] := '8';
  KeyArray[34] := '9';
  KeyArray[35] := '0';
  KeyArray[36] := 'a';
  KeyArray[37] := 'b';
  KeyArray[38] := 'c';
  KeyArray[39] := 'd';
  KeyArray[40] := 'e';
  KeyArray[41] := 'f';
  KeyArray[42] := 'g';
  KeyArray[43] := 'h';
  KeyArray[44] := 'i';
  KeyArray[45] := 'j';
  KeyArray[46] := 'k';
  KeyArray[47] := 'l';
  KeyArray[48] := 'm';
  KeyArray[49] := 'n';
  KeyArray[50] := 'o';
  KeyArray[51] := 'p';
  KeyArray[52] := 'q';
  KeyArray[53] := 'r';
  KeyArray[54] := 's';
  KeyArray[55] := 't';
  KeyArray[56] := 'u';
  KeyArray[57] := 'v';
  KeyArray[58] := 'w';
  KeyArray[59] := 'x';
  KeyArray[60] := 'y';

end;

procedure TForm1.Button2Click(Sender: TObject);
var
A,B,C,D,E,F : integer;
Hash    : String ;
KeyStr  : String ;
X,Count : Integer;
begin
  ZeichenFestlegen;
  X:=1;
  Count:=10000;
  while not (Edit1.Text = Hash) do
  begin
    A:=Random(61);
    B:=Random(61);
    C:=Random(61);
    D:=Random(61);
    E:=Random(61);
    F:=Random(61);
    KeyStr:=KeyArray[A]+KeyArray[B]+KeyArray[C]+KeyArray[D]+KeyArray[E]+KeyArray[F];
    Hash := MD5Print(MD5String(KeyStr));
    Edit2.Text:=KeyArray[A]+KeyArray[B]+KeyArray[C]+KeyArray[D]+KeyArray[E]+KeyArray[F];
    X := X+1;
    Edit5.Text:=inttostr(X);
    Edit6.Text:=Hash;
    Count:=Count-1;
    if (Count = 0 ) then
    begin
     refresh;
     Count:=10000;
    end;

  end;


end;


Gibt es eine möglichkeit, verschiedene Konfiguration der Arrays einfach in eine StringList, oder was auch immer zu speichern, um einer erneuten Prüfung zu überspringen?
Ich erstelle ja die Strings per zufall generator...
Und kann man irgendwie es so programmieren, das es mit einem Buchstaben anfängt, und nach oben hin max. 12 zeichen hat?
Zum Beispiel:
Lauf 1:
61 möglichkeiten bei 1 Zeichen
Lauf 2:
3721 möglichkeiten bei 2 Zeichen
Lauf 3:
226.981
Lauf 4:
13.845.841
Lauf 5:
844.596.301
Lauf 6:
51.520.374.361

usw......
Da ich das per Zufall generrrator mache, kommen natürlich die Buchstaben und konfiguration doppelt vor...
Teilweise macht das Programm bei einem Buchstaben über 200 durchläufe...

Wäre wichtig für mein nächstes Project...
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Mi 03.02.10 15:58 
Du versuchst dich also immer noch am Brute forcen? Und dann noch bei MD5, mit 6 Stellen... wie viele Jahre wolltest du da rechnen? ;)

Natürlich kommen da Sachen doppelt vor. Bei random(61) kommt es halt schonmal vor, dass der selbe Buchstabe gezogen wird. Und da du auch kein Randomize verwendest...
Wenn du unbedingt alle Kombinationen prüfen willst brauchst du weder eine StringList noch random - sondern zum BEISPIEL (bevor hier wieder jemand jammert, wegen nicht optimaler Lösung) 6 Schleifen ineinander.

_________________
PROGRAMMER: A device for converting coffee into software.
Xearox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 260
Erhaltene Danke: 3



BeitragVerfasst: Do 04.02.10 12:40 
mit der Random lösung hab ich das lösen eines 6 Stellen Hashs weniger als 1min geschafft...
thepaine91
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 763
Erhaltene Danke: 27

Win XP, Windows 7, (Linux)
D6, D2010, C#, PHP, Java(Android), HTML/Js
BeitragVerfasst: Do 04.02.10 13:59 
Hab mal vor ewigkeiten was in die Richtung gemacht hat aber nur Zahlen behnadelt und 4 stellen. "Ist alles andere als sauber Programmiert aber vil hilft es dir trotzdem. =)

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
  private
    i123 : integer;
    md5strfound: boolean;
    z1s:string;
    z2s:string;
    z3s:string;
    z4s:string;
    md5_hash_vgl: String;
    md5_hash_quel: string;
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  i123 := 0;
  md5_hash_quel := Edit1.Text;
  md5strfound := false;
  z1;
end;


procedure TForm1.z1;
var i: integer;
begin
  i := 0;
  while (i <10and (not md5strfound) do
  begin
    z1s := inttostr(i);
    z2;
    inc(i);
  end;
end;

procedure TForm1.z2;
var i: integer;
begin
  i := 0;
  while (i <10and (not md5strfound) do
  begin
    z2s := inttostr(i);
    z3;
    inc(i);
  end;
end;

procedure TForm1.z3;
var i : integer;
begin
  i := 0;
  while (i <10and (not md5strfound) do
  begin
    z3s := inttostr(i);
    z4;
    inc(i);
  end;
end;

procedure TForm1.z4;
var I : integer;
begin
  i := 0;
  while (i <10and (not md5strfound) do
  begin
    z4s := inttostr(i);
    inc (i123);
    md5_hash_vgl := Md5Print(MD5String(z1s+z2s+z3s+z4s));
    if md5_hash_vgl = md5_hash_quel then
    begin
      md5strfound := true;
      Label2.Caption := z1s+z2s+z3s+z4s;
      ShowMessage(inttostr(i123));
    end;
    inc(i);
  end;


end;

procedure TForm1.Button2Click(Sender: TObject);
begin
ShowMessage(md5print(md5file('E:\TmsClient330-100.msi')));
end;


Aber mal nebenbei Xentar hat recht du würdest Jahre rechnen also bringt es dir nicht wirklich viel. Stichwort "Rainbowtable" sollte dir eher weiterhelfen sind aber auch nicht zuverlässig ^^ Und musst erst mal eine haben usw..... Wobei der Sinn des ganzen Unterfangens generell fragwürdig ist.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 06.02.10 16:50 
Unsalted MD5 schreit regelrecht nach einer Rainbow-Table ...

Und ansonsten gibt's entsprechende Algorithmen, die jegliche Kombinationen von Buchstaben OHNE Dopplung aufzählen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.