pep8 and some comments
This commit is contained in:
22
weirdAAL.py
22
weirdAAL.py
@@ -21,20 +21,21 @@ for module in all_modules:
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-s", "--step", help="list the step 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("-a", "--arguments", help="Provide a list of arguments, comma separated. Ex: arg1,arg2,arg3",
|
||||
action="store", type=str, required=False)
|
||||
parser.add_argument("-s", "--step", help="list the step 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("-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 steps", action="store_true")
|
||||
parser.add_argument("-v", "--verbosity", help="increase output verbosity",
|
||||
action="store_true")
|
||||
parser.add_argument("-v", "--verbosity", help="increase output verbosity", action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
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
|
||||
We are letting boto3 do all the work that way we can handle session tokens natively
|
||||
'''
|
||||
|
||||
try:
|
||||
#client = boto3.client("sts", aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY)
|
||||
client = boto3.client("sts")
|
||||
account_id = client.get_caller_identity()["Account"]
|
||||
except botocore.exceptions.NoCredentialsError as e:
|
||||
@@ -44,9 +45,11 @@ def perform_credential_check():
|
||||
print("The AWS Access Keys are not valid/active")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def step_recon():
|
||||
print("!!!")
|
||||
|
||||
|
||||
def method_create():
|
||||
try:
|
||||
arg = globals()["step_" + args.step]
|
||||
@@ -55,6 +58,7 @@ def method_create():
|
||||
print("That step does not exist")
|
||||
exit(1)
|
||||
|
||||
|
||||
# Need to figure out if we have keys in the ENV or not
|
||||
if AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY:
|
||||
perform_credential_check()
|
||||
|
||||
Reference in New Issue
Block a user