This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
7_Maskprocessor.vb
625 lines (395 loc) · 20 KB
/
7_Maskprocessor.vb
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
Imports System.IO
Public Class Maskprocessor
Public CMD1 As String = "/c "
Public Multiple As String
Public Occur As String
Public NumLeng1 As String
Public NumLeng2 As String
Public CommandW As String
Public Charset1 As String
Public Charset2 As String
Public Charset3 As String
Public Charset4 As String
Public Ending As String = ".txt"
Public Outputfile As String
Public DatePub As String
Public Combi As String
Public StartP As String
Public StopP As String
Public CommandStart As String
Private Sub Maskprocessor_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
WordlistUtility.Show()
End Sub
Private Sub PictureBox7_Click(sender As Object, e As EventArgs) Handles PictureBox7.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
TextBox10.Clear()
TextBox11.Clear()
TextBox12.Clear()
File1Txb.Clear()
File2Txb.Clear()
File3Txb.Clear()
LenTxb.Clear()
LenMaxTxb.Clear()
LenMinTxb.Clear()
End Sub
Sub Aktualiseren()
If CheckBox4.Checked = True Then
Dim Date1 As String = Format(Now, "yyyyMMdd_HHmmss")
DatePub = Date1 & Ending
Else
DatePub = ""
End If
CommandStart = CMD1 & "mp64.exe " & CommandW & Charset1 & Charset2 & Charset3 & Charset4 & NumLeng1 & NumLeng2 & Multiple & Occur & StartP & StopP & Outputfile & DatePub & Combi
TextBox9.Text = CommandStart
End Sub
Private Sub Form11_Load(sender As Object, e As EventArgs) Handles Me.Load
CheckBox2.Checked = True
CheckBox4.Checked = True
TextBox10.Select()
'### Auf Deutsch umstellen
If My.Settings.Ger = True Then
GroupBox1.Text = "Einstellungen"
Label11.Text = "Kommandos:"
Label2.Text = "Ausgabe-Typ:"
Label4.Text = "Ausgabe in:"
Label1.Text = "Wortlänge:"
Label3.Text = "bis"
Label15.Text = "bis"
Label14.Text = "Start / Stop - Position:"
Label12.Text = "Max. mehrere Zeichen:"
Label13.Text = "Max. vorkomm. Zeichen:"
Label9.Text = "(max. Anzahl aufeinanderfolgender Zeichen)"
Label10.Text = "(max. Anzahl des Vorkommens eines Zeichens)"
CheckBox4.Text = "Ausgabedatei"
CheckBox3.Text = "Anzahl der Kombinationen berechnen"
'### Combinator
Combi1Btn.Text = "Öffnen"
Combi2Btn.Text = "Öffnen"
Combi3Btn.Text = "Öffnen"
Label17.Text = "Datei 1:"
Label18.Text = "Datei 2:"
Label19.Text = "Datei 3:"
Label16.Text = "Combinator kann bis zu drei Wordlists miteinander verbinden. Jedes Wort der zweiten" & vbNewLine & "und dritten Wordlist wird an jedes Wort der ersten Wordlist angehangen. Dies ist vergleichbar" & vbNewLine & "mit der Combinator-Attacke (-a 1)."
Label23.Text = "Mit ""Len"" können Sie Passwortkandidaten mit einer bestimmten Länge aus Wordlists" & vbNewLine &
"in eine neue Wordlist extrahieren."
End If
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
'### Search-Lenght 1
If TextBox1.TextLength > 0 Then
NumLeng1 = "-i " & TextBox1.Text
Call Aktualiseren()
Else
NumLeng1 = ""
Call Aktualiseren()
End If
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles TextBox1.KeyPress
'#### Nur Zahlen und Backspace
Select Case Asc(e.KeyChar)
Case 48 To 57, 8
' Zahlen, Backspace
Case Else
' alle anderen Eingaben unterdrücken
e.Handled = True
End Select
End Sub
Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox2.TextChanged
'### Search-Lenght 2
If TextBox2.TextLength > 0 Then
NumLeng2 = ":" & TextBox2.Text & " "
Call Aktualiseren()
Else
NumLeng2 = ""
Call Aktualiseren()
End If
End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles TextBox2.KeyPress
'#### Nur Zahlen und Backspace
Select Case Asc(e.KeyChar)
Case 48 To 57, 8
' Zahlen, Backspace
Case Else
' alle anderen Eingaben unterdrücken
e.Handled = True
End Select
End Sub
Private Sub TextBox7_TextChanged(sender As Object, e As EventArgs) Handles TextBox7.TextChanged
'#### Multiple Chars
If TextBox7.TextLength > 0 Then
Multiple = " -q " & TextBox7.Text & " "
Call Aktualiseren()
Else
Multiple = ""
Call Aktualiseren()
End If
End Sub
Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles TextBox7.KeyPress
'#### Nur Zahlen und Backspace
Select Case Asc(e.KeyChar)
Case 48 To 57, 8
' Zahlen, Backspace
Case Else
' alle anderen Eingaben unterdrücken
e.Handled = True
End Select
End Sub
Private Sub TextBox10_TextChanged(sender As Object, e As EventArgs) Handles TextBox10.TextChanged
'#### Command Parameters
If TextBox10.TextLength > 0 Then
CommandW = TextBox10.Text & " "
Call Aktualiseren()
Else
CommandW = ""
Call Aktualiseren()
End If
End Sub
Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs) Handles TextBox3.TextChanged
'#### Charset 1
If TextBox3.TextLength > 0 Then
Charset1 = "-1 " & TextBox3.Text & " "
Call Aktualiseren()
Else
Charset1 = ""
Call Aktualiseren()
End If
End Sub
Private Sub TextBox4_TextChanged(sender As Object, e As EventArgs) Handles TextBox4.TextChanged
'#### Charset 2
If TextBox4.TextLength > 0 Then
Charset2 = "-2 " & TextBox4.Text & " "
Call Aktualiseren()
Else
Charset2 = ""
Call Aktualiseren()
End If
End Sub
Private Sub TextBox5_TextChanged(sender As Object, e As EventArgs) Handles TextBox5.TextChanged
'#### Charset 3
If TextBox5.TextLength > 0 Then
Charset3 = "-3 " & TextBox5.Text & " "
Call Aktualiseren()
Else
Charset3 = ""
Call Aktualiseren()
End If
End Sub
Private Sub TextBox6_TextChanged(sender As Object, e As EventArgs) Handles TextBox6.TextChanged
'#### Charset 4
If TextBox6.TextLength > 0 Then
Charset4 = "-4 " & TextBox6.Text & " "
Call Aktualiseren()
Else
Charset4 = ""
Call Aktualiseren()
End If
End Sub
Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
If CheckBox2.Checked = True Then
Ending = ".txt"
CheckBox1.Checked = False
Call Aktualiseren()
End If
End Sub
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
Ending = ".rule"
CheckBox2.Checked = False
Call Aktualiseren()
End If
End Sub
Private Sub TextBox8_TextChanged(sender As Object, e As EventArgs) Handles TextBox8.TextChanged
'#### Occur Chars
If TextBox8.TextLength > 0 Then
Occur = " -r " & TextBox8.Text & " "
Call Aktualiseren()
Else
Occur = ""
Call Aktualiseren()
End If
End Sub
Private Sub TextBox8_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles TextBox8.KeyPress
'#### Nur Zahlen und Backspace
Select Case Asc(e.KeyChar)
Case 48 To 57, 8
' Zahlen, Backspace
Case Else
' alle anderen Eingaben unterdrücken
e.Handled = True
End Select
End Sub
Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged
If CheckBox4.Checked = True Then
Outputfile = "-o " & Application.StartupPath & "\#_Wordlists\" & "MP_Out_"
CheckBox3.Checked = False
Call Aktualiseren()
Else
Outputfile = ""
Call Aktualiseren()
End If
End Sub
Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
If CheckBox3.Checked = True Then
Combi = "--combinations "
CMD1 = "/k "
CheckBox4.Checked = False
Call Aktualiseren()
Else
Combi = ""
CMD1 = "/c "
Call Aktualiseren()
End If
End Sub
Private Sub PictureBox8_Click(sender As Object, e As EventArgs) Handles PictureBox8.Click
HelpMaskpro.Show()
End Sub
Private Sub TextBox11_TextChanged(sender As Object, e As EventArgs) Handles TextBox11.TextChanged
'#### Start position
If TextBox11.TextLength > 0 Then
StartP = " -s " & TextBox11.Text & " "
Call Aktualiseren()
Else
StartP = ""
Call Aktualiseren()
End If
End Sub
Private Sub TextBox12_TextChanged(sender As Object, e As EventArgs) Handles TextBox12.TextChanged
'#### Stop position
If TextBox12.TextLength > 0 Then
StopP = " -l " & TextBox12.Text & " "
Call Aktualiseren()
Else
StopP = ""
Call Aktualiseren()
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
'#########START Button führt das Commad Fenster aus
Dim process As New Process()
process.StartInfo.FileName = "cmd.exe"
process.StartInfo.WorkingDirectory = Application.StartupPath & "\Packages\MP"
process.StartInfo.Arguments = (CommandStart) 'TextBox9.Text)
process.Start()
If CheckBox4.Checked And My.Settings.Eng = True Then MsgBox("Done! You find the wordlist in the Hashbull-Folder ""#_Wordlists""." & vbNewLine & vbNewLine &
"If no file was generated, then an error has occurred. Change the parameter ""/c"" to ""/k"" in the ""Generate-Command-Window"" to get the error message.")
If CheckBox4.Checked And My.Settings.Eng = False Then MsgBox("Sie finden die Wordlist im Ordner ""#_Wordlists""." & vbNewLine & vbNewLine &
"Sollten Sie die Wordlist dort nicht finden, dann wird einen Fehler unterlaufen sein. Ändern Sie den Parameter im ""Command-Fenster"" von ""/c"" auf ""/k"" um einen Fehlerhinweis zu erhalten.")
End Sub
'#########################################################################################################################################################################################
'# C O M B I N A T O R
'#########################################################################################################################################################################################
Private Sub Combi1Btn_Click(sender As Object, e As EventArgs) Handles Combi1Btn.Click
'#### Auswahl und in TexBox einfügen
Dim openFileDialog As New OpenFileDialog()
openFileDialog.InitialDirectory = Application.StartupPath & "\#_Wordlists"
openFileDialog.Filter = "All Files (*.*)| *.*"
If openFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
File1Txb.Text = openFileDialog.FileName
End If
End Sub
Private Sub Combi2Btn_Click(sender As Object, e As EventArgs) Handles Combi2Btn.Click
'#### Auswahl und in TexBox einfügen
Dim openFileDialog As New OpenFileDialog()
openFileDialog.InitialDirectory = Application.StartupPath & "\#_Wordlists"
openFileDialog.Filter = "All Files (*.*)| *.*"
If openFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
File2Txb.Text = openFileDialog.FileName
End If
End Sub
Private Sub Combi3Btn_Click(sender As Object, e As EventArgs) Handles Combi3Btn.Click
'#### Auswahl und in TexBox einfügen
Dim openFileDialog As New OpenFileDialog()
openFileDialog.InitialDirectory = Application.StartupPath & "\#_Wordlists"
openFileDialog.Filter = "All Files (*.*)| *.*"
If openFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
File3Txb.Text = openFileDialog.FileName
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If File1Txb.TextLength > 1 And File2Txb.TextLength > 1 And File3Txb.TextLength < 1 Then
Dim Date3 As String = Format(Now, "yyyyMMdd_HHmmss")
Dim process As New Process()
process.StartInfo.FileName = "cmd.exe"
process.StartInfo.WorkingDirectory = Application.StartupPath & "\Packages\Hashbull_lib\HCUtils"
process.StartInfo.Arguments = ("/c combinator.exe " & File1Txb.Text & " " & File2Txb.Text & " > " & Application.StartupPath & "\#_Wordlists\Combinator2_" & Date3 & ".txt")
process.Start()
If My.Settings.Eng = True Then MsgBox("The output file was created in the folder ""#_Wordlist"". The process may take some time for large files.")
If My.Settings.Eng = False Then MsgBox("Die Ausgabedatei wird nach Fertigstellung in den Ordner ""#_Wordlist"" gespeichert. Bei sehr großen Dateien kann der Vorgang einige Zeit in Anspruch nehmen.")
End If
If File1Txb.TextLength > 1 And File2Txb.TextLength > 1 And File3Txb.TextLength > 1 Then
Dim Date3 As String = Format(Now, "yyyyMMdd_HHmmss")
Dim process As New Process()
process.StartInfo.FileName = "cmd.exe"
process.StartInfo.WorkingDirectory = Application.StartupPath & "\Packages\Hashbull_lib\HCUtils"
process.StartInfo.Arguments = ("/c combinator3.exe " & File1Txb.Text & " " & File2Txb.Text & " " & File3Txb.Text & " > " & Application.StartupPath & "\#_Wordlists\Combinator3_" & Date3 & ".txt")
process.Start()
If My.Settings.Eng = True Then MsgBox("The output file was created in the folder ""#_Wordlist"". The process may take some time for large files.", vbSystemModal)
If My.Settings.Eng = False Then MsgBox("Die Ausgabedatei wird nach Fertigstellung in den Ordner ""#_Wordlist"" gespeichert. Bei sehr großen Dateien kann der Vorgang einige Zeit in Anspruch nehmen.", vbSystemModal)
End If
If File1Txb.TextLength > 1 AndAlso File2Txb.TextLength < 1 AndAlso File3Txb.TextLength < 1 Then
If My.Settings.Eng = True Then MsgBox("You have to fill in at least two fields", vbSystemModal)
If My.Settings.Eng = False Then MsgBox("Sie müssen mind. zwei Felder ausfüllen.", vbSystemModal)
End If
End Sub
'#########################################################################################################################################################################################
'# L E N
'#########################################################################################################################################################################################
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
'#### Auswahl und in TexBox einfügen
Dim openFileDialog As New OpenFileDialog()
openFileDialog.InitialDirectory = Application.StartupPath & "\#_Wordlists"
openFileDialog.Filter = "All Files (*.*)| *.*"
If openFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
LenTxb.Text = openFileDialog.FileName
End If
End Sub
Private Sub LenMinTxb_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles LenMinTxb.KeyPress
'#### Nur Zahlen und Backspace
Select Case Asc(e.KeyChar)
Case 48 To 57, 8
' Zahlen, Backspace
Case Else
' alle anderen Eingaben unterdrücken
e.Handled = True
End Select
End Sub
Private Sub LenMaxTxb_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles LenMaxTxb.KeyPress
'#### Nur Zahlen und Backspace
Select Case Asc(e.KeyChar)
Case 48 To 57, 8
' Zahlen, Backspace
Case Else
' alle anderen Eingaben unterdrücken
e.Handled = True
End Select
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
If LenTxb.TextLength < 1 Or LenMinTxb.TextLength < 1 Or LenMaxTxb.TextLength < 1 Then
If My.Settings.Eng = True Then MsgBox("You have to fill in the input fields.", vbSystemModal)
If My.Settings.Eng = False Then MsgBox("Sie müssen die Felder ausfüllen.", vbSystemModal)
Exit Sub
End If
Dim Date3 As String = Format(Now, "yyyyMMdd_HHmmss")
Dim process As New Process()
process.StartInfo.FileName = "cmd.exe"
process.StartInfo.WorkingDirectory = Application.StartupPath & "\Packages\Hashbull_lib\HCUtils"
process.StartInfo.Arguments = ("/k len.exe " & LenMinTxb.Text & " " & LenMaxTxb.Text & " <" & LenTxb.Text & "> " & Application.StartupPath & "\#_Wordlists\Len_Wordlist_" & Date3 & ".txt")
process.Start()
If My.Settings.Eng = True Then MsgBox("The output file was created in the folder ""#_Wordlist"". The process may take some time for large files.")
If My.Settings.Eng = False Then MsgBox("Die Ausgabedatei wird nach Fertigstellung in den Ordner ""#_Wordlist"" gespeichert. Bei sehr großen Dateien kann der Vorgang einige Zeit in Anspruch nehmen.")
End Sub
End Class