From 86654a6fb1473c894b01e74f13791a71c03bae8a Mon Sep 17 00:00:00 2001 From: cktricky Date: Thu, 5 Apr 2018 14:18:08 -1000 Subject: [PATCH] as far as I can tell, this works except that I am getting errors because of python 2.7 and printing --- libs/__init__.py | 10 ++++++++++ libs/brute.py | 5 ++++- weirdAAL.py | 5 +++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/libs/__init__.py b/libs/__init__.py index 8b13789..367e6ee 100644 --- a/libs/__init__.py +++ b/libs/__init__.py @@ -1 +1,11 @@ +import os +list_of_files = os.listdir('.') +arry = [] + +for file in list_of_files: + filename_and_ext = os.path.splitext(file) + if filename_and_ext[1] == ".py": + arry.append(filename_and_ext[0]) + +__all__ = arry diff --git a/libs/brute.py b/libs/brute.py index 859ff7c..58943c1 100644 --- a/libs/brute.py +++ b/libs/brute.py @@ -21,6 +21,9 @@ def get_accountid(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY): # print username # return username +def step_app(): + print('hiiiiiii') + def check_root_account(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY): client = boto3.client('iam', aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY) @@ -817,7 +820,7 @@ def brute_machinelearning_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY): #NO functions to call without arguements #http://boto3.readthedocs.io/en/latest/reference/services/mgh.html -#TODO +#TODO #http://boto3.readthedocs.io/en/latest/reference/services/mobile.html #TODO diff --git a/weirdAAL.py b/weirdAAL.py index 6045b5a..5586b88 100755 --- a/weirdAAL.py +++ b/weirdAAL.py @@ -11,6 +11,7 @@ import argparse import os from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY from botocore.exceptions import ClientError +from libs import * parser = argparse.ArgumentParser() parser.add_argument("-s", "--step", help="list the step you would like to run", @@ -35,9 +36,9 @@ def step_recon(): def method_create(): try: - arg = eval("step_" + args.step) + arg = globals()["step_" + args.step]#arg = eval("step_" + args.step) return arg - except NameError: + except KeyError: print("That step does not exist") exit(1)