# Pearl CTF 2025

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FjaMDSeR1uQufbDMFcDht%2Fimage.png?alt=media&#x26;token=14139ccb-b752-44b4-82ba-0d6e193355b1" alt=""><figcaption><p>30/1024 teams</p></figcaption></figure>

| Name            | Category  |
| --------------- | --------- |
| Hidden\_Passage | Web       |
| PlayerDelf      | Forensics |
| rm\_rf\_bin     | Misc      |

{% stepper %}
{% step %}

### Hidden\_Passage

> APD messed up while setting up the system now files are leaking! Can you help uncover the hidden secrets

The intended way of solving this is getting the file hints the server gave lots of hints even in the .bashrc we got a hint about a notes so it hinted about where the flag is solving it you just need to exploit the lfi like url/endpoint?page=../../hidden/flag.php

you will get a reversed base64 then after decoding you can get the flag

note : i didnt do the above and used an unintended way

so because the server is using php we can exploit a part of the back end to create files into the web server by this i managed to make a shell to go to

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2Fu1Q5d7hhdGMeqVNyGhWS%2FScreenshot%202025-03-08%20181651.png?alt=media&#x26;token=a85b7dd2-a35f-493f-8fce-6b5261b82dfc" alt=""><figcaption></figcaption></figure>

i tried using base64 encoding to get the full message but it seems like the server cuts long output from the output so we can just put the output to another file&#x20;

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FuJxFpgIKVh9FOag4wUbp%2Fimage.png?alt=media&#x26;token=12ecc693-c1e7-4b91-b726-c916889f10fb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FEEn143vm8OEgMCiQmxT8%2Fimage.png?alt=media&#x26;token=a8a0662b-c06e-4655-849f-06b502d3503d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2F9MLKPJqhYRP0EXH9oTCZ%2Fimage.png?alt=media&#x26;token=39452bde-ac7b-41a2-aa93-d534b1ab0610" alt=""><figcaption></figcaption></figure>

after doing a ls in the /var/www i managed to find a directory called /hidden then going into that it contains the file flag.php

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2Fz3qujSqY6M309M8yPe85%2FScreenshot%202025-03-08%20183914.png?alt=media&#x26;token=c556e6c0-0c0a-4367-8792-6360cecbb60d" alt=""><figcaption></figcaption></figure>

heres what inside of flag.php

after some time i found out that its from a reverse base64

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2F8ojDNgIEDvL6cJ44XAZv%2FScreenshot%202025-03-08%20190958.png?alt=media&#x26;token=1c5f421d-3c6c-4e34-add6-6cd622dafda0" alt=""><figcaption></figcaption></figure>

one of the best challs i did unintendedly i will not disclose the way i did it with full info
{% endstep %}

{% step %}

### PlayerDelf

> Sometimes, the meaning is hidden in the spaces between the words—don’t just focus on what’s on the surface.But before that, it’s a PDF, but why isn’t the content showing? Maybe the answer lies in what you don’t immediately see. Try looking a bit deeper, especially where things begin.

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FACQN4fgaF8zRRa4E8c9d%2Fimage.png?alt=media&#x26;token=b6d30cb6-015d-4637-84ce-e4b16fb9bff4" alt="" width="348"><figcaption><p>the score is suprisingly low for 11 solves</p></figcaption></figure>

starting the challenge we were given a pdf file opening it gives us a blank page so i went straight to the metadata

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FQWTxCNoSyMZETk31fR0K%2FScreenshot%202025-03-08%20103524.png?alt=media&#x26;token=d4a30871-7a2d-420a-a4cf-7829ef887f6f" alt=""><figcaption></figcaption></figure>

the header gave us a pastebin code but the link is asking us for a password

you can actually find the password carefullly reading the strings of the file

after that i tried fixing the file by the hint its saying that there are some unused data so we can just remove the text from the hex header then we can open the file again

we will get a page that has tons of '\\' and '/' i suspected that this is a binary and created a script

