pep8 mostly
This commit is contained in:
@@ -1,8 +0,0 @@
|
|||||||
|
|
||||||
'''
|
|
||||||
This file is used to list EBS volumes and whether or not they are encrypted. This is only for "in-use" (running) volumes.
|
|
||||||
'''
|
|
||||||
from libs.ec2 import *
|
|
||||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
|
||||||
|
|
||||||
review_encrypted_volumes(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
|
||||||
1282
libs/brute.py
1282
libs/brute.py
File diff suppressed because it is too large
Load Diff
@@ -5,12 +5,14 @@ dynamoDB functions
|
|||||||
import boto3
|
import boto3
|
||||||
import botocore
|
import botocore
|
||||||
import pprint
|
import pprint
|
||||||
import sys,os
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||||
|
|
||||||
#from http://docs.aws.amazon.com/general/latest/gr/rande.html
|
# from http://docs.aws.amazon.com/general/latest/gr/rande.html
|
||||||
regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', ]
|
regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2']
|
||||||
|
|
||||||
|
|
||||||
def list_dynamodb_tables(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
|
def list_dynamodb_tables(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
|
||||||
print("### Printing DynamoDB Tables ###")
|
print("### Printing DynamoDB Tables ###")
|
||||||
@@ -38,6 +40,7 @@ def list_dynamodb_tables(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("CTRL-C received, exiting...")
|
print("CTRL-C received, exiting...")
|
||||||
|
|
||||||
|
|
||||||
def list_dynamodb_tables_detailed(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
|
def list_dynamodb_tables_detailed(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
|
||||||
print("### Printing DynamoDB Tables ###")
|
print("### Printing DynamoDB Tables ###")
|
||||||
try:
|
try:
|
||||||
@@ -64,25 +67,26 @@ def list_dynamodb_tables_detailed(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("CTRL-C received, exiting...")
|
print("CTRL-C received, exiting...")
|
||||||
|
|
||||||
|
|
||||||
def describe_table(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, table, region):
|
def describe_table(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, table, region):
|
||||||
print("### Describing DynamoDB Table: {} ###" .format(table))
|
print("### Describing DynamoDB Table: {} ###" .format(table))
|
||||||
try:
|
try:
|
||||||
client = boto3.client('dynamodb', aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY, region_name=region)
|
client = boto3.client('dynamodb', aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY, region_name=region)
|
||||||
response = client.describe_table(TableName=table)
|
response = client.describe_table(TableName=table)
|
||||||
if response.get('Table') is None:
|
if response.get('Table') is None:
|
||||||
print("{} likely does not have DynamoDB permissions\n" .format(AWS_ACCESS_KEY_ID))
|
print("{} likely does not have DynamoDB permissions\n" .format(AWS_ACCESS_KEY_ID))
|
||||||
elif len(response['Table']) <= 0:
|
elif len(response['Table']) <= 0:
|
||||||
print("[-] DescribeTable allowed for {} but no results [-]" .format(region))
|
print("[-] DescribeTable allowed for {} but no results [-]" .format(region))
|
||||||
else:
|
else:
|
||||||
print("TableArn: {}" .format(response['Table']['TableArn']))
|
print("TableArn: {}" .format(response['Table']['TableArn']))
|
||||||
print("AttributeDefinitions: {}" .format(response['Table']['AttributeDefinitions']))
|
print("AttributeDefinitions: {}" .format(response['Table']['AttributeDefinitions']))
|
||||||
print("ProvisionedThroughput: {}" .format(response['Table']['ProvisionedThroughput']))
|
print("ProvisionedThroughput: {}" .format(response['Table']['ProvisionedThroughput']))
|
||||||
print("TableSizeBytes: {}" .format(response['Table']['TableSizeBytes']))
|
print("TableSizeBytes: {}" .format(response['Table']['TableSizeBytes']))
|
||||||
print("TableName: {}" .format(response['Table']['TableName']))
|
print("TableName: {}" .format(response['Table']['TableName']))
|
||||||
print("TableStatus: {}" .format(response['Table']['TableStatus']))
|
print("TableStatus: {}" .format(response['Table']['TableStatus']))
|
||||||
print("KeySchema: {}" .format(response['Table']['KeySchema']))
|
print("KeySchema: {}" .format(response['Table']['KeySchema']))
|
||||||
print("ItemCount: {}" .format(response['Table']['ItemCount']))
|
print("ItemCount: {}" .format(response['Table']['ItemCount']))
|
||||||
print("CreationDateTime: {}" .format(response['Table']['CreationDateTime']))
|
print("CreationDateTime: {}" .format(response['Table']['CreationDateTime']))
|
||||||
print("\n")
|
print("\n")
|
||||||
|
|
||||||
except botocore.exceptions.ClientError as e:
|
except botocore.exceptions.ClientError as e:
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
'''
|
'''
|
||||||
dynamoDBstreams functions
|
dynamoDBstreams functions
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import boto3
|
import boto3
|
||||||
import botocore
|
import botocore
|
||||||
import pprint
|
import pprint
|
||||||
import sys,os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||||
|
|
||||||
#from http://docs.aws.amazon.com/general/latest/gr/rande.html
|
# from http://docs.aws.amazon.com/general/latest/gr/rande.html
|
||||||
regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', ]
|
regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2']
|
||||||
|
|
||||||
|
|
||||||
def list_dynamodbstreams(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
|
def list_dynamodbstreams(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
'''
|
'''
|
||||||
data pipeline example
|
data pipeline example
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from libs.datapipeline import *
|
from libs.datapipeline import *
|
||||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||||
|
|
||||||
|
|
||||||
def step_datapipeline_list_pipelines():
|
def step_datapipeline_list_pipelines():
|
||||||
list_pipelines(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
list_pipelines(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
'''
|
'''
|
||||||
This file is used to perform various EC2 operations
|
This file is used to perform various EC2 operations
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from libs.ec2 import *
|
from libs.ec2 import *
|
||||||
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Basic info about each instance
|
Basic info about each EC2 instance
|
||||||
|
ex:
|
||||||
|
[+] Listing instances for region: us-west-2 [+]
|
||||||
|
InstanceID: i-XXXXXXXXXXXXXXX, InstanceType: t2.micro, State: {'Code': 80, 'Name': 'stopped'}, Launchtime: 2016-08-25 22:31:31+00:00
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +18,7 @@ def step_ec2_get_instances_basic():
|
|||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
All info about each instance
|
All info about each EC2 instance
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
@@ -38,3 +42,12 @@ show volumes by instanceId but instanceID->volume1 of ID, instanceID->volume2 of
|
|||||||
|
|
||||||
def step_ec2_get_instance_volume_details2():
|
def step_ec2_get_instance_volume_details2():
|
||||||
get_instance_volume_details2(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
get_instance_volume_details2(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||||
|
|
||||||
|
|
||||||
|
'''
|
||||||
|
This function is used to list EBS volumes and whether or not they are encrypted. This is only for "in-use" (running) volumes.
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
def step_ec2_review_encrypted_volumes():
|
||||||
|
review_encrypted_volumes(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
||||||
|
|||||||
Reference in New Issue
Block a user