-
Notifications
You must be signed in to change notification settings - Fork 0
/
exampleAnalysis.py
81 lines (69 loc) · 3.02 KB
/
exampleAnalysis.py
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
# Example script to run a simple analysis
from scripts.analysisBase import Analyzer
import scripts.rules as rules
import scripts.dataLoader as dataLoader
import scripts.libCheck as libCheck
import scripts.analyzes as analyzes
# Load data
passinfo_list, pcl_data = dataLoader.LoadFromCSV(
'outputs/RockYou_3used_5pcl.csv', #'RockYou_3used_5pcl.csv',
).load()
'''
# Load data to list [pass_0, pass_1]
password_list = dataLoader.LoadFromFile(
"inputs/wordlist_trim.txt",
"UTF-8"
).load()
# Create class that contain rules
transformation = rules.Transformation()
transformation.add(rules.CapitalizeFirstLetter())
transformation.add(rules.CapitalizeLastLetter())
transformation.add(rules.AddTwoRandomDigitsAsPostfixOrPrefix())
transformation.add(rules.ApplyAdvancedl33tTable())
transformation.add(rules.ChangeRandomLetterToRandomLetter())
transformation.add(rules.AddRandomLetterAsPostfixOrPrefix())
# Applying transformations to passwordsq
passinfo_list = transformation.apply(password_list)
# Create class that contain password checking libraries
pcl = libCheck.PassCheckLib()
#pcl.add(libCheck.CrackLib())
#pcl.add(libCheck.PassWDQC())
pcl.add(libCheck.Pwscore())
#pcl.add(libCheck.Zxcvbn())
#pcl.add(libCheck.Passfault())
# Check passwords with pcls
pcl_data = pcl.check(passinfo_list)
# Store data to JSON
#dataLoader.SaveDataToJson().save(passinfo_list, pcl_data)
#dataLoader.SaveDataToCSV(file_path='outputs/Transform_2pcl_advanced.csv').save(passinfo_list, pcl_data)
dataLoader.AppendDataToCSV(file_path='outputs/Transform_4pcl_advanced.csv').save(passinfo_list, pcl_data)
'''
# Run analyzes
analyzer = Analyzer(passinfo_list, pcl_data)
#analyzer.addAnalysis(analyzes.PassfaultScoring())
#analyzer.addAnalysis(analyzes.ZxcvbnPalindrom())
#analyzer.addAnalysis(analyzes.ZxcvbnDictionary())
#analyzer.addAnalysis(analyzes.PassfaultKeyboardSequence())
#analyzer.addAnalysis(analyzes.PassWDQCPasswordPattern())
#analyzer.addAnalysis(analyzes.ZxcvbnPasswordPattern())
#analyzer.addAnalysis(analyzes.ZxcvbnPwscorePasswordPattern())
# New analyzes
#analyzer.addAnalysis(analyzes.PassfaultOneMatch())
#analyzer.addAnalysis(analyzes.PassfaultMatchWorstPasswords())
#analyzer.addAnalysis(analyzes.ZxcvbnCommonPasswords())
#analyzer.addAnalysis(analyzes.EmailAddresses())
#analyzer.addAnalysis(analyzes.CracklibPwscorePattern())
#analyzer.addAnalysis(analyzes.PassWDQCPasswordLength())
# Analyzes for PCLs comparison
analyzer.addAnalysis(analyzes.LibrariesSummary())
#analyzer.addAnalysis(analyzes.LibrariesTopOkPasswords())
#analyzer.addAnalysis(analyzes.AllRejectedOneAccepted())
#analyzer.addAnalysis(analyzes.AllAccepted())
#analyzer.addAnalysis(analyzes.LibrariesCrackLibTopRejection())
#analyzer.addAnalysis(analyzes.LibrariesPassWDQCTopRejection())
#analyzer.addAnalysis(analyzes.LibrariesPassfaulTopRejection())
#analyzer.addAnalysis(analyzes.LibrariesPwscoreTopRejection())
#analyzer.addAnalysis(analyzes.LibrariesZxcvbnTopRejection())
#analyzer.addAnalysis(analyzes.PassfaultOriginalOverallSummary())
#analyzer.addAnalysis(analyzes.TestAnalysis())
analyzer.runAnalyzes()