Merge pull request #3 from cmc/master
refactor, tidy up, split out config
This commit is contained in:
@@ -2,22 +2,8 @@
|
||||
example calling cloudwatch functions
|
||||
decribe alarms, describe alarm history, list metrics
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.cloudwatch import *
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
describe_alarms(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
describe_alarm_history(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
|
||||
@@ -1,23 +1,8 @@
|
||||
'''
|
||||
data pipeline example
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.datapipeline import *
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
|
||||
list_pipelines(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
@@ -1,23 +1,8 @@
|
||||
'''
|
||||
dynamoDB examples
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.dynamodb import *
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
list_dynamodb_tables(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
list_dynamodb_tables_detailed(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
@@ -1,24 +1,7 @@
|
||||
'''
|
||||
This file is used to list ec2 instances
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.ec2 import *
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
get_instance_details(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
|
||||
@@ -1,25 +1,8 @@
|
||||
'''
|
||||
This file is used to list volumes of ec2 instances
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.ec2 import *
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
get_instance_volume_details(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
get_instance_volume_details2(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
|
||||
@@ -2,23 +2,7 @@
|
||||
'''
|
||||
This file is used to list EBS volumes and whether or not they are encrypted. This is only for "in-use" (running) volumes.
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.ec2 import *
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
review_encrypted_volumes(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
|
||||
@@ -1,25 +1,8 @@
|
||||
'''
|
||||
This file is used to perform some ElasticBeanstalk actions
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.elasticbeanstalk import *
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
#describe_applications(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
#describe_application_versions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
|
||||
@@ -1,25 +1,8 @@
|
||||
'''
|
||||
This file is used to perform some EMR actions
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.emr import *
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
|
||||
list_clusters(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
|
||||
20
iam_pwn.py
20
iam_pwn.py
@@ -1,27 +1,9 @@
|
||||
'''
|
||||
if you have root or IAM access gather user info, manipulate access keys or passwords, make backdoor account
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.iam import *
|
||||
from libs.sts import *
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
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)
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
'''
|
||||
This file is used to list lambda functions and event mappings
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.aws_lambda import *
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
list_functions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
list_event_source_mappings(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
@@ -1,18 +1,4 @@
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.opsworks import *
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
describe_stacks(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
@@ -1,20 +1,4 @@
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
from libs.rds import *
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY =''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
describe_db_instances(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.brute import *
|
||||
from libs.s3 import *
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
check_root_account(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
brute_acm_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
@@ -37,7 +23,7 @@ brute_cognitoidentity_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
brute_cognitoidp_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
brute_cognitosync_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
brute_configservice_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
#brute_costandusagereportservice_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) #Could not connect to the endpoint URL: "https://cur.us-west-2.amazonaws.com/"
|
||||
#brute_costandusagereportservice_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) #Could not connect to the endpoint URL: "https://cur.us-west-2.amazonaws.com/"
|
||||
brute_datapipeline_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
brute_devicefarm_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
brute_directconnect_permissions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
|
||||
@@ -1,21 +1,10 @@
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
import sys
|
||||
from libs.s3 import *
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY = ''
|
||||
if len(sys.argv) < 2:
|
||||
print "must specify bucket: {} <bucketname>".format(sys.argv[0])
|
||||
sys.exit(-1)
|
||||
|
||||
#Attempt to list the contents of the bucket
|
||||
get_s3bucket_policy(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,'myfuckingbucket')
|
||||
get_s3bucket_policy(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, sys.argv[1])
|
||||
|
||||
@@ -1,25 +1,11 @@
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.s3 import *
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY =''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
#open a list of possible buckets and attempt to list the contents
|
||||
f = open('test.txt', 'r')
|
||||
for line in f:
|
||||
with open('bucket_list.txt', 'r') as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
else:
|
||||
get_s3bucket_policy(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,line)
|
||||
get_s3bucket_policy(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, line)
|
||||
|
||||
@@ -1,20 +1,4 @@
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.s3 import *
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
#AWS_ACCESS_KEY_ID = ''
|
||||
#AWS_SECRET_ACCESS_KEY =''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
get_s3objects_for_account_detailed(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
@@ -1,20 +1,4 @@
|
||||
import boto3
|
||||
import botocore
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import logging
|
||||
import sys,os
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
from libs.s3 import *
|
||||
|
||||
#insert AWS key, will figure out how to pull this in from a single file for all scripts
|
||||
|
||||
AWS_ACCESS_KEY_ID = ''
|
||||
AWS_SECRET_ACCESS_KEY =''
|
||||
|
||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||
|
||||
get_s3objects_for_account(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||
Reference in New Issue
Block a user