```python
a = r"""
/\/\\//\/\\/\\\\/\\\/\/\\\\///\/
\///////\//\\//\/\\\/\\//\\//\/\//
\//////\\///\\/\\/\\\\/\\/\\/\/\\//\/
\//\//////\\////\//\//////\\/\\///\\/\\
\\/\\/\\\//\\//\\\//\//////\\\/\\\/\
\////\/\\\\//\\\\///\/\///////\//\/
\///\\\/\\\/\\//\/\/\\/\\///\\/\\////
\//////\\//\///\\/\\\\/\\/\\\//\\//\/
\//\////\//\//////\//\\\//\\/\\\\/\\\/\
\\//\/\\////\//////\\\/\///\\/\////\
\//\/\//\//////\\//\\//\\/\\///\\////
\/\\//\\\//\//////\\/\//\/\\\//\\//
\//////\\\//\//\\/\//\/\\//\\\/\\/
\////\\\/\////\//////\\/\//\/\\/\\\///
\//////\\//\\//\\\//\//\\/\\\\/\\/\\
\//\\\/\////\//////\\/\\\\/\\//\\///
\//////\\\\//\/\\/\\\\/\\\/\/\//\/\\
\///\//////\/////\/\\/\\///\\/\\////
\//////\\\\//\/\\/\\\\/\\\/\/\//
\//////\\/\\\//\\//\/\/\\//\/\/\\//
\////\//////\\\/\///\\/\\\\//\//////\
\//\///\\/\\\\//\//////\\/\//\/\\\//\
\//\//////\\//\/\/\\\\////\\\/\///\\
\//\//\\////\/\\///\\/\\\/\////\//////\
\/\//\/\\\/\////\//////\\//\\//\\\//
\//\\/\\\\/\\/\\/\//\//////\\/\////\
\//\/\/\\\//\//\\//\/\//\\\/\///
\//////\\\\////\////\//\\//\\\/\\/\\/
\/\/\/\/\//\\/////\////\///\\/\////
\////\
"""

print(a.replace('/','0').replace('\\', '1'))
```

after that we can get the message

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2F9smyKYjejmPXYyvVbGaD%2Fimage.png?alt=media&#x26;token=0b575467-6a8d-4b48-a042-d56c8cbc3160" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FlBV1EeJiLgHAgOeTRrb0%2Fimage.png?alt=media&#x26;token=b3bb5c6b-b6fd-44b4-ae9c-7bedcd937a4b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FZruGztQRVrFq8nN7EihU%2Fimage.png?alt=media&#x26;token=9ff8da6f-147c-4d20-bc1e-f1e3b86cac87" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FW0dca0YY6mY2oFfgJPpY%2Fimage.png?alt=media&#x26;token=e44fb18d-da3f-40ac-becb-3d299a034495" alt=""><figcaption></figcaption></figure>

we got a handy string

btw when opening the fixed pdf there seems to be extra pages so i just recorded me opening them then used a slowmotion feature in capcut to see the pages

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FJgjT0didwgFaWdiZjzzk%2Fimage.png?alt=media&#x26;token=5c1874eb-8be9-41b3-b712-68889c066f3f" alt=""><figcaption></figcaption></figure>

going inside the mega file

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2F2sZ4xHfwwJUnLDDtEwEw%2Fimage.png?alt=media&#x26;token=5a9b8603-e062-4c69-992c-8a895836c0b9" alt=""><figcaption></figcaption></figure>

after getting the file it was asking for a password and after we use the password we got from the youtube video we managed to get the flag

> ```
> pearl{PDF_1ay3r_3xtract10n_Adv3ntur3}
> ```

{% endstep %}

{% step %}

### rm\_rf\_bin

> My friends, Semay Rhianna and Ravneer Alabadiya, ended up in jail after deleting all the binaries in /bin. Find a way to help them escape—without offending anyone..

going inside the netcat we were given a very limited shell our goal is to read the flag.txt

my friend found out that we can use echo to check directories like so if you want to see whats inside the root directory you can do echo /\* and it will print out all of directory and file names from there

so when doing echo ../ there was a /sh and /socat given we can use the sh using echo $(../sh)

then we have a better shell then we can use the socat to print the file like

> ../socat -u "file:flag.txt" -

the - means we are moving the output to our command line (CMIIW)
{% endstep %}
{% endstepper %}
