Skip to content
Róbert Kolcún edited this page Sep 19, 2017 · 2 revisions

Implement your own password checking library

In file libCheck.py you can add your own password checking library. Create new class with your password_checking_library_name. Output of your password checking library must be in format:

_password_ (spaces or tabs) _library_output_

or

_password_ _delimiter_ _library_output_

class password_checking_library_name(Library):

  def __init__(self):
    """
    single_pass -- boolean, false if is necessary to run PCL for every password,
                   true if PCL can check bunch of passwords at once in format 'pass1\npass2\n'
    delimiter -- string or None, if is necessary to split library output
    delimiter_index -- integer, index of item in list after spliting library output which contain library output
    *args -- arguments for run/call password checking library
    """
    super(password_checking_library_name, self).__init__(
      single_pass,
      delimiter,
      delimiter_index,
      *args
    )

Run analysis

You can edit analysis options by following commands:

Options to load input data:

password_list = dataLoader.LoadFromStdin().load()
password_list = dataLoader.LoadFromFile(file_path='file_path').load()
passinfo_list, pcl_data = dataLoader.LoadFromJson(file_path='file_path').load()
passinfo_list, pcl_data = dataLoader.LoadFromCSV(file_path='file_path', from_row=None, to_row=None).load()

Apply different rules to transform passwords

Create transformation class
transformation = rules.Transformation()
Add rules
transformation.add(rules.CapitalizeAllLetters())
transformation.add(rules.CapitalizeFirstLetter())
transformation.add(rules.CapitalizeLastLetter())
transformation.add(rules.LowerAllLetters())
transformation.add(rules.LowerFirstLetter())
transformation.add(rules.LowerLastLetter())
transformation.add(rules.ApplySimplel33tTable())
transformation.add(rules.ApplyAdvancedl33tTable())
Applying transformations to passwords
passinfo_list = transformation.apply(password_list)

Check passwords with implemented password checking libraries

Create password checking libraries class
pcl = libCheck.PassCheckLib()
Add password checking library
pcl.add(libCheck.CrackLib())
pcl.add(libCheck.PassWDQC())
pcl.add(libCheck.Pwscore())
pcl.add(libCheck.Zxcvbn())
pcl.add(libCheck.Passfault())
Check passwords with password checking libraries
pcl_data = pcl.check(passinfo_list)

Save or append data to file

dataLoader.SaveDataToJson(file_path='').save(passinfo_list, pcl_data)
dataLoader.SaveDataToCSV(file_path='').save(passinfo_list, pcl_data)
dataLoader.AppendDataToCSV(file_path='').save(passinfo_list, pcl_data)

Create main analyzer

Analysis output is written to outputs/analysis_data_time_count.output file

analyzer = analysisStruct.Analyzer(passinfo_list, pcl_data)
Add analysis
analyzer.addAnalysis(analysisStruct.analysis_class())
Run list of analyzes
analyzer.runAnalyzes()

Implement your own analysis

In file analysisStruct.py you can add your own analysis. Create new class with your analysis_name.

class analysis_name(AnalysisTemplate):

  def runAnalysis(self):
    # You can load one of 3 data_set
    self.setData(self.analyzer.data_set['all_passwords'])
    self.setData(self.analyzer.data_set['orig_passwords'])
    self.setData(self.analyzer.data_set['trans_passwords'])

    # Filter data with filters
    # Clear filter
    self.clearFilter()
    # Add filter
    self.addFilter(data_filter.filter_name())
    # Filter classes and input arguments
    data_filter.LowEntropyChange('integer')
    data_filter.PCLOutputChangedFromOk2NotOk('list_of_pcls')
    data_filter.PCLOutputChangedFromNotOk2Ok('list_of_pcls')
    data_filter.PCLOutputsAreNotAllSame()
    data_filter.TransformationHadEffect('list_of_transformations')
    data_filter.OriginalPCLOutputIsOk('list_of_pcls')
    data_filter.TransformedPCLOutputIsOk('list_of_pcls')
    data_filter.OriginalPCLOutputIsNotOk('list_of_pcls')
    data_filter.TransformedPCLOutputIsNotOk('list_of_pcls')
    data_filter.ScoreHigher({'pcl_name': pcl_score_threshold})
    data_filter.ScoreLower({'pcl_name': pcl_score_threshold})
    data_filter.ChangePCLOutputByScore(None or {'pcl_name': pcl_score_threshold})
    data_filter.PasswordLengthLower('integer')
    data_filter.PasswordLengthHigher('integer')
    data_filter.RemovePCLOutput('list_of_pcls')
    data_filter.PasswordContainString('string')
    data_filter.PCLOutputContainString({'pcl_name', 'contain_string'})
    data_filter.PCLOutputDoesNotContainString({'pcl_name', 'not_contain_string'})
    data_filter.NumberOfDifferentCharactersLower('integer')
    data_filter.NumberOfDifferentCharactersHigher('integer')
    data_filter.PasswordContainCharacterClass('list_of_classes')
    data_filter.PasswordContainOnlyCharacterClass('list_of_classes')
    # Apply filter
    data_filter.applyFilter()

    # Create table with several options
    table = data_table.table_name(self.getData()).getTable(
      sortby='collumn_name',
      reversesort='boolean',
      start='row_index',
      end='row_index',
      fields=['collumn1_name', 'collumn5_name']
    )
    # Table classes
    data_table.ComplexPassword()
    data_table.ComplexTransformedPassword()
    data_table.OverallSummary()
    data_table.PasswordWithPCLOutputs()
    data_table.SummaryScore()
    data_table.DiffChar()
    data_table.PasswordLength()

    # Print table or some description to file
    # This will print data to file with default name('analysis_date_time_count_.output')
    self.printToFile(table)
    # Or you can specify the filename
    self.printToFile(table, filename='file_path')