Example #1
0
        sys.stdout.write(','.join([k for k in hash_algorithms]) + W +
                         " index ...\n")
        sys.stdout.flush()
        index_wordlist(fword, fout, hash_algorithms, flock)
        sys.stdout.write(clear + INFO +
                         "Completed index file %s\n" % args.output)
    sys.stdout.write(clear + MONEY + 'All Done.\n')


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Create unsorted json files')
    parser.add_argument('-w',
                        dest='wordlist',
                        help='index passwords from text file',
                        required=True)
    parser.add_argument('-a',
                        nargs='*',
                        dest='algorithms',
                        help='hashing algorithm to use: %s' %
                        (['all'] + sorted(algorithms.keys())),
                        required=True)
    parser.add_argument('-o',
                        dest='output',
                        default=getcwd(),
                        help='output directory to write data to')
    args = parser.parse_args()
    if path.exists(args.wordlist) and path.isfile(args.wordlist):
        main(args)
    else:
        sys.stderr.write('Wordlist does not exist, or is not file')
Example #2
0
def get_default_algorithms():
    env_algos = os.environ.get('DISTGEN_ALGORITHMS', None)
    if env_algos is None or env_algos == '':
        return ['all']
    else:
        return env_algos.split(' ')


if __name__ == '__main__':
    parser = argparse.ArgumentParser(
        description='Create JSON keyspaces for hashes')
    
    parser.add_argument('-a',
        nargs='*',
        dest='algorithms',
        default=get_default_algorithms(),
        help='hashing algorithm to use: %s' % (['all']+ sorted(algorithms.keys())))

    parser.add_argument('-Q',
        dest='sqs_queue',
        default=os.environ.get('DISTGEN_SQS_QUEUE', 'big_rainbow_distgen'),
        help='sqs queue name (should be fifo queue)')

    parser.add_argument('-b',
        dest='s3_bucket',
        default=os.environ.get('DISTGEN_S3_BUCKET', 'big-rainbow-distgen'),
        help='s3 bucket name to store results')
    
    main(parser.parse_args())
Example #3
0
            h, w, c = img.shape
            cam = pyvirtualcam.Camera(width=w, height=h, fps=20)
        if len(img.shape) == 2:
            img = np.stack([img, img, img], axis=2)
        cv2.imshow(WINDOW_NAME, img)
        img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
        cam.send(img)
        cam.sleep_until_next_frame()

else:
    raise Exception("OS %s not known!" % current_os)

# Define CV algorithms you want to use in the application
from algorithms import algorithms

current_algorithm_id = sorted(algorithms.keys())[0]
current_algorithm = algorithms[current_algorithm_id]()
cv2.setMouseCallback(WINDOW_NAME, current_algorithm.mouse_callback)

print("=== FINISHED INITIALIZING FRAMEWORK === \n\n")
'''
Following code runs the processing loop
'''
print("=== RUN PROCESSING LOOP === ")
input_source = args.camera if args.camera != -1 else args.video
print("Using input source", input_source)
cap = cv2.VideoCapture(input_source)
last_read = datetime.datetime.now()
auto_focus = True
auto_exposure = True
while True:
Example #4
0
                     help='decode hashes using an encoder')
 parser.add_argument('-w',
                     '--wordlist',
                     dest='wordlist',
                     help='wordlist file',
                     required=True)
 parser.add_argument('-i',
                     '--index',
                     dest='index',
                     help='the .idx file matching the wordlist',
                     required=True)
 parser.add_argument('-a',
                     '--algorithm',
                     dest='algorithm',
                     help='hashing algorithm: %s' %
                     sorted(algorithms.keys()),
                     required=True)
 parser.add_argument('-c',
                     '--crack',
                     nargs='*',
                     dest='hash',
                     help='crack a file or list of hashes')
 args = parser.parse_args()
 table = LookupTable(algorithm=args.algorithm.lower(),
                     index_file=args.index,
                     wordlist_file=args.wordlist,
                     verbose=args.debug)
 if args.hash is not None:
     _cli(args, table)
 else:
     sys.stdout.write(WARN + 'No input hashes, see --help\n')
Example #5
0
from algorithms import algorithms
from algorithms.error_corrections import CorrectedReads
from io_utils import dump_output
from io_utils import parse_input

DEFAULT_ALGORITHM = 'OLC'


@click.command()
@click.argument('input_file_name')
@click.argument('output_file_name', required=False, default='output.fasta')
@click.option('--algorithm',
              required=False,
              default=DEFAULT_ALGORITHM,
              type=click.Choice([key for key in algorithms.keys()]))
@click.option('--no-error_correction', is_flag=True)
def _assembly(input_file_name, output_file_name, algorithm,
              no_error_correction):
    return assembly(input_file_name,
                    output_file_name,
                    algorithm,
                    error_correction=not no_error_correction)


def assembly(input_file_name, output_file_name, algorithm, error_correction):
    data = parse_input(input_file_name)
    if error_correction:
        data = CorrectedReads(data)
    do_assembly = algorithms[algorithm]
    result = do_assembly(data)
Example #6
0
                     dest='debug',
                     help='debug/verbose mode')
 parser.add_argument('-e', '--decoder',
                     dest='decoder',
                     help='decode hashes using an encoder')
 parser.add_argument('-w', '--wordlist',
                     dest='wordlist',
                     help='wordlist file',
                     required=True)
 parser.add_argument('-i', '--index',
                     dest='index',
                     help='the .idx file matching the wordlist',
                     required=True)
 parser.add_argument('-a', '--algorithm',
                     dest='algorithm',
                     help='hashing algorithm: %s' % sorted(algorithms.keys()),
                     required=True)
 parser.add_argument('-c', '--crack',
                     nargs='*',
                     dest='hash',
                     help='crack a file or list of hashes')
 args = parser.parse_args()
 table = LookupTable(
     algorithm=args.algorithm.lower(),
     index_file=args.index,
     wordlist_file=args.wordlist,
     verbose=args.debug)
 if args.hash is not None:
     _cli(args, table)
 else:
     sys.stdout.write(WARN + 'No input hashes, see --help\n')