Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s3__enum_bucket_owner: Enum bucket owner + Fix code style and linting… #467

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qlkwej
Copy link

@qlkwej qlkwej commented Feb 22, 2025

s3__enum_bucket_owner: Enum bucket owner + Fix code style and linting issues

[Purpose]: Clean up code to comply with flake8 linting standards [Changes]:

  • Fixed argument parser indentation for better readability
  • Removed unused imports (copy, uuid)
  • Fixed line endings and removed trailing whitespace
  • Added proper docstrings for all functions
  • Ensured consistent blank lines between functions

[Testing]: Module functionality remains unchanged, all flake8 checks pass

Scenario 1: No role ARN provided, and No permission to create temp role

Pacu (pwnlabs:from_default-xxxx) > run s3__enum_account --buckets mega-big-tech
  Running module s3__enum_account...

[s3__enum_bucket_owner] No role ARN provided. Checking if we can create a temporary role...
[s3__enum_bucket_owner] ERROR: No role ARN provided and no permissions to create a temporary role.
[s3__enum_bucket_owner] You must either:
[s3__enum_bucket_owner] 1. Provide an existing role ARN with --role-arn
[s3__enum_bucket_owner] 2. Or have IAM permissions to create a temporary rol

Scenario 2: With role ARN provided

Pacu (pwnlabs:from_default-xxxx) > run s3__enum_account --buckets mega-big-tech --role-arn arn:aws:iam::xxxx:role/SampleBucket
  Running module s3__enum_account...

[s3__enum_bucket_owner] Starting enumeration of 1 bucket(s)...

[s3__enum_bucket_owner] Verifying role access...
[s3__enum_bucket_owner] Successfully verified role access

[s3__enum_bucket_owner] Enumerating bucket: mega-big-tech
[s3__enum_bucket_owner] Using role ARN: arn:aws:iam::xxxx:role/SampleBucket
[s3__enum_bucket_owner] Starting account ID discovery...

[s3__enum_bucket_owner] Progress: ************
[s3__enum_bucket_owner] Progress: 1***********
[s3__enum_bucket_owner] Progress: 10**********
[s3__enum_bucket_owner] Progress: 107*********
[s3__enum_bucket_owner] Progress: 1075********
[s3__enum_bucket_owner] Progress: 10751*******
[s3__enum_bucket_owner] Progress: 107513******
[s3__enum_bucket_owner] Progress: 1075135*****
[s3__enum_bucket_owner] Progress: 10751350****
[s3__enum_bucket_owner] Progress: 107513503***
[s3__enum_bucket_owner] Progress: 1075135037**
[s3__enum_bucket_owner] Progress: 10751350379*
[s3__enum_bucket_owner] Progress: 107513503799

[s3__enum_bucket_owner] Success! Account ID: 107513503799

[s3__enum_bucket_owner] Results:
[s3__enum_bucket_owner]   mega-big-tech: 107513503799
[s3__enum_bucket_owner] s3__enum_bucket_owner completed.

[s3__enum_bucket_owner] MODULE SUMMARY:

1 account IDs found from 1 buckets.
0 buckets failed enumeration.

Found account IDs:
  mega-big-tech: 107513503799

This module inspired by:

… issues

[Purpose]: Clean up code to comply with flake8 linting standards
[Changes]:
- Fixed argument parser indentation for better readability
- Removed unused imports (copy, uuid)
- Fixed line endings and removed trailing whitespace
- Added proper docstrings for all functions
- Ensured consistent blank lines between functions

[Testing]: Module functionality remains unchanged, all flake8 checks pass
[Documentation]: No documentation updates required
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