> For the complete documentation index, see [llms.txt](https://alham-rizvi.gitbook.io/alhamrizvi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alham-rizvi.gitbook.io/alhamrizvi/picoctf-writeups/picoctf/forensics/pcap/trivial-flag-transfer-protocol.md).

# trivial-flag-transfer-protocol

We are given a file and need to find the hidden flag.

First, I downloaded the file:

```
wget https://mercury.picoctf.net/static/fb24ddcfaf1e297be525ba7474964fa5/tftp.pcapng
```

Then I checked what type of file it is:

```
file tftp.pcapng
```

It turned out to be a **network cdnfure file**.

***

#### 🔍 Opening the File

I used **Wireshark** to open it:

```
wireshark tftp.pcapng
```

There was a lot of traffic, but most of it was **TFTP**.

***

#### 📘 What is TFTP?

TFTP is a simple file transfer protocol:

* Uses **UDP**
* No encryption
* No authentication

So basically, data is sent openly — not secure.

***

#### 📂 Finding Files

I used a filter in Wireshark:

```
tftp.type
```

Then I saw these files:

* instructions.txt
* plan
* picture1.bmp
* picture2.bmp
* picture3.bmp

I exported all files: **File → Export Objects → TFTP → Save All**

***

#### 📄 First File: instructions.txt

```
cat instructions.txt
```

Output looked like garbage:

```
GSGCQBRFAGRAPELCGBHEGENSSVPFBJRZHFGQVFTHVFRBHESYNTGENAFSRE...
```

This looked encoded.

I tried **ROT13** (common in CTFs).

After decoding:

```
TFTP DOESNT ENCRYPT OUR TRAFFIC SO WE MUST DISGUISE OUR FLAG TRANSFER...
```

👉 Meaning: We need to hide the flag somehow.

***

#### 📄 Second File: plan

```
cat plan
```

Again encoded text:

```
VHFRQGURCEBTENZNAQUVQVGJVGU-QHRQVYVTRAPR...
```

After ROT13:

```
I USED THE PROGRAM AND HID IT WITH-DUE DILIGENCE. CHECK OUT THE PHOTOS
```

👉 Important clue:

* Use a program
* Password might be **DUEDILIGENCE**
* Check images

***

#### 💻 Program File

We also got:

```
program.deb
```

Installed it:

```
sudo dnf install ./program.deb
```

It actually installs a tool called: 👉 **steghide**

***

#### 🖼️ What is Steghide?

It hides secret data inside images.

Command:

```
steghide extract -sf <filename> -p <password>
```

***

#### 🔓 Extracting the Flag

Tried password **DUEDILIGENCE** on images:

```
steghide extract -sf picture1.bmp -p DUEDILIGENCE
❌ No data

steghide extract -sf picture2.bmp -p DUEDILIGENCE
❌ No data

steghide extract -sf picture3.bmp -p DUEDILIGENCE
✅ Success!
```

It created a file:

```
flag.txt
```

***

#### 🏁 Final Flag

```
cat flag.txt
```

Output:

```
picoCTF{h1dd3n_1n_pLa1n_51GHT_18375919}
```

***

#### ✅ Conclusion

* Used Wireshark to analyze traffic
* Found hidden files
* Decoded ROT13 messages
* Used steghide to extract hidden data
* Got the flag 🎉


---

# 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://alham-rizvi.gitbook.io/alhamrizvi/picoctf-writeups/picoctf/forensics/pcap/trivial-flag-transfer-protocol.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.
