# Enumeration

## AWSCLI Configuration

We can configure Profile using awscli

```python
aws configure --profile McDuck
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2F0szhTWw4sji6o4etAcNG%2Fimage.png?alt=media&#x26;token=fb4d4cef-53ab-405c-a024-0b58bfe00aad" alt=""><figcaption></figcaption></figure>

## Getting Basic Information

First Thing you need to do after setting the credentials is that you need to see your details and information

```python
aws sts get-caller-identity --profile user1
aws iam get-user
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FHneTCbVpHvt9nvBM3nEf%2Fimage.png?alt=media&#x26;token=a107b92d-0268-4a22-b74b-dc1da23f2a18" alt=""><figcaption></figcaption></figure>

### List Groups&#x20;

```bash
aws --profile user4 iam list-groups-for-user --user-name r_waterhouse
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FfE55A5urbAFhfCnwmmaz%2Fimage.png?alt=media&#x26;token=3849ecd3-672a-410c-9d9d-f72fdfbc3077" alt=""><figcaption></figcaption></figure>

### List Policies

```
aws --profile user4 iam list-group-policies --group-name cg-developers
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2F7IG9oa0VUizhVknSe32e%2Fimage.png?alt=media&#x26;token=6fa9c02c-3f4e-47c2-901b-3099e03a9618" alt=""><figcaption></figcaption></figure>

### List Group Policy

```python
aws --profile user4 iam get-group-policy --group-name cg-developers --policy-name developer_policy
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FqybT2FLGlvgCt78zhGHF%2Fimage.png?alt=media&#x26;token=2c43000d-946e-42b8-b49a-57d8ba993d8f" alt=""><figcaption></figcaption></figure>

## S3 Buckets

### List s3 Buckets

```python
aws s3 ls --profile McDuck
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FKahkseF3QApfchF2R1Ei%2Fimage.png?alt=media&#x26;token=fef59384-2bd4-455a-a723-1ed1bbc41efd" alt=""><figcaption></figcaption></figure>

### Recursively Look at the S3 Buckets

We can recursively see the S3 Buckets

```python
aws s3 ls s3://cg-keystore-s3-bucket-rce-webapp --recursive --profile McDuck
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FIXnwbwMPu0ME6dpG5bbE%2Fimage.png?alt=media&#x26;token=4d3f6549-8c3a-4d73-9a49-7cd3b818057d" alt=""><figcaption></figcaption></figure>

### Download Files From S3 Buckets

```
aws s3 cp s3://cg-keystore-s3-bucket-rce-webapp/cloudgoat . --profile McDuck
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2F0maUmInHswyluYTvUMio%2Fimage.png?alt=media&#x26;token=8b66e56f-f7ce-4542-a332-a5e0eed3d15d" alt=""><figcaption></figcaption></figure>

## Describe-Instances

```
aws ec2 describe-instances --profile McDuck
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FAYnQoh7wSyzerhKEDRXa%2Fimage.png?alt=media&#x26;token=4430c9e6-9710-4523-9f54-fff3c5d69dac" alt=""><figcaption></figcaption></figure>

## Describe DB Instances

```
aws rds describe-db-instances --region us-east-1
```

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FVA7PAfmxzQElztsUNoPm%2Fimage.png?alt=media&#x26;token=03844741-58db-4ded-99e9-f389a8535791" alt=""><figcaption></figcaption></figure>
