Merge pull request #20 from carnal0wnage/build_in_some_logic

METAPOGRAMMING FTW
This commit is contained in:
Ken Johnson
2018-04-06 00:10:39 -10:00
committed by GitHub
7 changed files with 42 additions and 6 deletions

View File

@@ -1 +1,11 @@
import os
from libs.utils.common import *
# Get the application's path (wherever weirdAAL.py is located will be the dirpath )
dirpath = os.getcwd()
# The actual location of this file on the filesystem is the "foldername"
foldername = os.path.dirname(os.path.realpath(__file__))
all_files = list_all_files(foldername)
__all__ = all_files

View File

@@ -849,7 +849,7 @@ def brute_machinelearning_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
#NO functions to call without arguements #NO functions to call without arguements
#http://boto3.readthedocs.io/en/latest/reference/services/mgh.html #http://boto3.readthedocs.io/en/latest/reference/services/mgh.html
#TODO #TODO
#http://boto3.readthedocs.io/en/latest/reference/services/mobile.html #http://boto3.readthedocs.io/en/latest/reference/services/mobile.html
#TODO #TODO

0
libs/utils/__init__.py Normal file
View File

12
libs/utils/common.py Normal file
View File

@@ -0,0 +1,12 @@
import os
def list_all_files(directory):
list_of_files = os.listdir(directory)
array = []
for file in list_of_files:
filename_and_ext = os.path.splitext(file)
if filename_and_ext[1] == ".py":
array.append(filename_and_ext[0])
return array

11
modules/__init__.py Normal file
View File

@@ -0,0 +1,11 @@
import os
from libs.utils.common import *
# Get the application's path (wherever weirdAAL.py is located will be the dirpath )
dirpath = os.getcwd()
# The actual location of this file on the filesystem is the "foldername"
foldername = os.path.dirname(os.path.realpath(__file__))
all_files = list_all_files(foldername)
__all__ = all_files

View File

@@ -5,9 +5,11 @@ from libs.iam import *
from libs.sts import * from libs.sts import *
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
get_accountid(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
check_root_account(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) def step_cg_test():
get_password_policy(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) get_accountid(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
check_root_account(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
get_password_policy(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
#create_access_key(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,'pythons3') #create_access_key(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,'pythons3')
#delete_access_key(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,'pythons3', 'AKIAIJV3RQMOYM7WQS2Q') #delete_access_key(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,'pythons3', 'AKIAIJV3RQMOYM7WQS2Q')
#change_user_console_password(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, 'pythons3', 'PS#EDCasd123456!@') #change_user_console_password(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, 'pythons3', 'PS#EDCasd123456!@')

View File

@@ -11,6 +11,7 @@ import argparse
import os import os
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
from botocore.exceptions import ClientError from botocore.exceptions import ClientError
from modules import *
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("-s", "--step", help="list the step you would like to run", parser.add_argument("-s", "--step", help="list the step you would like to run",
@@ -35,9 +36,9 @@ def step_recon():
def method_create(): def method_create():
try: try:
arg = eval("step_" + args.step) arg = globals()["step_" + args.step]
return arg return arg
except NameError: except KeyError:
print("That step does not exist") print("That step does not exist")
exit(1) exit(1)