< All Hands-On Labs

Free Hands-On Lab Capture the Flag

Discover AWS Organization ID via S3 Bucket

Discover AWS Organization IDs by exploiting limited S3 bucket access. Using an automated approach, this lab demonstrates how to efficiently identify org IDs in just 360 attempts instead of brute-forcing 3.66 quadrillion combinations.

Free hands-on lab

Launch this lab with a free account

Build practical, real-world skills in a cloud environment.

Create Free Account Already a member? Log in

  • Real cloud environments, not simulations
  • One click to deploy, nothing to install
  • We cover the cloud costs and risks so you can focus on learning

7 comments

Comments are currently read-only while we migrate to our new platform. In the meantime, ask questions in Discord.

  1. Gabriel Pessoa

    I really liked it. I didn’t know about this tool.

    1. Christophe

      Instructor

      Really helpful tool that I just discovered as well! More labs coming on it.

  2. umeruzair

    Just tried it and it didn’t work for me, have been declined access,

    Failed to assume role: An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:iam::350973243370:user/Daniel is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::762620608760:role/S3AccessImages
    Traceback (most recent call last):
    File “/mnt/c/Users/xxxxxxx/conditional-love/./conditional-love.py”, line 217, in
    main(args)
    File “/mnt/c/Users/xxxxx/conditional-love/./conditional-love.py”, line 31, in main
    if not can_access_target_with_policy(base_session, args.role, args.target, args.action, None, args.region):
    File “/mnt/c/Users/xxxxx/conditional-love/./conditional-love.py”, line 94, in can_access_target_with_policy
    client = assumed_role_session.client(service_name)
    AttributeError: ‘NoneType’ object has no attribute ‘client’

    1. Christophe

      Instructor

      Hey, did you launch the lab a couple of different times? Asking because you’re attempting to use a user from account ID 350x while attempting to assume a role from account ID 762x, so I’m assuming you simply forgot to retrieve the new user or role ARN when issuing your commands the second time around. Both the user and role account numbers should match since they are both in the same account and values can’t be re-used between lab launches

    2. Toom

      Hey, I faced similar issue. I presume that you copied the command from the instructions with wrong account ID (762620608760) – actually this needs to be replaced with your current account ID – in your case it was 350x. To get the account ID according to the instructions you want to run `aws iam list-roles –query “Roles[?RoleName==’S3AccessImages’]”` command and “Grab the ARN value and store it in your notes because we’ll need it in just a minute” (ofc there are other ways too). This ARN you’ll use when running the script.

      1. Christophe

        Instructor

        Thanks Toom! I made the sentence bold in the walkthrough guide so that it’s more visible

  3. shaistha74

    Enjoyed the lab!