AWS - STS Post Exploitation
Last updated
Last updated
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
For more information:
AWS - IAM, Identity Center & SSO EnumIf you have managed to obtain some IAM credentials you might be interested on accessing the web console using the following tools.
Note that the the user/role must have the permission sts:GetFederationToken
.
The following script will use the default profile and a default AWS location (not gov and not cn) to give you a signed URL you can use to login inside the web console:
You can generate a web console link with https://github.com/NetSPI/aws_consoler.
Ensure the IAM user has sts:GetFederationToken
permission, or provide a role to assume.
aws-vault is a tool to securely store and access AWS credentials in a development environment.
You can also use aws-vault to obtain an browser console session
If there is a restriction to perform certain actions based on the user agent used (like restricting the use of python boto3 library based on the user agent) it's possible to use the previous technique to connect to the web console via a browser, or you could directly modify the boto3 user-agent by doing:
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)