pep8 and documentation

This commit is contained in:
carnal0wnage
2018-05-02 22:44:58 -04:00
parent 194bf3389a
commit 1c633fe216
48 changed files with 505 additions and 186 deletions

View File

@@ -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()

View File

@@ -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()
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()

View File

@@ -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()

View File

@@ -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)
'''
Delete a specified CloudTrail ARN
python3 weirdAAL.py -m cloudtrail_delete_trail -a arn:aws:cloudtrail:us-east-1... -t demo
'''
delete_trail(TrailARN)

View File

@@ -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()

View File

@@ -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])

View File

@@ -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()

View File

@@ -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():

View File

@@ -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()

View File

@@ -5,4 +5,8 @@ from libs.dynamodbstreams import *
def module_dynamodbstreams_list_streams():
list_dynamodbstreams()
'''
List dynamodbstream streams
python3 weirdAAL.py -m dynamodbstreams_list_streams -t demo
'''
list_dynamodbstreams()

View File

@@ -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()
ec2_list_owner_ami()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()
'''
Firehose describe delivery streams
python3 weirdAAL.py -m firehose_describe_delivery_streams -t demo
'''
firehose_describe_delivery_streams()

View File

@@ -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()

View File

@@ -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])

View File

@@ -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()
'''
Opsworks describe user profiles
python3 weirdAAL.py -m opsworks_describe_user_profiles -t yolo
'''
describe_user_profiles()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -1,8 +1,14 @@
'''
route53 functions
'''
from libs.route53 import *
from libs.route53 import *
def module_route53_list_geolocations():
list_geolocations()
'''
Route53 list geolocations
python3 weirdAAL.py -m route53_list_geolocations -t demo
'''
list_geolocations()

View File

@@ -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()
'''
SES list configuration sets
python3 weirdAAL.py -m ses_list_configuration_sets -t demo
'''
list_configuration_sets()

View File

@@ -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()

View File

@@ -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()
'''
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()

View File

@@ -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])