diff --git a/libs/ce.py b/libs/ce.py index 48f4446..51273a0 100644 --- a/libs/ce.py +++ b/libs/ce.py @@ -9,7 +9,7 @@ import sys 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', ] ''' @@ -21,16 +21,20 @@ AWS_ACCESS_KEY_ID = credentials.access_key def ce_get_cost_and_usage(): + ''' + Get cost and usage via cost explorer service - usually requires elevated prviliges + ''' try: for region in regions: client = boto3.client('ce', region_name=region) response = client.get_cost_and_usage(TimePeriod={'Start': '2018-01-01', 'End': '2018-04-01'}, Granularity='MONTHLY', Metrics=["BlendedCost", "UnblendedCost", "UsageQuantity"],) print(response) - #if response.get('Services') is None: + # This module needs to be further tested + # if response.get('Services') is None: # print("{} likely does not have Pricing permissions\n" .format(AWS_ACCESS_KEY_ID)) - #elif len(response['Services']) <= 0: + # elif len(response['Services']) <= 0: # print("[-] Describe Pricing Services allowed for {} but no results [-]" .format(region)) - #else: + # else: # print("### {} Services ###" .format(region)) # for tables in response['ServiceCode']: # pp.pprint(tables) @@ -39,7 +43,7 @@ def ce_get_cost_and_usage(): if e.response['Error']['Code'] == 'UnauthorizedOperation': print('{} : (UnauthorizedOperation) when calling the DescribeInstances -- sure you have ec2 permissions?' .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'AccessDeniedException': - print('{} : (AccessDenied) when calling the Get Cost & Usage' .format(AWS_ACCESS_KEY_ID)) + print('{} : (AccessDenied) when calling the Get Cost & Usage' .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'SubscriptionRequiredException': print('{} : Has permissions but isnt signed up for service - usually means you have a root account' .format(AWS_ACCESS_KEY_ID)) else: diff --git a/libs/cloudfront.py b/libs/cloudfront.py index 035efa7..d51f585 100644 --- a/libs/cloudfront.py +++ b/libs/cloudfront.py @@ -22,7 +22,7 @@ AWS_ACCESS_KEY_ID = credentials.access_key def cloudfront_list_distributions(): ''' - cloudfront list distributions + CloudFront list distributions ''' print("### Printing CloudFront Distributions ###") try: @@ -30,7 +30,7 @@ def cloudfront_list_distributions(): client = boto3.client('cloudfront', region_name=region) response = client.list_distributions() - #print(response) + # print(response) if response.get('DistributionList') is None: print("{} likely does not have CloudFront permissions\n" .format(AWS_ACCESS_KEY_ID)) elif len(response['DistributionList']) <= 0: @@ -39,8 +39,7 @@ def cloudfront_list_distributions(): print("### {} CloudFront Distributions ###" .format(region)) for dist in response['DistributionList']['Items']: pp.pprint(dist) - - #pp.pprint(dist['Items'][0]) + # pp.pprint(dist['Items'][0]) print("\n") except botocore.exceptions.ClientError as e: if e.response['Error']['Code'] == 'InvalidClientTokenId': @@ -53,5 +52,3 @@ def cloudfront_list_distributions(): print("Unexpected error: {}" .format(e)) except KeyboardInterrupt: print("CTRL-C received, exiting...") - - diff --git a/libs/cloudtrail.py b/libs/cloudtrail.py index ed276c9..90fcad3 100644 --- a/libs/cloudtrail.py +++ b/libs/cloudtrail.py @@ -11,7 +11,7 @@ import sys pp = pprint.PrettyPrinter(indent=5, width=80) # from http://docs.aws.amazon.com/general/latest/gr/rande.html -regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3', 'ap-south-1', 'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'sa-east-1' ] +regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3', 'ap-south-1', 'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'sa-east-1'] # 'cn-north-1', 'cn-northwest-1', 'us-gov-west-1' throwing An error occurred (UnrecognizedClientException) when calling the DescribeTrails operation: The security token included in the request is invalid. ''' @@ -30,11 +30,8 @@ def describe_trails(): try: for region in regions: client = boto3.client('cloudtrail', region_name=region) - response = client.describe_trails() - # print (response) - # print(region) if response['trailList'] is None: print("{} likely does not have CloudTrail permissions\n" .format(AWS_ACCESS_KEY_ID)) elif len(response['trailList']) <= 0: @@ -49,7 +46,7 @@ def describe_trails(): sys.exit("{} : The AWS KEY IS INVALID. Exiting" .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'AccessDenied': print('{} : Does not have the required permissions' .format(AWS_ACCESS_KEY_ID)) - #elif e.response['Error']['Code'] == 'UnrecognizedClientException': + # elif e.response['Error']['Code'] == 'UnrecognizedClientException': # print('{} : UnrecognizedClientException error' .format(AWS_ACCESS_KEY_ID)) # pass elif e.response['Error']['Code'] == 'SubscriptionRequiredException': @@ -69,11 +66,8 @@ def list_public_keys(): try: for region in regions: client = boto3.client('cloudtrail', region_name=region) - response = client.list_public_keys() - # print (response) - # print(region) if response['PublicKeyList'] is None: print("{} likely does not have CloudTrail permissions\n" .format(AWS_ACCESS_KEY_ID)) elif len(response['PublicKeyList']) <= 0: @@ -106,11 +100,8 @@ def stop_trail(TrailARN): try: for region in regions: client = boto3.client('cloudtrail', region_name=region) - response = client.describe_trails() - # print(response) - if response['trailList'] is None: print("{} likely does not have CloudTrail permissions\n" .format(AWS_ACCESS_KEY_ID)) elif len(response['trailList']) <= 0: @@ -130,7 +121,7 @@ def stop_trail(TrailARN): sys.exit("{} : The AWS KEY IS INVALID. Exiting" .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'AccessDenied': print('{} : Does not have the required permissions' .format(AWS_ACCESS_KEY_ID)) - #elif e.response['Error']['Code'] == 'UnrecognizedClientException': + # elif e.response['Error']['Code'] == 'UnrecognizedClientException': # print('{} : UnrecognizedClientException error' .format(AWS_ACCESS_KEY_ID)) # pass elif e.response['Error']['Code'] == 'SubscriptionRequiredException': @@ -141,6 +132,7 @@ def stop_trail(TrailARN): except KeyboardInterrupt: print("CTRL-C received, exiting...") + def delete_trail(TrailARN): ''' Delete a specified trailARN @@ -150,11 +142,8 @@ def delete_trail(TrailARN): try: for region in regions: client = boto3.client('cloudtrail', region_name=region) - response = client.describe_trails() - # print(response) - if response['trailList'] is None: print("{} likely does not have CloudTrail permissions\n" .format(AWS_ACCESS_KEY_ID)) elif len(response['trailList']) <= 0: @@ -174,7 +163,7 @@ def delete_trail(TrailARN): sys.exit("{} : The AWS KEY IS INVALID. Exiting" .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'AccessDenied': print('{} : Does not have the required permissions' .format(AWS_ACCESS_KEY_ID)) - #elif e.response['Error']['Code'] == 'UnrecognizedClientException': + # elif e.response['Error']['Code'] == 'UnrecognizedClientException': # print('{} : UnrecognizedClientException error' .format(AWS_ACCESS_KEY_ID)) # pass elif e.response['Error']['Code'] == 'SubscriptionRequiredException': diff --git a/libs/cloudwatch.py b/libs/cloudwatch.py index e05dca1..e98edf7 100644 --- a/libs/cloudwatch.py +++ b/libs/cloudwatch.py @@ -10,8 +10,8 @@ import sys pp = pprint.PrettyPrinter(indent=5, width=80) -#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', ] +# 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'] ''' Code to get the AWS_ACCESS_KEY_ID from boto3 @@ -21,14 +21,17 @@ credentials = session.get_credentials() AWS_ACCESS_KEY_ID = credentials.access_key -def describe_alarms(): +def cloudwatch_describe_alarms(): + ''' + Describe CloudWatch alarms + ''' print("### Printing Cloudwatch Alarm Information ###") try: for region in regions: client = boto3.client('cloudwatch', region_name=region) response = client.describe_alarms() - print ("### {} Alarms ###" .format(region)) + print("### {} Alarms ###" .format(region)) for alarm in response['MetricAlarms']: pp.pprint(alarm) print("\n") @@ -46,20 +49,24 @@ def describe_alarms(): except KeyboardInterrupt: print("CTRL-C received, exiting...") -def describe_alarm_history(): + +def cloudwatch_describe_alarm_history(): + ''' + Describe CloudWatch Alarm History + ''' print("### Printing Cloudwatch Alarm History Information ###") try: for region in regions: client = boto3.client('cloudwatch', region_name=region) response = client.describe_alarm_history() - #print response + # print(response) if response.get('AlarmHistoryItems') is None: - print ("{} likely does not have cloudwatch permissions\n" .format(AWS_ACCESS_KEY_ID)) + print("{} likely does not have cloudwatch permissions\n" .format(AWS_ACCESS_KEY_ID)) elif len(response['AlarmHistoryItems']) <= 0: - print ("[-] DecribeAlarmHistory allowed for {} but no results [-]" .format(region)) + print("[-] DecribeAlarmHistory allowed for {} but no results [-]" .format(region)) else: - print ("### {} Alarm History ###" .format(region)) + print("### {} Alarm History ###" .format(region)) for history_item in response['AlarmHistoryItems']: pp.pprint(history_item) print("\n") @@ -67,7 +74,7 @@ def describe_alarm_history(): if e.response['Error']['Code'] == 'InvalidClientTokenId': sys.exit("{} : The AWS KEY IS INVALID. Exiting" .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'AccessDenied': - print ('{} : Is NOT a root key' .format(AWS_ACCESS_KEY_ID)) + print('{} : Is NOT a root key' .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'SubscriptionRequiredException': print('{} : Has permissions but isnt signed up for service - usually means you have a root account' .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'OptInRequired': @@ -77,20 +84,24 @@ def describe_alarm_history(): except KeyboardInterrupt: print("CTRL-C received, exiting...") -def list_metrics(): + +def cloudwatch_list_metrics(): + ''' + List CloudWatch metrics + ''' print("### Printing Cloudwatch List Metrics ###") try: for region in regions: client = boto3.client('cloudwatch', region_name=region) response = client.list_metrics() - #print response + # print(response) if response.get('Metrics') is None: - print ("{} likely does not have cloudwatch permissions\n" .format(AWS_ACCESS_KEY_ID)) + print("{} likely does not have cloudwatch permissions\n" .format(AWS_ACCESS_KEY_ID)) elif len(response['Metrics']) <= 0: - print ("[-] ListMetrics allowed for {} but no results [-]" .format(region)) + print("[-] ListMetrics allowed for {} but no results [-]" .format(region)) else: - print ("### Listing Metrics for {} ###" .format(region)) + print("### Listing Metrics for {} ###" .format(region)) for metrics in response['Metrics']: pp.pprint(metrics) print("\n") @@ -98,12 +109,12 @@ def list_metrics(): if e.response['Error']['Code'] == 'InvalidClientTokenId': sys.exit("{} : The AWS KEY IS INVALID. Exiting" .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'AccessDenied': - print ('{} : Is NOT a root key' .format(AWS_ACCESS_KEY_ID)) + print('{} : Is NOT a root key' .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'SubscriptionRequiredException': print('{} : Has permissions but isnt signed up for service - usually means you have a root account' .format(AWS_ACCESS_KEY_ID)) elif e.response['Error']['Code'] == 'OptInRequired': print('{} : Has permissions but isnt signed up for service - usually means you have a root account' .format(AWS_ACCESS_KEY_ID)) else: - print ("Unexpected error: {}" .format(e)) + print("Unexpected error: {}" .format(e)) except KeyboardInterrupt: - print ("CTRL-C received, exiting...") + print("CTRL-C received, exiting...") diff --git a/libs/config.py b/libs/config.py index 8be2966..86ed991 100644 --- a/libs/config.py +++ b/libs/config.py @@ -9,8 +9,8 @@ import sys pp = pprint.PrettyPrinter(indent=5, width=80) -#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', ] +# 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'] ''' Code to get the AWS_ACCESS_KEY_ID from boto3 @@ -21,6 +21,9 @@ AWS_ACCESS_KEY_ID = credentials.access_key def describe_configuration_recorders(region): + ''' + Describe Config recorders + ''' try: client = boto3.client("config", region_name=region) @@ -32,13 +35,13 @@ def describe_configuration_recorders(region): print("No Recordings Found\n") else: for r in response['ConfigurationRecorders']: - for k,v in r.items(): - print("%s: %s" % (k,v)) + for k, v in r.items(): + print("%s: %s" % (k, v)) print("\n") except botocore.exceptions.ClientError as e: if e.response['Error']['Code'] == 'InvalidClientTokenId': sys.exit("The AWS KEY IS INVALID. Exiting") - elif e.response['Error']['Code'] == 'UnrecognizedClientException': + elif e.response['Error']['Code'] == 'UnrecognizedClientException': sys.exit("The AWS KEY IS INVALID. Exiting") elif e.response['Error']['Code'] == 'AccessDenied': print('[-] {} : does not have config access. Did you check first?' .format(AWS_ACCESS_KEY_ID)) @@ -55,6 +58,9 @@ def describe_configuration_recorders(region): def describe_configuration_rules(region): + ''' + Describe Config rules + ''' try: client = boto3.client("config", region_name=region) @@ -66,13 +72,13 @@ def describe_configuration_rules(region): print("No Rules Found\n") else: for r in response['ConfigRules']: - for k,v in r.items(): - print("%s: %s" % (k,v)) + for k, v in r.items(): + print("%s: %s" % (k, v)) print("\n") except botocore.exceptions.ClientError as e: if e.response['Error']['Code'] == 'InvalidClientTokenId': sys.exit("The AWS KEY IS INVALID. Exiting") - elif e.response['Error']['Code'] == 'UnrecognizedClientException': + elif e.response['Error']['Code'] == 'UnrecognizedClientException': sys.exit("The AWS KEY IS INVALID. Exiting") elif e.response['Error']['Code'] == 'AccessDenied': print('[-] {} : does not have config access. Did you check first?' .format(AWS_ACCESS_KEY_ID)) @@ -87,7 +93,11 @@ def describe_configuration_rules(region): except KeyboardInterrupt: print("CTRL-C received, exiting...") + def delete_rule(rule_name, region): + ''' + Attempt to delete the specified Config Rule + ''' try: client = boto3.client("config", region_name=region) client.delete_config_rule(ConfigRuleName=rule_name) @@ -95,7 +105,7 @@ def delete_rule(rule_name, region): except botocore.exceptions.ClientError as e: if e.response['Error']['Code'] == 'InvalidClientTokenId': sys.exit("The AWS KEY IS INVALID. Exiting") - elif e.response['Error']['Code'] == 'UnrecognizedClientException': + elif e.response['Error']['Code'] == 'UnrecognizedClientException': sys.exit("The AWS KEY IS INVALID. Exiting") elif e.response['Error']['Code'] == 'AccessDenied': print('[-] {} : does not have config access. Did you check first?' .format(AWS_ACCESS_KEY_ID)) @@ -110,7 +120,11 @@ def delete_rule(rule_name, region): except KeyboardInterrupt: print("CTRL-C received, exiting...") + def delete_recorder(recorder_name, region): + ''' + Attempt to delete the specified Config recorder + ''' try: client = boto3.client("config", region_name=region) client.delete_configuration_recorder(ConfigurationRecorderName=recorder_name) @@ -118,7 +132,7 @@ def delete_recorder(recorder_name, region): except botocore.exceptions.ClientError as e: if e.response['Error']['Code'] == 'InvalidClientTokenId': sys.exit("The AWS KEY IS INVALID. Exiting") - elif e.response['Error']['Code'] == 'UnrecognizedClientException': + elif e.response['Error']['Code'] == 'UnrecognizedClientException': sys.exit("The AWS KEY IS INVALID. Exiting") elif e.response['Error']['Code'] == 'AccessDenied': print('[-] {} : does not have config access. Did you check first?' .format(AWS_ACCESS_KEY_ID)) @@ -133,18 +147,34 @@ def delete_recorder(recorder_name, region): except KeyboardInterrupt: print("CTRL-C received, exiting...") + def list_all_config_rules(): + ''' + Get config rules for each region + ''' for region in regions: describe_configuration_rules(region) + def list_all_config_recorders(): + ''' + Get recorders for each region + ''' for region in regions: describe_configuration_recorders(region) + def delete_config_rule(rule_name, region): + ''' + delete config rule (makes sure you passed a rule name) + ''' if rule_name: delete_rule(rule_name, region) + def delete_config_recorder(recorder_name, region): + ''' + delete config recorder (makes sure you passed a recorder name) + ''' if recorder_name: delete_recorder(recorder_name, region) diff --git a/libs/datapipeline.py b/libs/datapipeline.py index 96a07a7..5cf4296 100644 --- a/libs/datapipeline.py +++ b/libs/datapipeline.py @@ -25,7 +25,7 @@ credentials = session.get_credentials() AWS_ACCESS_KEY_ID = credentials.access_key -def list_pipelines(): +def datapipeline_list_pipelines(): ''' Function to use the datapipeline boto3 library to list available pipelines ''' diff --git a/libs/ec2.py b/libs/ec2.py index e4568d6..4db6b39 100644 --- a/libs/ec2.py +++ b/libs/ec2.py @@ -26,6 +26,9 @@ AWS_ACCESS_KEY_ID = credentials.access_key def review_encrypted_volumes(): + ''' + EC2 review encrypted volumes (describe volumes and check to see if encrypted or not) + ''' print("Reviewing EC2 Volumes... This may take a few....") not_encrypted = [] encrypted = [] @@ -72,12 +75,15 @@ def review_encrypted_volumes(): def describe_instances(): + ''' + EC2 Describe Instances + ''' try: for region in regions: try: client = boto3.client('ec2', region_name=region) response = client.describe_instances() - #print(response) + # print(response) except botocore.exceptions.ClientError as e: if e.response['Error']['Code'] == 'UnauthorizedOperation': print('{} : (UnauthorizedOperation) when calling the DescribeInstances -- sure you have ec2 permissions?' .format(AWS_ACCESS_KEY_ID)) @@ -113,6 +119,10 @@ def describe_instances(): def describe_instances_basic(): + ''' + Describe EC2 instances: + print("InstanceID: {}, InstanceType: {}, State: {}, Launchtime: {}".format(instanceid, instancetype, state, launchtime)) + ''' try: for region in regions: try: @@ -262,7 +272,7 @@ def ec2_list_launchable_ami(): def ec2_list_owner_ami(): ''' - For each region list your AMI's Owners=['self'] + For each region list your AMI's Owners=['self'] ''' try: for region in regions: @@ -365,6 +375,9 @@ def get_instance_volume_details2(): def describe_addresses(): + ''' + Describe EC2 addresses (loop through all regions) + ''' try: for region in regions: try: @@ -397,6 +410,9 @@ def describe_addresses(): def describe_network_interfaces(): + ''' + Describe EC2 network interfaces (loop through all regions) + ''' try: for region in regions: try: @@ -430,6 +446,9 @@ def describe_network_interfaces(): def describe_route_tables(): + ''' + Describe EC2 route tables (loop through all regions) + ''' try: for region in regions: try: @@ -463,6 +482,9 @@ def describe_route_tables(): def get_console_screenshot(instanceid, region): + ''' + Get console screenshot of the specified InstanceID in the specified region + ''' try: client = boto3.client('ec2', region_name=region) print("[INFO] Checking for required permissions to screenshot: {} on {} [INFO]" .format(instanceid, region)) @@ -488,6 +510,9 @@ def get_console_screenshot(instanceid, region): def get_console_screenshot_all(): + ''' + loop through all regions and attempt to screenshot + ''' try: for region in regions: try: @@ -543,6 +568,9 @@ def get_console_screenshot_all(): def get_console_screenshot_all_region(region): + ''' + Attempt to get screenshots of all EC2 instances in a specified region + ''' try: client = boto3.client('ec2', region_name=region) response = client.describe_instances() @@ -592,6 +620,10 @@ def get_console_screenshot_all_region(region): def get_console_screenshot_all_region_list(file, region): + ''' + Read a list of ec2 instanceIDs and attempt to screenshot them. They need to be in the same region + see write_instances_to_file to get a list of instances by region + ''' try: client = boto3.client('ec2', region_name=region) @@ -631,6 +663,9 @@ def get_console_screenshot_all_region_list(file, region): def get_console_output(instanceid, region): + ''' + Attempt to get console output for specified instanceID and region + ''' try: client = boto3.client('ec2', region_name=region) print("[INFO] Checking for required permissions to get console output: {} on {} [INFO]" .format(instanceid, region)) @@ -656,6 +691,9 @@ def get_console_output(instanceid, region): def get_console_output_all(): + ''' + loop through all regions and attempt to get console output + ''' try: for region in regions: try: @@ -714,6 +752,9 @@ def get_console_output_all(): def get_console_output_all_region(region): + ''' + loop thorugh a region and attempt to get the console output + ''' try: client = boto3.client('ec2', region_name=region) response = client.describe_instances() @@ -764,6 +805,9 @@ def get_console_output_all_region(region): def get_console_output_all_region_list(file, region): + ''' + read in a file of instanceIDs for a region and attempt ot get the console output + ''' try: client = boto3.client('ec2', region_name=region) diff --git a/libs/ecr.py b/libs/ecr.py index eb1de34..544a058 100644 --- a/libs/ecr.py +++ b/libs/ecr.py @@ -11,7 +11,7 @@ import sys pp = pprint.PrettyPrinter(indent=5, width=80) # 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-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-southeast-1', 'ap-southeast-2'] ''' Code to get the AWS_ACCESS_KEY_ID from boto3 @@ -21,7 +21,7 @@ credentials = session.get_credentials() AWS_ACCESS_KEY_ID = credentials.access_key -def describe_repositories(): +def ecr_describe_repositories(): ''' Use ecr describe_repositories function to list available repositories ''' @@ -29,11 +29,8 @@ def describe_repositories(): try: for region in regions: client = boto3.client('ecr', region_name=region) - response = client.describe_repositories() - # print (response) - if response.get('repositories') is None: print("{} likely does not have ECR permissions\n" .format(AWS_ACCESS_KEY_ID)) elif len(response['repositories']) <= 0: diff --git a/libs/elasticbeanstalk.py b/libs/elasticbeanstalk.py index 8db2b6f..7fbc4f7 100644 --- a/libs/elasticbeanstalk.py +++ b/libs/elasticbeanstalk.py @@ -11,7 +11,7 @@ import sys pp = pprint.PrettyPrinter(indent=5, width=80) # 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'] ''' Code to get the AWS_ACCESS_KEY_ID from boto3 @@ -21,15 +21,16 @@ credentials = session.get_credentials() AWS_ACCESS_KEY_ID = credentials.access_key -def describe_applications(): +def elasticbeanstalk_describe_applications(): + ''' + Elasticbeanstalk Describe Applications + ''' print("### Printing ElasticBeanstalk Applications ###") try: for region in regions: client = boto3.client('elasticbeanstalk', region_name=region) - response = client.describe_applications() - - # print response + # print(response) if response.get('Applications') is None: print("{} likely does not have ElasticBeanstalk permissions\n" .format(AWS_ACCESS_KEY_ID)) @@ -54,15 +55,16 @@ def describe_applications(): print("CTRL-C received, exiting...") -def describe_application_versions(): +def elasticbeanstalk_describe_application_versions(): + ''' + Elasticbeanstalk Describe Application versions + ''' print("### Printing ElasticBeanstalk Applications Versions ###") try: for region in regions: client = boto3.client('elasticbeanstalk', region_name=region) - response = client.describe_application_versions() - - # print response + # print(response) if response.get('ApplicationVersions') is None: print("{} likely does not have ElasticBeanstalk permissions\n" .format(AWS_ACCESS_KEY_ID)) @@ -87,16 +89,17 @@ def describe_application_versions(): print("CTRL-C received, exiting...") -def describe_configuration_options(): +def elasticbeanstalk_describe_configuration_options(): + ''' + Elasticbeanstalk Describe Configuration options + Currently not working + ''' print("### Printing ElasticBeanstalk Configuration Options ###") try: for region in regions: client = boto3.client('elasticbeanstalk', region_name=region) - response = client.describe_configuration_options() - print(response) - - # print response + # print(response) if response.get('Options') is None: print("{} likely does not have ElasticBeanstalk permissions\n" .format(AWS_ACCESS_KEY_ID)) @@ -126,14 +129,15 @@ def describe_configuration_options(): print("CTRL-C received, exiting...") -def describe_environments(): +def elasticbeanstalk_describe_environments(): + ''' + Elasticbeanstalk Describe Environments + ''' print("### Printing ElasticBeanstalk Environments ###") try: for region in regions: client = boto3.client('elasticbeanstalk', region_name=region) - response = client.describe_environments() - # print response if response.get('Environments') is None: @@ -159,14 +163,15 @@ def describe_environments(): print("CTRL-C received, exiting...") -def describe_events(): +def elasticbeanstalk_describe_events(): + ''' + Elasticbeanstalk Describe Events + ''' print("### Printing ElasticBeanstalk Environments ###") try: for region in regions: client = boto3.client('elasticbeanstalk', region_name=region) - response = client.describe_events() - # print(response) if response.get('Events') is None: diff --git a/libs/emr.py b/libs/emr.py index 3af4f9d..c77ac42 100644 --- a/libs/emr.py +++ b/libs/emr.py @@ -22,11 +22,13 @@ AWS_ACCESS_KEY_ID = credentials.access_key def list_clusters(): + ''' + List EMR Clusters + ''' print("### Printing EMR Clusters ###") try: for region in regions: client = boto3.client('emr', region_name=region) - response = client.list_clusters() if response.get('Clusters') is None: @@ -53,13 +55,14 @@ def list_clusters(): def list_security_configurations(): + ''' + List EMR Security Configurations + ''' print("### Printing EMR Security Configuration ###") try: for region in regions: client = boto3.client('emr', region_name=region) - response = client.list_security_configurations() - # print(response) if response.get('SecurityConfigurations') is None: diff --git a/libs/firehose.py b/libs/firehose.py index 09fc214..a19d905 100644 --- a/libs/firehose.py +++ b/libs/firehose.py @@ -29,7 +29,6 @@ def firehose_list_delivery_streams(): try: for region in regions: client = boto3.client('firehose', region_name=region) - response = client.list_delivery_streams() # print(response) @@ -63,7 +62,6 @@ def firehose_describe_delivery_streams(): try: for region in regions: client = boto3.client('firehose', region_name=region) - response = client.list_delivery_streams() # print(response) @@ -74,9 +72,9 @@ def firehose_describe_delivery_streams(): else: print("### {} Firehose Delivery Streams ###" .format(region)) for stream in response['DeliveryStreamNames']: - details = client.describe_delivery_stream(DeliveryStreamName=stream) - # This just prints the blob, needs to be cleaned up - print(details) + details = client.describe_delivery_stream(DeliveryStreamName=stream) + # This just prints the blob, needs to be cleaned up + print(details) print("\n") except botocore.exceptions.ClientError as e: if e.response['Error']['Code'] == 'InvalidClientTokenId': diff --git a/libs/iam.py b/libs/iam.py index 2f0b378..c8f1062 100644 --- a/libs/iam.py +++ b/libs/iam.py @@ -129,6 +129,7 @@ def get_password_policy(): except KeyboardInterrupt: print("CTRL-C received, exiting...") + def get_account_authorization_details(): ''' Get the account authoirzation details diff --git a/libs/opsworks.py b/libs/opsworks.py index dde59ba..d516f98 100644 --- a/libs/opsworks.py +++ b/libs/opsworks.py @@ -10,7 +10,7 @@ pp = pprint.PrettyPrinter(indent=5, width=80) # from http://docs.aws.amazon.com/general/latest/gr/rande.html # http://docs.aws.amazon.com/general/latest/gr/rande.html#opsworks_region -regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-south-1', 'ap-southeast-1', 'ap-southeast-1', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'sa-east-1' ] +regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-south-1', 'ap-southeast-1', 'ap-southeast-1', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'sa-east-1'] ''' Code to get the AWS_ACCESS_KEY_ID from boto3 @@ -21,6 +21,9 @@ AWS_ACCESS_KEY_ID = credentials.access_key def describe_stacks(): + ''' + Opsworks decribe stacks + ''' print('#### Listing Stacks ####') try: for region in regions: @@ -29,7 +32,6 @@ def describe_stacks(): region_name=region ) response = client.describe_stacks() - # debug # print(response) if response.get('Stacks') is None: print("{} likely does not have Opsworks permissions\n" .format(AWS_ACCESS_KEY_ID)) @@ -55,6 +57,9 @@ def describe_stacks(): def describe_user_profiles(): + ''' + Opsworks describe user profiles + ''' print('#### Listing User Profiles ####') try: for region in regions: @@ -65,11 +70,11 @@ def describe_user_profiles(): response = client.describe_user_profiles() # debug print(response) - #if response.get('Stacks') is None: + # if response.get('Stacks') is None: # print("{} likely does not have Lambda permissions\n" .format(AWS_ACCESS_KEY_ID)) - #elif len(response['Stacks']) <= 0: + # elif len(response['Stacks']) <= 0: # print("[-] DescribeStacks allowed for {} but no results (everyone seems to have this permission) [-]\n" .format(region)) - #else: # THIS PART IS UNTESTED + # else: # THIS PART IS UNTESTED # for r in response['Stacks']: # pp.pprint(r) except botocore.exceptions.EndpointConnectionError as e: @@ -86,5 +91,3 @@ def describe_user_profiles(): print("Unexpected error: {}" .format(e)) except KeyboardInterrupt: print("CTRL-C received, exiting...") - - diff --git a/libs/pricing.py b/libs/pricing.py index d31baa9..cf712e1 100644 --- a/libs/pricing.py +++ b/libs/pricing.py @@ -9,8 +9,8 @@ import sys pp = pprint.PrettyPrinter(indent=5, width=80) -#from http://docs.aws.amazon.com/general/latest/gr/rande.html -regions = ['us-east-1', 'ap-south-1' ] +# from http://docs.aws.amazon.com/general/latest/gr/rande.html +regions = ['us-east-1', 'ap-south-1'] ''' Code to get the AWS_ACCESS_KEY_ID from boto3 @@ -21,6 +21,9 @@ AWS_ACCESS_KEY_ID = credentials.access_key def pricing_describe_services(): + ''' + Using pricing service describe services + ''' try: for region in regions: client = boto3.client('pricing', region_name=region) diff --git a/libs/rds.py b/libs/rds.py index 55e10da..3a43155 100644 --- a/libs/rds.py +++ b/libs/rds.py @@ -9,7 +9,7 @@ import pprint pp = pprint.PrettyPrinter(indent=5, width=80) # 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'] ''' Code to get the AWS_ACCESS_KEY_ID from boto3 @@ -20,6 +20,9 @@ AWS_ACCESS_KEY_ID = credentials.access_key def describe_db_instances(): + ''' + RDS describe DB instances + ''' print("### Printing RDS DB instances ###") try: for region in regions: diff --git a/libs/route53.py b/libs/route53.py index 645ecb4..7aafbe3 100644 --- a/libs/route53.py +++ b/libs/route53.py @@ -11,7 +11,7 @@ import sys pp = pprint.PrettyPrinter(indent=5, width=80) # 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'] region_single = ['us-east-1'] @@ -24,15 +24,16 @@ AWS_ACCESS_KEY_ID = credentials.access_key def list_geolocations(): + ''' + Route53 list geolocations + ''' print("### Printing Route53 GeoLocations ###") try: - #cheating because they are all the same for this function call + # cheating because they are all the same for this function call for region in region_single: client = boto3.client('route53', region_name=region) - response = client.list_geo_locations() - - #print response + # print(response) if response.get('GeoLocationDetailsList') is None: print("{} likely does not have EMR permissions\n" .format(AWS_ACCESS_KEY_ID)) @@ -56,4 +57,4 @@ def list_geolocations(): else: print("Unexpected error: {}" .format(e)) except KeyboardInterrupt: - print("CTRL-C received, exiting...") + print("CTRL-C received, exiting...") diff --git a/libs/s3.py b/libs/s3.py index ae1d9dc..3333e05 100644 --- a/libs/s3.py +++ b/libs/s3.py @@ -14,6 +14,7 @@ Code to get the AWS_ACCESS_KEY_ID from boto3 session = boto3.Session() credentials = session.get_credentials() AWS_ACCESS_KEY_ID = credentials.access_key +AWS_SECRET_ACCESS_KEY = credentials.secret_key def get_s3bucket_policy(bucket): @@ -161,7 +162,7 @@ def get_s3objects_for_account_detailed(): print('#### Trying to list s3 bucketsfor {} ####\n '.format(AWS_ACCESS_KEY_ID)) for bucket in client.buckets.all(): print(bucket.name) - get_s3bucket_policy(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,bucket.name) + get_s3bucket_policy(bucket.name) except botocore.exceptions.ClientError as e: if e.response['Error']['Code'] == 'InvalidClientTokenId': diff --git a/libs/ses.py b/libs/ses.py index 1ec9c5f..752b595 100644 --- a/libs/ses.py +++ b/libs/ses.py @@ -9,7 +9,7 @@ import pprint pp = pprint.PrettyPrinter(indent=5, width=80) # from http://docs.aws.amazon.com/general/latest/gr/rande.html -regions = ['us-east-1', 'us-west-2', 'eu-west-1' ] +regions = ['us-east-1', 'us-west-2', 'eu-west-1'] ''' Code to get the AWS_ACCESS_KEY_ID from boto3 @@ -20,7 +20,10 @@ AWS_ACCESS_KEY_ID = credentials.access_key def list_identities(): - print("### Printing SES Identifies ###") + ''' + SES List identities + ''' + print("### Printing SES Identities ###") try: for region in regions: client = boto3.client( @@ -37,7 +40,6 @@ def list_identities(): else: print("### {} SES Identities ###" .format(region)) for r in response['Identities']: - #for i in r['Instances']: pp.pprint(r) print("\n") @@ -53,8 +55,12 @@ def list_identities(): except KeyboardInterrupt: print("CTRL-C received, exiting...") + def get_send_statistics(): - print("### Printing SES Identifies ###") + ''' + SES get send statistics + ''' + print("### Printing SES Send Statistics ###") try: for region in regions: client = boto3.client( @@ -71,7 +77,6 @@ def get_send_statistics(): else: print("### {} SES Send Statistics ###" .format(region)) for r in response['SendDataPoints']: - #for i in r['Instances']: pp.pprint(r) print("\n") @@ -87,8 +92,12 @@ def get_send_statistics(): except KeyboardInterrupt: print("CTRL-C received, exiting...") + def list_configuration_sets(): - print("### Printing SES Identifies ###") + ''' + SES List configuration sets + ''' + print("### Printing SES Configuration Sets ###") try: for region in regions: client = boto3.client( @@ -105,7 +114,6 @@ def list_configuration_sets(): else: print("### {} SES Configuration Sets ###" .format(region)) for r in response['ConfigurationSets']: - #for i in r['Instances']: pp.pprint(r) print("\n") @@ -120,4 +128,3 @@ def list_configuration_sets(): print("Unexpected error: {}" .format(e)) except KeyboardInterrupt: print("CTRL-C received, exiting...") - diff --git a/libs/sql.py b/libs/sql.py index fed6b23..ccc11c8 100644 --- a/libs/sql.py +++ b/libs/sql.py @@ -5,17 +5,17 @@ Custom SQL/database functions for WeirdAAL import sqlite3 from sqlite3 import Error -def create_table(db_name,table_name,sql): + +def create_table(db_name, table_name, sql): ''' SQLite3 create table function ''' with sqlite3.connect(db_name) as db: cursor = db.cursor() - cursor.execute("""SELECT name FROM sqlite_master WHERE name=?""",(table_name,)) + cursor.execute("""SELECT name FROM sqlite_master WHERE name=?""", (table_name,)) result = cursor.fetchall() keep_table = True if len(result) == 1: - #python 3 response = input("The table {} already exists, do you wish to recreate it? (y/n): ".format(table_name)) if response == "y": keep_table = False @@ -43,9 +43,9 @@ def create_recon_table(db_name, table_name): target text, checked_at timestamp, PRIMARY KEY (ID))""" - #FOREIGN KEY (AWSKeyID) references AWSKey(ID))""" - create_table(db_name,table_name,sql) - print ("created table: {}".format(table_name)) + # FOREIGN KEY (AWSKeyID) references AWSKey(ID))""" + create_table(db_name, table_name, sql) + print("created table: {}".format(table_name)) def create_awskey_table(db_name, table_name): @@ -58,8 +58,8 @@ def create_awskey_table(db_name, table_name): description text, target text, PRIMARY KEY(ID))""" - create_table(db_name,table_name,sql) - print ("created table: {}".format(table_name)) + create_table(db_name, table_name, sql) + print("created table: {}".format(table_name)) def create_services_table(db_name, table_name): @@ -75,8 +75,8 @@ def create_services_table(db_name, table_name): checked_at timestamp, target text, PRIMARY KEY(ID))""" - create_table(db_name,table_name,sql) - print ("created table: {}".format(table_name)) + create_table(db_name, table_name, sql) + print("created table: {}".format(table_name)) def insert_awskey_data(db_name, records): @@ -85,7 +85,7 @@ def insert_awskey_data(db_name, records): ''' sql = """INSERT INTO AWSKey(AWSKeyID, description, target) VALUES (?,?,?)""" for record in records: - query(db_name, sql,record) + query(db_name, sql, record) def insert_reconservice_data(db_name, records): @@ -94,7 +94,7 @@ def insert_reconservice_data(db_name, records): ''' sql = """INSERT INTO recon(service, sub_service, AWSKeyID, target, checked_at) VALUES (?,?,?,?,?)""" for record in records: - query(db_name,sql,record) + query(db_name, sql, record) def insert_sub_service_data(db_name, records): @@ -103,26 +103,26 @@ def insert_sub_service_data(db_name, records): ''' sql = """INSERT INTO services(service, sub_service, sub_service_data, AWSKeyID, target, checked_at) VALUES (?,?,?,?,?,?)""" for record in records: - query(db_name,sql,record) + query(db_name, sql, record) -def search_recon_by_key(db_name,AWSKeyID): +def search_recon_by_key(db_name, AWSKeyID): ''' Function to query services by AWSKey and order them by time ''' with sqlite3.connect(db_name) as db: cursor = db.cursor() - cursor.execute("""SELECT DISTINCT service, sub_service, checked_at FROM recon WHERE AWSKeyID=? ORDER BY datetime(checked_at)""",(AWSKeyID,)) + cursor.execute("""SELECT DISTINCT service, sub_service, checked_at FROM recon WHERE AWSKeyID=? ORDER BY datetime(checked_at)""", (AWSKeyID,)) results = cursor.fetchall() return results -def query(db_name,sql,data): +def query(db_name, sql, data): ''' Generic query function ''' with sqlite3.connect(db_name) as db: cursor = db.cursor() - #cursor.execute("""PRAGMA foreign_keys = ON""") - cursor.execute(sql,data) + # cursor.execute("""PRAGMA foreign_keys = ON""") + cursor.execute(sql, data) db.commit() diff --git a/libs/sqs.py b/libs/sqs.py index 7386bdc..d5d5d15 100644 --- a/libs/sqs.py +++ b/libs/sqs.py @@ -9,7 +9,7 @@ import pprint pp = pprint.PrettyPrinter(indent=5, width=80) # from https://docs.aws.amazon.com/general/latest/gr/rande.html#sqs_region -regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3', 'ap-south-1', 'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', 'cn-north-1', 'cn-northwest-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'sa-east-1', 'us-gov-west-1' ] +regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3', 'ap-south-1', 'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', 'cn-north-1', 'cn-northwest-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'sa-east-1', 'us-gov-west-1'] ''' Code to get the AWS_ACCESS_KEY_ID from boto3 @@ -20,6 +20,9 @@ AWS_ACCESS_KEY_ID = credentials.access_key def sqs_list_queues(): + ''' + SQS List Queues + ''' try: for region in regions: client = boto3.client("sqs", region_name=region) @@ -45,4 +48,3 @@ def sqs_list_queues(): print("Unexpected error: {}" .format(e)) except KeyboardInterrupt: print("CTRL-C received, exiting...") - diff --git a/libs/sts.py b/libs/sts.py index 11b64b1..f81b038 100644 --- a/libs/sts.py +++ b/libs/sts.py @@ -54,8 +54,8 @@ def sts_get_accountid_all(): account_userid = client.get_caller_identity()["UserId"] account_arn = client.get_caller_identity()["Arn"] print("Account Id: {}" .format(account_id)) - print("Account UserID: {}" .format(account_userid) ) - print("Account ARN: {}" .format(account_arn) ) + print("Account UserID: {}" .format(account_userid)) + print("Account ARN: {}" .format(account_arn)) except botocore.exceptions.ClientError as e: if e.response['Error']['Code'] == 'InvalidClientTokenId': sys.exit("{} : The AWS KEY IS INVALID. Exiting" .format(AWS_ACCESS_KEY_ID)) @@ -67,4 +67,4 @@ def sts_get_accountid_all(): print("Unexpected error: {}" .format(e)) except KeyboardInterrupt: print("CTRL-C received, exiting...") - return account_id \ No newline at end of file + return account_id diff --git a/libs/translate.py b/libs/translate.py index e89a73e..8115e4e 100644 --- a/libs/translate.py +++ b/libs/translate.py @@ -10,8 +10,8 @@ import sys pp = pprint.PrettyPrinter(indent=5, width=80) -#from http://docs.aws.amazon.com/general/latest/gr/rande.html -regions = ['us-east-1', 'us-east-2', 'us-west-2', 'eu-west-1' ] +# from http://docs.aws.amazon.com/general/latest/gr/rande.html +regions = ['us-east-1', 'us-east-2', 'us-west-2', 'eu-west-1'] ''' Code to get the AWS_ACCESS_KEY_ID from boto3 @@ -20,6 +20,7 @@ session = boto3.Session() credentials = session.get_credentials() AWS_ACCESS_KEY_ID = credentials.access_key + def translate_text(text, source_lang, target_lang): ''' Translate a block of text from source to target language @@ -38,7 +39,6 @@ def translate_text(text, source_lang, target_lang): else: print("### {}: Translated Text ###\n" .format(region)) print("Translated Text: {}".format(response['TranslatedText'])) - print("\n") except botocore.exceptions.ClientError as e: if e.response['Error']['Code'] == 'UnauthorizedOperation': @@ -48,4 +48,4 @@ def translate_text(text, source_lang, target_lang): else: print(e) except KeyboardInterrupt: - print("CTRL-C received, exiting...") \ No newline at end of file + print("CTRL-C received, exiting...") diff --git a/modules/aws_lambda.py b/modules/aws_lambda.py index 9be4a96..913e205 100644 --- a/modules/aws_lambda.py +++ b/modules/aws_lambda.py @@ -5,10 +5,18 @@ from libs.aws_lambda import * def module_lambda_list_functions(): + ''' + List Lambda functions + python3 weirdAAL.py -m lambda_list_functions -t demo + ''' list_functions() def module_lambda_list_event_source_mappings(): + ''' + List Lambda event source mappings + python3 weirdAAL.py -m lambda_list_event_source_mappings -t demo + ''' list_event_source_mappings() @@ -23,5 +31,6 @@ def module_lambda_get_function(*text): def module_lambda_get_account_settings(): ''' Returns a customer's account settings. + python3 weirdAAL.py -m lambda_get_account_settings -t demo ''' lambda_get_account_settings() diff --git a/modules/ce.py b/modules/ce.py index d065e49..3d0c318 100644 --- a/modules/ce.py +++ b/modules/ce.py @@ -7,5 +7,9 @@ permission to get anything from this from libs.ce import * -def module_cost_explorer_get_cost_and_usage(): - ce_get_cost_and_usage() \ No newline at end of file +def module_costexplorer_get_cost_and_usage(): + ''' + Attempt to list cost and usage via the Cost Explorer service + python3 weirdAAL.py -m costexplorer_get_cost_and_usage -t demo + ''' + ce_get_cost_and_usage() diff --git a/modules/cloudfront.py b/modules/cloudfront.py index e240a60..e4ed6c6 100644 --- a/modules/cloudfront.py +++ b/modules/cloudfront.py @@ -6,5 +6,8 @@ from libs.cloudfront import * def module_cloudfront_list_distributions(): + ''' + List CloudFront distributions + python3 weirdAAL.py -m cloudfront_list_distributions -t demo + ''' cloudfront_list_distributions() - diff --git a/modules/cloudtrail.py b/modules/cloudtrail.py index 4e74ae0..ce80466 100644 --- a/modules/cloudtrail.py +++ b/modules/cloudtrail.py @@ -5,16 +5,32 @@ from libs.cloudtrail import * def module_cloudtrail_describe_trails(): + ''' + Describe CloudTrail trails + python3 weirdAAL.py -m cloudtrail_describe_trails -t demo + ''' describe_trails() def module_cloudtrail_list_public_keys(): + ''' + List public keys associated with the CloudTrail account + python3 weirdAAL.py -m cloudtrail_list_public_keys -t demo + ''' list_public_keys() def module_cloudtrail_stop_trail(TrailARN): + ''' + Stop a specified CloudTrail ARN + python3 weirdAAL.py -m cloudtrail_stop_trail -a arn:aws:cloudtrail:us-east-1... -t demo + ''' stop_trail(TrailARN) def module_cloudtrail_delete_trail(TrailARN): - delete_trail(TrailARN) \ No newline at end of file + ''' + Delete a specified CloudTrail ARN + python3 weirdAAL.py -m cloudtrail_delete_trail -a arn:aws:cloudtrail:us-east-1... -t demo + ''' + delete_trail(TrailARN) diff --git a/modules/cloudwatch.py b/modules/cloudwatch.py index 4b71007..b3d6072 100644 --- a/modules/cloudwatch.py +++ b/modules/cloudwatch.py @@ -6,10 +6,24 @@ from libs.cloudwatch import * def module_cloudwatch_describe_alarms(): - describe_alarms() + ''' + Describe CloudWatch Alarms + python3 weirdAAL.py -m cloudwatch_describe_alarms -t demo + ''' + cloudwatch_describe_alarms() + def module_cloudwatch_describe_alarm_history(): - describe_alarm_history() + ''' + Describe CloudWatch Alarm History + python3 weirdAAL.py -m cloudwatch_describe_alarm_history -t demo + ''' + cloudwatch_describe_alarm_history() + def module_cloudwatch_list_metrics(): - list_metrics() + ''' + CloudWatch List Metrics + python3 weirdAAL.py -m cloudwatch_list_metrics -t demo + ''' + cloudwatch_list_metrics() diff --git a/modules/config.py b/modules/config.py index 892f341..babc125 100644 --- a/modules/config.py +++ b/modules/config.py @@ -4,20 +4,40 @@ Module for interacting with the config service from libs.config import * + def module_config_list_all_rules(): + ''' + Config list all rules + python3 weirdAAL.py -m config_list_all_rules -t demo + ''' list_all_config_rules() + def module_config_list_all_recorders(): + ''' + Config list all recorders + python3 weirdAAL.py -m config_list_all_recorders -t demo + ''' list_all_config_recorders() + def module_config_delete_rule(*args): + ''' + Config delete the specified rule + python3 weirdAAL.py -m config_delete_rule -a someRuleName,us-east-1 -t demo + ''' try: if args[0][0] and args[0][1]: delete_config_rule(args[0][0], args[0][1]) except IndexError: print("You must provide the rule name and region name: -a someRuleName,us-east-1") + def module_config_delete_recorder(*args): + ''' + Config delete the specified recorder + python3 weirdAAL.py -m config_delete_recorder -a someRecorderName,us-east-1 -t demo + ''' try: if args[0][0] and args[0][1]: delete_config_recorder(args[0][0], args[0][1]) diff --git a/modules/datapipeline.py b/modules/datapipeline.py index c2901ee..e2f75cd 100644 --- a/modules/datapipeline.py +++ b/modules/datapipeline.py @@ -7,6 +7,7 @@ from libs.datapipeline import * def module_datapipeline_list_pipelines(): ''' - List Pipelines + List DataPileLine pipelines + python3 weirdAAL.py -m datapipeline_list_pipelines -t demo ''' - list_pipelines() + datapipeline_list_pipelines() diff --git a/modules/db.py b/modules/db.py index a30f283..cb18a9e 100644 --- a/modules/db.py +++ b/modules/db.py @@ -13,7 +13,7 @@ credentials = session.get_credentials() AWS_ACCESS_KEY_ID = credentials.access_key -# for a key, what services does it have listed in the DB +# for a key, what services does it have listed in the DB def module_show_services_by_key(): diff --git a/modules/dynamodb.py b/modules/dynamodb.py index 6c1beb7..08ac82e 100644 --- a/modules/dynamodb.py +++ b/modules/dynamodb.py @@ -5,7 +5,16 @@ from libs.dynamodb import * def module_dynamodb_list_tables(): + ''' + DynamoDB list tables + python3 weirdAAL.py -m dynamodb_list_tables -t demo + ''' list_dynamodb_tables() + def module_dynamodb_list_tables_detailed(): + ''' + DynamoDB list tables detailed - also tries decribe_tables on each table + python3 weirdAAL.py -m dynamodb_list_tables_detailed -t demo + ''' list_dynamodb_tables_detailed() diff --git a/modules/dynamodbstreams.py b/modules/dynamodbstreams.py index a6c58be..bc6da65 100644 --- a/modules/dynamodbstreams.py +++ b/modules/dynamodbstreams.py @@ -5,4 +5,8 @@ from libs.dynamodbstreams import * def module_dynamodbstreams_list_streams(): - list_dynamodbstreams() \ No newline at end of file + ''' + List dynamodbstream streams + python3 weirdAAL.py -m dynamodbstreams_list_streams -t demo + ''' + list_dynamodbstreams() diff --git a/modules/ec2.py b/modules/ec2.py index ed0aa7c..f0f6fe1 100644 --- a/modules/ec2.py +++ b/modules/ec2.py @@ -11,6 +11,7 @@ def module_ec2_describe_instances_basic(): 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 + python3 weirdAAL.py -m ec2_describe_instances_basic -t demo ''' describe_instances_basic() @@ -18,6 +19,7 @@ def module_ec2_describe_instances_basic(): def module_ec2_describe_instances(): ''' All info about each EC2 instance + python3 weirdAAL.py -m ec2_describe_instances -t demo ''' describe_instances() @@ -25,6 +27,7 @@ def module_ec2_describe_instances(): def module_ec2_write_instances_to_file(): ''' For each region write the instanceIDs to a file by region ex (AWSKEYID-region.txt) + python3 weirdAAL.py -m ec2_write_instances_to_file -t demo ''' write_instances_to_file() @@ -32,6 +35,7 @@ def module_ec2_write_instances_to_file(): def module_ec2_get_instance_volume_details(): ''' Show volumes sorted by instanceId ex: instanceID-->multiple volumes less detail than get_instance_volume_details2 + python3 weirdAAL.py -m ec2_get_instance_volume_details -t demo ''' get_instance_volume_details() @@ -39,6 +43,7 @@ def module_ec2_get_instance_volume_details(): def module_ec2_get_instance_volume_details2(): ''' Show volumes by instanceId but instanceID->volume1 of ID, instanceID->volume2 of ID but more details. + python3 weirdAAL.py -m ec2_get_instance_volume_details2 -t demo ''' get_instance_volume_details2() @@ -46,6 +51,7 @@ def module_ec2_get_instance_volume_details2(): def module_ec2_review_encrypted_volumes(): ''' This function is used to list EBS volumes and whether or not they are encrypted. This is only for "in-use" (running) volumes. + python3 weirdAAL.py -m ec2_review_encrypted_volumes -t demo ''' review_encrypted_volumes() @@ -53,6 +59,7 @@ def module_ec2_review_encrypted_volumes(): def module_ec2_describe_addresses(): ''' This function is used to describe ec2 network addresses. + python3 weirdAAL.py -m ec2_describe_addresses -t demo ''' describe_addresses() @@ -60,6 +67,7 @@ def module_ec2_describe_addresses(): def module_ec2_describe_network_interfaces(): ''' This function is used to describe ec2 network interfaces. + python3 weirdAAL.py -m ec2_describe_network_interfaces -t demo ''' describe_network_interfaces() @@ -67,6 +75,7 @@ def module_ec2_describe_network_interfaces(): def module_ec2_describe_route_tables(): ''' This function describes route tables for each ec2 instance + python3 weirdAAL.py -m ec2_describe_route_tables -t demo ''' describe_route_tables() @@ -99,6 +108,7 @@ def module_ec2_get_console_output(*text): def module_ec2_get_console_screenshot_all(): ''' This function will attempt to screenshot all EC2 instances (loops through all regions) + python3 weirdAAL.py -m ec2_get_console_screenshot_all -t demo ''' get_console_screenshot_all() @@ -106,6 +116,7 @@ def module_ec2_get_console_screenshot_all(): def module_ec2_get_console_output_all(): ''' This function will attempt to get the console output all EC2 instances (loops through all regions) + python3 weirdAAL.py -m ec2_get_console_output_all -t demo ''' get_console_output_all() @@ -153,6 +164,8 @@ def module_ec2_list_launchable_ami(): per documentation this doenst list AMIs you own. "The following command lists the AMIs for which you have explicit launch permissions. This list does not include any AMIs that you own." run ec2_list_owner_ami also to get a list of YOUR account's AMIs + + python3 weirdAAL.py -m ec2_list_launchable_ami -t demo ''' ec2_list_launchable_ami() @@ -160,5 +173,6 @@ def module_ec2_list_launchable_ami(): def module_ec2_list_owner_ami(): ''' This function will attempt to get all AMIs for the key owner (loops through all regions) + python3 weirdAAL.py -m ec2_list_owner_ami -t demo ''' - ec2_list_owner_ami() \ No newline at end of file + ec2_list_owner_ami() diff --git a/modules/ecr.py b/modules/ecr.py index 006f041..3e977ab 100644 --- a/modules/ecr.py +++ b/modules/ecr.py @@ -1,7 +1,13 @@ ''' ECR functions ''' -from libs.ecr import * + +from libs.ecr import * + def module_ecr_describe_repos(): - describe_repositories() + ''' + Describe ECR repositories + python3 weirdAAL.py -m ecr_describe_repos -t demo + ''' + ecr_describe_repositories() diff --git a/modules/elasticbeanstalk.py b/modules/elasticbeanstalk.py index fac5f21..a16777c 100644 --- a/modules/elasticbeanstalk.py +++ b/modules/elasticbeanstalk.py @@ -6,27 +6,54 @@ from libs.elasticbeanstalk import * ''' There is a weird issue that AWS says everyone has elasticbeanstalk permissions -despite not running any of these services - in other words it wont be abnormal -for recon to say it has elasticbeantalk permissions but nothing get returned +despite not running any of these services - in other words it won't be abnormal +for recon to say it has elasticbeantalk permissions but nothing gets returned when you run these functions ''' def module_elasticbeanstalk_describe_applications(): - describe_applications() + ''' + Elasticbeanstalk Describe Applications + python3 weirdAAL.py -m elasticbeanstalk_describe_applications -t demo + ''' + elasticbeanstalk_describe_applications() def module_elasticbeanstalk_describe_applications_versions(): - describe_application_versions() + ''' + Elasticbeanstalk Describe Application versions + python3 weirdAAL.py -m elasticbeanstalk_describe_applications_versions -t demo + ''' + elasticbeanstalk_describe_application_versions() # not working # def module_elasticbeanstalk_describe_configuration_options(): -# describe_configuration_options() +# elasticbeanstalk_describe_configuration_options() def module_elasticbeanstalk_describe_environments(): - describe_environments() + ''' + Elasticbeanstalk Describe Environments + python3 weirdAAL.py -m elasticbeanstalk_describe_environments -t demo + ''' + elasticbeanstalk_describe_environments() def module_elasticbeanstalk_describe_events(): - describe_events() + ''' + Elasticbeanstalk describe events + python3 weirdAAL.py -m elasticbeanstalk_describe_events -t demo + ''' + elasticbeanstalk_describe_events() + + +def module_elasticbeanstalk_check_defaults(): + ''' + Test for all 4 of the deault elasticbeanstalk permissions + python3 weirdAAL.py -m elasticbeanstalk_check_defaults -t demo + ''' + elasticbeanstalk_describe_applications() + elasticbeanstalk_describe_application_versions() + elasticbeanstalk_describe_environments() + elasticbeanstalk_describe_events() diff --git a/modules/emr.py b/modules/emr.py index d6fc0a7..a1b4e64 100644 --- a/modules/emr.py +++ b/modules/emr.py @@ -1,12 +1,21 @@ ''' This file is used to perform some EMR actions ''' + from libs.emr import * def module_emr_list_clusters(): + ''' + EMR List Clusters + python3 weirdAAL.py -m emr_list_clusters -t demo + ''' list_clusters() def module_emr_list_security_configurations(): + ''' + EMR List Security Configuration + python3 weirdAAL.py -m emr_list_security_configurations -t demo + ''' list_security_configurations() diff --git a/modules/firehose.py b/modules/firehose.py index 166dcdd..75aed36 100644 --- a/modules/firehose.py +++ b/modules/firehose.py @@ -1,12 +1,20 @@ ''' Firehose functions ''' -from libs.firehose import * +from libs.firehose import * def module_firehose_list_delivery_streams(): - firehose_list_delivery_streams() + ''' + Firehose list delivery streams + python3 weirdAAL.py -m firehose_list_delivery_streams -t demo + ''' + firehose_list_delivery_streams() def module_firehose_describe_delivery_streams(): - firehose_describe_delivery_streams() \ No newline at end of file + ''' + Firehose describe delivery streams + python3 weirdAAL.py -m firehose_describe_delivery_streams -t demo + ''' + firehose_describe_delivery_streams() diff --git a/modules/iam.py b/modules/iam.py index d1500ab..b191b20 100644 --- a/modules/iam.py +++ b/modules/iam.py @@ -8,6 +8,7 @@ from libs.iam import * def module_iam_list_groups(): ''' Lists the IAM groups. + python3 weirdAAL.py -m iam_list_groups -t yolo ''' iam_list_groups() @@ -15,6 +16,7 @@ def module_iam_list_groups(): def module_iam_get_user(): ''' Retrieves information about the specified IAM user, including the user's creation date, path, unique ID, and ARN. + python3 weirdAAL.py -m iam_get_user -t yolo ''' iam_get_user() @@ -22,6 +24,7 @@ def module_iam_get_user(): def module_iam_get_account_summary(): ''' Retrieves information about IAM entity usage and IAM quotas in the AWS account + python3 weirdAAL.py -m iam_get_account_summary -t yolo ''' iam_get_account_summary() @@ -29,6 +32,7 @@ def module_iam_get_account_summary(): def module_iam_list_users(): ''' Lists the IAM users that have the specified path prefix. If no path prefix is specified, the operation returns all users in the AWS account. If there are none, the operation returns an empty list. + python3 weirdAAL.py -m iam_list_users -t yolo ''' iam_list_users() @@ -36,6 +40,7 @@ def module_iam_list_users(): def module_iam_check_root_account(): ''' Attempts to call a few IAM functions to see if the account has root or IAM [elevated] permissions + python3 weirdAAL.py -m iam_check_root_account -t yolo ''' check_root_account() @@ -43,6 +48,7 @@ def module_iam_check_root_account(): def module_iam_get_password_policy(): ''' Retrieves the password policy for the AWS account. + python3 weirdAAL.py -m iam_get_password_policy -t yolo ''' get_password_policy() @@ -50,6 +56,7 @@ def module_iam_get_password_policy(): def module_iam_list_roles(): ''' Lists the IAM roles that have the specified path prefix. If there are none, the operation returns an empty list. + python3 weirdAAL.py -m iam_list_roles -t yolo ''' iam_list_roles() @@ -57,6 +64,7 @@ def module_iam_list_roles(): def module_iam_list_policies(): ''' Lists all the managed policies that are available in your AWS account, including your own customer-defined managed policies and all AWS managed policies. + python3 weirdAAL.py -m iam_list_policies -t yolo ''' iam_list_policies() @@ -65,6 +73,7 @@ def module_iam_list_policies_attached(): ''' Lists all the managed policies that are available in your AWS account, including your own customer-defined managed policies and all AWS managed policies. adds the OnlyAttached=True flag (you probably want to run this one to see what's actually applied to the account) + python3 weirdAAL.py -m iam_list_policies_attached -t yolo ''' iam_list_policies_attached() @@ -95,5 +104,6 @@ def module_iam_list_entities_for_policy(*text): def module_iam_get_account_authorization_details(): ''' Retrieves information about all IAM users, groups, roles, and policies in your AWS account, including their relationships to one another. Use this API to obtain a snapshot of the configuration of IAM permissions (users, groups, roles, and policies) in your account. + python3 weirdAAL.py -m iam_get_account_authorization_details -t yolo ''' get_account_authorization_details() diff --git a/modules/iam_pwn.py b/modules/iam_pwn.py index 4feee69..a7ebdfd 100644 --- a/modules/iam_pwn.py +++ b/modules/iam_pwn.py @@ -1,5 +1,5 @@ ''' -Functions specifically related to IAM account takeover if you have root or IAM access gather user info, +Functions specifically related to IAM account takeover if you have root or IAM access gather user info, manipulate access keys or passwords, make backdoor account ''' from libs.iam import * @@ -9,6 +9,7 @@ from libs.sts import * def module_iam_get_account_summary(): ''' Get account summmary for current user get_account_summary() + python3 weirdAAL.py -m iam_get_account_summary -t yolo ''' iam_get_account_summary() @@ -16,6 +17,7 @@ def module_iam_get_account_summary(): def module_iam_check_root_account(): ''' runs get_account_summary, list_users, for each user list_login_profiles() & list_mfa_devices() + python3 weirdAAL.py -m iam_check_root_account -t yolo ''' check_root_account() @@ -23,6 +25,7 @@ def module_iam_check_root_account(): def module_iam_get_password_policy(): ''' runs IAM get_account_password_policy for the current user + python3 weirdAAL.py -m iam_get_password_policy -t yolo ''' get_password_policy() @@ -70,6 +73,7 @@ def module_iam_delete_access_key(*text): def module_iam_create_user(*text): ''' create a IAM user with the specified username + python3 weirdAAL.py -m iam_delete_access_key -a 'urpwned' -t yolo ''' iam_create_user(text[0][0]) @@ -77,6 +81,7 @@ def module_iam_create_user(*text): def module_iam_make_admin(*text): ''' attach the admin policy ['arn:aws:iam::aws:policy/AdministratorAccess'] to the specified user + python3 weirdAAL.py -m iam_delete_access_key -a 'urpwned' -t yolo ''' iam_make_admin(text[0][0]) diff --git a/modules/opsworks.py b/modules/opsworks.py index 5541de6..db1a2ca 100644 --- a/modules/opsworks.py +++ b/modules/opsworks.py @@ -2,8 +2,16 @@ from libs.opsworks import * def module_opsworks_describe_stacks(): + ''' + Opsworks Describe stacks + python3 weirdAAL.py -m opsworks_describe_stacks -t yolo + ''' describe_stacks() def module_opsworks_describe_user_profiles(): - describe_user_profiles() \ No newline at end of file + ''' + Opsworks describe user profiles + python3 weirdAAL.py -m opsworks_describe_user_profiles -t yolo + ''' + describe_user_profiles() diff --git a/modules/pricing.py b/modules/pricing.py index ad9e7af..776267e 100644 --- a/modules/pricing.py +++ b/modules/pricing.py @@ -8,4 +8,8 @@ from libs.pricing import * def module_pricing_describe_services(): + ''' + Pricing describe services + python3 weirdAAL.py -m pricing_describe_services -t yolo + ''' pricing_describe_services() diff --git a/modules/rds.py b/modules/rds.py index fe6ba02..1f42a38 100644 --- a/modules/rds.py +++ b/modules/rds.py @@ -2,8 +2,12 @@ RDS module ''' - from libs.rds import * + def module_rds_describe_db_instances(): - describe_db_instances() + ''' + RDS Describe Instances + python3 weirdAAL.py -m rds_describe_db_instances -t yolo + ''' + describe_db_instances() diff --git a/modules/recon.py b/modules/recon.py index c9553a6..0bc9e77 100644 --- a/modules/recon.py +++ b/modules/recon.py @@ -8,7 +8,12 @@ from libs.s3 import * # maps to available services in boto 1.7.4 + def module_recon_all(): + ''' + Main recon all module - attempt to connect ot each of the services to see if we have some privs + python3 weirdAAL.py -m recon_all -t demo + ''' get_accountid() check_root_account() brute_acm_permissions() @@ -148,5 +153,4 @@ def module_recon_all(): # XRay no functions # S3 bucket's while we are here... -#commented out until s3 id/key shit is fixed in all modules/libs get_s3objects_for_account() diff --git a/modules/route53.py b/modules/route53.py index e516897..1cf62a7 100644 --- a/modules/route53.py +++ b/modules/route53.py @@ -1,8 +1,14 @@ ''' route53 functions ''' -from libs.route53 import * + +from libs.route53 import * def module_route53_list_geolocations(): - list_geolocations() \ No newline at end of file + ''' + Route53 list geolocations + + python3 weirdAAL.py -m route53_list_geolocations -t demo + ''' + list_geolocations() diff --git a/modules/ses.py b/modules/ses.py index 385f2ce..e213799 100644 --- a/modules/ses.py +++ b/modules/ses.py @@ -2,14 +2,31 @@ SES module ''' - from libs.ses import * + def module_ses_list_identities(): - list_identities() + ''' + SES List identities + + python3 weirdAAL.py -m ses_list_identities -t demo + ''' + list_identities() + def module_ses_get_send_statistics(): - get_send_statistics() + ''' + SES get send statistics + + python3 weirdAAL.py -m ses_get_send_statistics -t demo + ''' + get_send_statistics() + def module_ses_list_configuration_sets(): - list_configuration_sets() \ No newline at end of file + ''' + SES list configuration sets + + python3 weirdAAL.py -m ses_list_configuration_sets -t demo + ''' + list_configuration_sets() diff --git a/modules/sqs.py b/modules/sqs.py index 79e02d6..a9d9f61 100644 --- a/modules/sqs.py +++ b/modules/sqs.py @@ -1,8 +1,14 @@ ''' -SQS +SQS Modules ''' + from libs.sqs import * def module_sqs_list_queues(): - sqs_list_queues() + ''' + SQS List Queues + + python3 weirdAAL.py -m sqs_list_queues -t demo + ''' + sqs_list_queues() diff --git a/modules/sts.py b/modules/sts.py index 34fb6c0..c476fc5 100644 --- a/modules/sts.py +++ b/modules/sts.py @@ -6,8 +6,18 @@ from libs.sts import * def module_sts_get_accountid(): + ''' + STS get account ID - just ID + + python3 weirdAAL.py -m sts_get_accountid -t demo + ''' sts_get_accountid() def module_sts_get_accountid_all(): - sts_get_accountid_all() \ No newline at end of file + ''' + STS get as much info as possible - prints AccountID, UserID, ARN + + python3 weirdAAL.py -m sts_get_accountid_all -t demo + ''' + sts_get_accountid_all() diff --git a/modules/translate.py b/modules/translate.py index c5b27da..252cb92 100644 --- a/modules/translate.py +++ b/modules/translate.py @@ -2,11 +2,13 @@ Translate module ''' - from libs.translate import * + def module_translate_translate_text(*text): - ''' - translate text ==> text, source_language, target_language - ''' - translate_text(text[0][0], text[0][1], text[0][2]) + ''' + translate text ==> text, source_language, target_language + + python3 weirdAAL.py -m translate_translate_text -a 'secure your shit','en','fr' -t demo + ''' + translate_text(text[0][0], text[0][1], text[0][2])