> For the complete documentation index, see [llms.txt](https://simones-organization-4.gitbook.io/hackbook-of-a-hacker/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simones-organization-4.gitbook.io/hackbook-of-a-hacker/ctf-writeups/metared-2022/1x02..ware.md).

# 1x02..ware

REV | 100 pts - 86 solves

> Description:

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

If we open `nice_game.py` it looks like a basic malware obfuscation, with some code base64 encoded and then eval of it:

```python
eval(compile(base64.b64decode(b''.join(codes_dict.values()), '<string>', 'exec')))
```

Decoding it, we see other base64 encoded code. Decoding it again we finally have the "ransomware" source code.\
But if we look closely we note that the function `encrypt()` won't do anything except to printing the flag base64 encoded.

```python
def encrypt(file):print('Q1RGVUF7cjRuczBtdzRyZV9mNDFsZWR9')
```

```shell
$ echo "Q1RGVUF7cjRuczBtdzRyZV9mNDFsZWR92" | base64 -d
CTFUA{r4ns0mw4re_f41led}
```

> ```
> CTFUA{r4ns0mw4re_f41led}
> ```
