Package: quiet-riot
Quiet Riot:notes:C'mon, Feel The Noise:notes:An enumeration tool for scalable, unauthenticated validation of AWS principals; including AWS Acccount IDs, root e-mail addresses, users, and roles.Credit:Daniel Grzelak@dagrzfor identifying the technique and Will Bengston@__musclesfor inspiring me to scale it.See the introductory blog posthere.See a defender's perspective blog posthere.Getting Started With Quiet RiotPrerequisitesboto3/botocoreSufficient AWS credentials configured via CLIInstallation:First step is to have sufficient AWS credentials configured via CLI. If you do not have your own AWS acccount or sufficient credentials in an AWS account, Quiet Riot will not work.Create the virtual environment, or you can directly install the quiet_riot pkg using pip.For installing this package you can run the command pip install quiet-riot. After installing the package you can run the command quiet_riot --helpUsage:Arguments for quiet_riot are --scan_type, --threads, --wordlist, --profileYou can provide values for arguments required to run this package. Must require argument is scan_type.for e.g quiet_riot --scan_type 3 --threads 30 --wordlist D:\path_to_wordlist_file --profile DefaultOr you can use the short form for arguments as well like --s, --t, --w, --p--scan_type, --sWhat type of scan do you want to attempt? Enter the type of scan for example1. AWS Account IDs
         2. Microsoft 365 Domains
         3. AWS Services Footprinting
         4. AWS Root User E-mail Address
         5. AWS IAM Principals
            4.1. IAM Roles
            4.2. IAM Users
         6. Microsoft 365 Users (e-mails)
         7. Google Workspace Users (e-mails)--threads, --tFor number of threads you have to provide the number for e.g 23 , 30 90 etc. Approximately how many threads do you think you want to run?Hint: 2020 M1 Macbook Air w/ 16 GB RAM optimizes @ around 700 threads from limited testing.--wordlist, --wPath to the world list file which will be required for scan.--profile, --pProvide the name of aws profile configured through cli for e.g Default,DevFeatureploitation LimitsThrottlingAfter performing extensive analysis of scaling methods using the AWS Python (Boto3) SDK, I was able to determine that the bottleneck for scanning (at least for Python and awscli -based tools) is I/O capacity of a single-threaded Python application. After modifying the program to run with multiple threads, I was able to trigger exceptions in individual threads due to throttling by the various AWS APIs. You can see the results from running a few benchmarking test scanshere. APIs that I tested had wildly different throttling limits and notably, s3 bucket policy attempts took ~10x as long as similar attempts against other services.With further testing, I settled on a combination of SNS, ECR-Public, and ECR-Private services running in US-East-1 in ~40%/50%/10% configuration split with ~700 threads. The machine I used was a 2020 Macbook Air (M1 and 16 GB RAM). This configuration yielded on average ~1100 calls/sec, though the actual number of calls can fluctuate significantly depending on a variety of factors including network connectivity. Under these configurations, I did occasionally throw an exception on a thread from throttling...but I have subsequently configured additional re-try attempts (4 -> 7) via botocore that will eliminate this issue with a minor performance trade-off.Computational DifficultyTo attempt every possible Account ID in AWS (1,000,000,000,000) would require an infeasible amount of time given only one account. Even assuming absolute efficiency*, over the course of a day an attacker will only be able to make 95,040,000 validation checks. Over 30 days, this is 2,851,200,000 validation checks and we are still over 28 years away from enumerating every valid AWS Account ID. Fortunately, there is nothing stopping us from registering many AWS accounts and automating this scan. While there is an initial limit of 20 accounts per AWS organization, I was able to get this limit increased for my Organization via console self-service and approval from an AWS representative. The approval occured without any further questions and now I'm off to automating this writ large. Again, assuming absolute efficiency, the 28 years scanning could potentially be reduced down to ~100 days.*~1100 API calls/check per second in perpetuity per account and never repeating a guessed Account ID.Potential Supported Services#AWS ServiceDescriptionAPI LimitsResource PricingEnumeration Capability1SNSManaged Serverless Notification ServiceUnknownUnknownYes2KMSEncryption Key Management ServiceUnknownUnknownYes3SecretsManagerManaged Secret StoreUnknownUnknownYes4CodeArtifactManaged Source Code RepositoryUnknownUnknownYes5ECR PublicManaged Container RegistryUnknownUnknownYes6ECR PrivateManaged Container RegistryUnknownUnknownYes7LambdaManaged Serverless FunctionUnknownUnknownYes8s3Managed Serverless Object StoreUnknownUnknownYes9SESSMTP Automation ServiceUnknownUnknownUnknown10ACMPrivate Certificate AuthorityUnknownUnknownUnknown11CodeBuildSoftware Build AgentUnknownUnknownUnknown12AWS BackupManaged Backup ServiceUnknownUnknownUnknown13Cloud9Managed IDEUnknownUnknownUnknown14GlueManaged ETL Job ServiceUnknownUnknownUnknown15EKSManaged K8s ServiceUnknownUnknownUnknown16Lex V2Managed NLP ServiceUnknownUnknownUnknown17CloudWatch LogsManaged Log Pipeline/MonitoringUnknownUnknownUnknown18VPC EndpointsManaged Virtual NetworkUnknownUnknownUnknown19Elemental MediaStoreUnknownUnknownUnknownUnknown20OpenSearchManaged ElasticSearchUnknownUnknownUnknown21EventBridgeManaged Serverless Event HubUnknownUnknownUnknown22EventBridge SchemasManaged Serverless Event HubUnknownUnknownUnknown23IoTInternet-of-Things ManagementUnknownUnknownUnknown24s3 GlacierCold Object StorageUnknownUnknownUnknown25ECSManaged Container OrchestrationUnknownUnknownUnknown26Serverless Application RepositoryManaged Source Code RepositoryUnknownUnknownNo27SQSManaged Serverless Queueing ServiceUnknownUnknownNo28EFSManaged Serverless Elastic File SystemUnknownUnknownNo