reworked the logic of modules and what not

This commit is contained in:
cktricky
2018-09-14 20:34:46 -04:00
committed by Kenneth Toler
parent 3930acdd80
commit 3e48296d4e

View File

@@ -25,19 +25,16 @@ for module in all_modules:
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--module", help="list the module you would like to run", action="store", type=str, required=True)
parser.add_argument("-t", "--target", help="Give your target a name so we can track results", action="store", type=str, required=True)
parser.add_argument("-m", "--module", help="list the module you would like to run", action="store", type=str, required=False)
parser.add_argument("-t", "--target", help="Give your target a name so we can track results", action="store", type=str, required=False)
parser.add_argument("-a", "--arguments", help="Provide a list of arguments, comma separated. Ex: arg1,arg2,arg3", action="store", type=str, required=False)
parser.add_argument("-l", "--list", help="list modules", action="store_true")
parser.add_argument("-l", "--list", help="list modules", required=False, action="store_true")
parser.add_argument("-v", "--verbosity", help="increase output verbosity", action="store_true")
args = parser.parse_args()
# Provides us with a global var "db_name" we can access anywhere
builtins.db_name = "weirdAAL.db"
# Provides us with a global var "target" we can access anywhere
builtins.target = args.target
def perform_credential_check():
'''
Check that the AWS keys work before we go any further. It picks the keys up from the local .env file
@@ -71,7 +68,7 @@ except:
sys.exit(1)
if (args.list):
pass
print(all_modules)
# arg_list has to be defined otherwise will cause an exception
@@ -82,6 +79,12 @@ if (args.arguments):
# We need the user to tell us the module they want to proceed on
if (args.module):
if not (args.target):
print("Use -t to give your target a name so we can track results!!!")
sys.exit(1)
else:
# Provides us with a global var "target" we can access anywhere
builtins.target = args.target
arg = method_create()
if callable(arg):
if arg_list: