Esempio n. 1
0
                                   help='Run svn module')
parser_svn.set_defaults(func=runSVNModule, auditType='svn')

#2.h- Run wifi module
parser_wifi = subparsers.add_parser('wifi',
                                    parents=[PPoptional, PWifi, PWrite],
                                    help='Run wifi module')
parser_wifi.set_defaults(func=runWifiModule, auditType='wifi')

#2.i- Run windows module
parser_windows = subparsers.add_parser('windows',
                                       parents=[PPoptional, PWindows, PWrite],
                                       help='Run windows module')
parser_windows.set_defaults(func=runWindowsModule, auditType='windows')

# ------------------------------------------- Parse arguments -------------------------------------------
args = dict(parser.parse_args()._get_kwargs())
arguments = parser.parse_args()
start_time = time.time()
output()
verbosity()
arguments.func()

# print the number of passwords found
if constant.output == 'txt':
    write_footer()
print_footer()

elapsed_time = time.time() - start_time
print 'elapsed time = ' + str(elapsed_time)
Esempio n. 2
0
    parser_tab = [PPoptional, category[c]["parser"]]
    if "subparser" in category[c]:
        if category[c]["subparser"]:
            parser_tab += category[c]["subparser"]
    parser_tab += [PWrite]
    dic_tmp = {c: {"parents": parser_tab, "help": "Run %s module" % c, "func": runModule}}
    dic = dict(dic.items() + dic_tmp.items())

# 2- Main commands
subparsers = parser.add_subparsers(help="Choose a main command")
for d in dic:
    subparsers.add_parser(d, parents=dic[d]["parents"], help=dic[d]["help"]).set_defaults(
        func=dic[d]["func"], auditType=d
    )

# ------------------------------------------- Parse arguments -------------------------------------------
args = dict(parser.parse_args()._get_kwargs())
arguments = parser.parse_args()
start_time = time.time()
output()
verbosity()
arguments.func()

# Print the number of passwords found
if constant.output == "txt":
    write_footer()
print_footer()

elapsed_time = time.time() - start_time
print "elapsed time = " + str(elapsed_time)