Skip to content

arte-seslo82: Document AWS CLI User-Agent condition bypass - #367

Open
seslo82 wants to merge 1 commit into
HackTricks-wiki:masterfrom
seslo82:arte-seslo82-aws-cli-user-agent-bypass
Open

arte-seslo82: Document AWS CLI User-Agent condition bypass#367
seslo82 wants to merge 1 commit into
HackTricks-wiki:masterfrom
seslo82:arte-seslo82-aws-cli-user-agent-bypass

Conversation

@seslo82

@seslo82 seslo82 commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Documents a way to bypass AWS IAM conditions that rely on aws:UserAgent by modifying the final outgoing User-Agent directly 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-send hook to modify the fully prepared HTTP request immediately before transmission.

Why this is useful

This demonstrates why aws:UserAgent should 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 at before-send time.

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 at before-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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant