The following code will attempt to enumerate operations that a given set of AWS AccessKeys can perform.
Usage: enumerate-iam.py [OPTIONS]
  IAM Account Enumerator.
| #!/usr/bin/env bash | |
| unset AWS_ACCESS_KEY_ID | |
| unset AWS_SECRET_ACCESS_KEY | |
| unset AWS_SECURITY_TOKEN | |
| unset AWS_SESSION_TOKEN | |
| while getopts "e:u:p:s:t:f:" arg ; do | |
| case $arg in | |
| p) | 
| #!/bin/sh | |
| sudo apt-get update \ | |
| && sudo apt-get install -qy docker.io | |
| sudo apt-get update \ | |
| && sudo apt-get install -y apt-transport-https \ | |
| && curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | |
| #!/bin/bash | |
| # | |
| # crt.sh sub-domain check by 1N3@CrowdShield | |
| # https://crowdshield.com | |
| # | |
| OKBLUE='\033[94m' | |
| OKRED='\033[91m' | |
| OKGREEN='\033[92m' | |
| OKORANGE='\033[93m' | 
| #!/bin/bash | |
| # gets iam security credentials from instance metadata and writes them to | |
| # awscli environment variables and .s3cfg (for s3cmd) | |
| # Usage: ec2-get-security-credentials ROLENAME DEFAULT_REGION | |
| # ROLE=$1 | |
| # DEFAULT_REGION=$2 | |
| #!/bin/bash | |
| # Retrieve AWS instrance's commonly used metadata. Require curl. | |
| # ./get-metadata help | |
| # ./get-metadata id | |
| # Input is case insensitive; format to uppper case to generate self-help page. | |
| info=${1^^} | |
| meta_data_url=http://169.254.169.254/latest/meta-data/ | |
| roleProfile=$(curl -s http://169.254.169.254/latest/meta-data/iam/info \ | |
| | grep -Eo 'instance-profile/([a-zA-Z.-]+)' | sed 's#instance-profile/##') | 
| #!/bin/sh | |
| aws iam generate-credential-report | |
| aws iam get-credential-report --output text --query Content | base64 -D |