Пример #1
0
def main():

    start = time.time()  # get program start time
    args = docopt(usage, version=version)  # get arguments
    pwndb = core.pwndb(args)  # load functions
    banner.print_banner(project, version, author)  # print sexy banner

    print('{}> Searching{}'.format(GREEN, RESET))

    result = pwndb.search_info()  # start search and get results
    print_result_table(result)  # print results
    end = time.time() - start  # get time within the program

    if args['--output']:
        filename = args['FILENAME']  # get file name
        generate_json_file(result,
                           filename)  # generate json file with the results
Пример #2
0
def main():
    start = time.time()
    args = docopt(usage, version=version)  # load args
    pwndb = core.pwndb(args)
    banner.print_banner(project, version, author)  # print banner

    print(':{} Searching{}'.format(GREEN, RESET))
    # get search results
    result = pwndb.search_info()

    if not result:
        end = time.time() - start
        print(':{} Results:{}'.format(GREEN, RESET))
        print(':{} 0 Results found in {:.2f} segs.{}'.format(
            GREEN, end, RESET))
        sys.exit()

    # print results
    print(':{} Results:{}\n'.format(GREEN, RESET))
    length = [result[key]['email'] for key in result.keys()]
    length = len(max(length, key=len))

    for key in result.keys():
        print('- {} | {}'.format(result[key]['email'].ljust(length),
                                 result[key]['passw']))

    end = time.time() - start
    print('\n: {}{} Results found in {:.2f} segs.{}'.format(
        GREEN, len(result.keys()), end, RESET))

    if args['--output']:
        output = json.dumps(result, indent=2)
        filename = args['FILENAME']
        filename = filename if filename else '%s' % time.strftime(
            '%d%m%y-%H%M%S')
        f = open('%s.json' % filename, 'w')
        f.write(output)
        f.close()
        print(': The file %s.json was created.' % filename)