arte-seslo82: Document AWS CLI User-Agent condition bypass - #367
Open
seslo82 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents a way to bypass AWS IAM conditions that rely on
aws:UserAgentby modifying the final outgoingUser-Agentdirectly from the AWS CLI.HackTricks already documents changing the User-Agent from Boto3. This contribution extends the technique to the actual AWS CLI by using an AWS CLI v2 legacy plugin and Botocore
before-sendhook to modify the fully prepared HTTP request immediately before transmission.Why this is useful
This demonstrates why
aws:UserAgentshould not be treated as a strong authorization boundary because the value is client-controlled. It also documents the operational difference between modifying the header during earlier request-building stages and modifying it atbefore-sendtime.Validation
Validated with AWS CLI v2 by comparing a normal AWS CLI request using the default
aws-cli/...User-Agent, which was denied by a User-Agent-based IAM condition, with the same AWS CLI operation using a plugin that rewrote the final outgoing User-Agent atbefore-send, which succeeded when no other authorization control blocked the request.The documentation contains generic examples only and does not include lab credentials, account IDs, flags, or disposable training data.
This contribution is for the ARTE certification extra-points requirement.