> For the complete documentation index, see [llms.txt](https://book.onosh.ovh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.onosh.ovh/ctf/cnssis2022/rancongiciel.md).

# Rançongiciel

### Contexte

Le secret de ce challenge se trouve dans le fichier "ransom\_challenge.docx.fun" qui a été chiffré par un rançongiciel. Saurez-vous retrouver le secret de ce challenge ? Voici une capture d'écran du message de demande de rançon :&#x20;

![](https://2107662175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiRb_VTw-Cu3cwSNhHj%2Fuploads%2F6ZryZyvn72Ps8H1W1vXM%2Fimage.png?alt=media\&token=69e755f7-be87-47d9-bf0b-213f2478fd64)

🚨 Soyez prudent dans l'utilisation des outils que vous pourriez trouver pour réaliser ce challenge.

⚠ Certaines solutions de protection (antivirus) pourraient détecter ce fichier chiffré comme un fichier malveillant.

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

### Analyse du fichier

On nous donne un fichier "ransom\_challenge.docx.fun" :&#x20;

```
onosh@labrioche:$ file ransom_challenge.docx.fun
ransom_challenge.docx.fun: data
onosh@labrioche:$ du -h ransom_challenge.docx.fun
12K     ransom_challenge.docx.fun
```

Comme prévu, le fichier est bien chiffré :&#x20;

```
00000000  1d e8 f6 51 60 d3 4e 1e  ae da 7b b3 de 1a 6e ab  |...Q`.N...{...n.|
00000010  58 34 61 e6 d8 6d 04 cc  22 9a 88 42 e3 aa 93 5c  |X4a..m.."..B...\|
00000020  2d 03 25 2a 99 b6 0b 94  2e ed 57 79 08 80 65 44  |-.%*......Wy..eD|
00000030  c2 35 a3 ed 4e 5b 62 eb  28 25 a8 02 f7 1e a7 07  |.5..N[b.(%......|
00000040  cf 87 0e 64 0f 3c 42 e2  e8 9f 57 20 99 1d 42 9b  |...d.<B...W ..B.|
00000050  80 a8 af 65 56 f7 42 eb  85 ea fe 76 3e 9c 22 6b  |...eV.B....v>."k|
00000060  f2 17 7b bc 79 3b d7 e2  66 fe d3 2e 46 f2 6b 17  |..{.y;..f...F.k.|
00000070  69 58 51 2c 4f b3 16 af  98 7e 20 d2 b8 f1 3e d4  |iXQ,O....~ ...>.|
00000080  f6 02 a4 71 8c ad 0d da  55 29 87 df b4 fe ad 30  |...q....U).....0|
00000090  a6 5d 2b c6 44 c3 73 f3  4d 48 0e 8d 24 d0 72 de  |.]+.D.s.MH..$.r.|
000000a0  bf a4 d6 b6 bb 31 59 0e  9e 97 f4 13 ba 75 2e 17  |.....1Y......u..|
000000b0  a4 a9 95 f6 b0 56 0c 1b  0d 92 13 b7 0f 71 d1 6b  |.....V.......q.k|
000000c0  6f 20 c4 16 e1 ab dd 85  d3 c6 50 a4 a1 f0 a1 8a  |o ........P.....|
000000d0  f0 28 96 bf d5 f2 cb 02  fb 05 15 e7 7b 5c 33 0d  |.(..........{\3.|
000000e0  42 68 cd 1b 93 18 81 b6  3e bf 65 c9 ce f4 19 56  |Bh......>.e....V|
000000f0  06 8f 2b 36 31 02 d1 b1  6c d2 5c 07 6a 40 b1 af  |..+61...l.\.j@..|
```

### Recherche d'information sur le ransomware

Pour déchiffrer, il faut bien comprendre comment ça a été chiffré :tada:

Après quelques recherches, on découvre qu'il s'agit du ransomware Jigsaw :&#x20;

![Wikipédia Ransomware Jigsaw](https://2107662175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiRb_VTw-Cu3cwSNhHj%2Fuploads%2FSXgoxk8K2j3waAfJop2y%2Fimage.png?alt=media\&token=9b8f00ae-bda4-4612-b089-9d504046217a)

### Récupération du programme pour déchiffrer

Je cherche un déchiffreur en ligne pour récupérer mon fichier.

Je tombe sur le lien suivant :&#x20;

{% embed url="<https://www.bleepingcomputer.com/download/jigsaw-decrypter>" %}

Le programme semble faire le travail attendu :&#x20;

![](https://2107662175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiRb_VTw-Cu3cwSNhHj%2Fuploads%2F7fWxjv3TSXHuzqOnm3Ot%2Fimage.png?alt=media\&token=6e5e6dd1-8a06-42c5-89c7-a34f0a98fb02)

![](https://2107662175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiRb_VTw-Cu3cwSNhHj%2Fuploads%2FS4hrcEoWzYWJ2YBrNlbv%2Fimage.png?alt=media\&token=5e87bf16-f30c-42d3-8c25-49a91473d83b)

### Déchiffrement du fichier

En toute sécurité dans un environnement Windows isolé d'internet, je lance le programme téléchargé et je sélectionne le dossier qui contient mon fichier chiffré :&#x20;

![](https://2107662175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiRb_VTw-Cu3cwSNhHj%2Fuploads%2F2UkVehLlYHKtpIAOlgoQ%2Fimage.png?alt=media\&token=63943b42-af5f-459b-b521-6178ad8cf996)

Je clique sur "Decrypt" :&#x20;

![](https://2107662175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiRb_VTw-Cu3cwSNhHj%2Fuploads%2FDMXrxULb6q0xq4DImvVv%2Fimage.png?alt=media\&token=8d8ac179-3d14-4ff6-b4ce-5866672081d9)

J'ouvre mon fichier ransom\_challenge.docx, et voici le flag :&#x20;

![](https://2107662175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiRb_VTw-Cu3cwSNhHj%2Fuploads%2FTLsUGMnLALuXuDUU1Onc%2Fimage.png?alt=media\&token=8b0e36d0-ada4-4616-afc6-28bfd08ca9bc)
