# Level 3

Like Level 2, let’s see what we can list from the bucket.

```
s3 ls s3://level3-9afd3927f195e10225021a578e6f78df.flaws.cloud/ --profile flaws
```

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2FyX3f5e13fsPeo5i31yWs%2Fimage.png?alt=media&#x26;token=fecf42a1-f80c-4d67-86b6-07236593dcb6" alt=""><figcaption></figcaption></figure>

After listing the contents of the bucket, we can see that it contains a .git repository. This is worth looking into because .git repositories can contain sensitive data.

Using the sync command, we can download the bucket's contents locally. First, we need to create a folder to place the contents.

```
mkdir /home/kali/Desktop/flaws
```

Next, we will download the s3 bucket to the new folder that was just created.

```
aws s3 sync s3://level3-9afd3927f195e10225021a578e6f78df.flaws.cloud/ /home/kali/Desktop/flaws --profile flaws
```

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2FR4ddLNTAzxr1pnVIqGYl%2Fimage.png?alt=media&#x26;token=23a676f5-252f-43be-915c-11c5fdb92bd4" alt=""><figcaption></figcaption></figure>

In the flaws folder that was just created, we want to list the contents to ensure that it was properly downloaded. As we can see here, it matches what we listed earlier above.

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2FGClSfbjH9deLwNURoCKr%2Fimage.png?alt=media&#x26;token=2469a240-b52c-4153-a284-4d034d918f50" alt=""><figcaption></figcaption></figure>

Since we are looking at a .git repository, we can use the `git log` command to view a record of the commits. We can see that there are two commits and one of them has a comment left by a previous user.

*Note: The alphanumeric string after “commit” is the hash of the git repository at the time of commit.*

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2FImb7KZwq1hhoRPCZdTh6%2Fimage.png?alt=media&#x26;token=2808972f-1944-4969-8aa6-a1b8f7ea694a" alt=""><figcaption></figcaption></figure>

We can now use the `git checkout` command to navigate between branches. Let’s take a look at the first commit and list the contents. We can see here that there isn’t anything interesting.

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2F5pKa3grWMzyiUEi66neP%2Fimage.png?alt=media&#x26;token=e988ac79-2efe-4175-be3e-caf86ef80878" alt=""><figcaption></figcaption></figure>

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2FWaHXYolI8wnUwGfYJHfA%2Fimage.png?alt=media&#x26;token=f7c154eb-4ca2-40c7-ac57-cdd1925a67aa" alt=""><figcaption><p>Listing contents of the folder after navigating to the .git branch</p></figcaption></figure>

Now, let’s do the same thing for the next commit and list the contents.&#x20;

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2FSUWgvHLZXvvuD2KM1cNf%2Fimage.png?alt=media&#x26;token=22be0449-4372-4464-a038-a36b78cc3e88" alt=""><figcaption></figcaption></figure>

When we list the folder contents, there is an access\_keys.txt file.

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2FZM6Z4wdZOBV2H8NsRWwm%2Fimage.png?alt=media&#x26;token=e53a8a60-e7ec-409f-ba1a-1aaa8ba2d385" alt=""><figcaption></figcaption></figure>

To read the file, we will use the `cat` command. It looks like there is an access\_key and secret\_access\_key value saved to the file. We can use this to configure a new AWS profile.

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2F3Sgnr37MgQtdxHD4Yw00%2Fimage.png?alt=media&#x26;token=d1d53fdd-6253-4d0e-8b67-11bdf8b0658d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2F8RyEHUQa8emo9MxQZsFz%2Fimage.png?alt=media&#x26;token=6c2427c7-fc41-49a2-9290-247caea2ce78" alt=""><figcaption><p>Configuring a new AWS profile for Level 3</p></figcaption></figure>

Now that we have access, let’s see what we can find by listing the bucket contents. Great, we’ve found buckets to the next levels!

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2FcLGpIX5IByiXSAEaxZTm%2Fimage.png?alt=media&#x26;token=50b07f62-622e-4a1f-9391-6c940c206056" alt=""><figcaption></figcaption></figure>

Let's navigate to Level 4

<figure><img src="https://450836410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgns9cN7UvH1POIBCfrRn%2Fuploads%2FLww5kqD55LQwBGOYuXNr%2Fimage.png?alt=media&#x26;token=262378ab-2429-4ff1-babe-dc524aea5486" alt=""><figcaption></figcaption></figure>
