Tags: programming python 

Rating:

For this challenge, we were given a netcat command that connects to a tool. Given this tool, maybe we can figure out how to approach this problem.

Once loaded, this was the screen we were presented with:

![main](https://github.com/Cap-Size/CTF_Write_Ups/blob/master/ISITDTU_2019/chaos/main.png?raw=true)

There seems to be a cipher that they give us, and two options to choose: encrypt a message, or decrypt the ciphertext.

So I run the program and try to see a pattern:

![test](https://github.com/Cap-Size/CTF_Write_Ups/blob/master/ISITDTU_2019/chaos/test.png?raw=true)

I notice that 'the' translates into '00/tt/??/ww 11/hh/&&/gg 55/ee/((/dd'. The second set of doubles is the letter of the word, but the other chars are used to obfuscate the text. I check each type of char and realize that:
* Each set is seperated by a space.
* Lowercase: four sets long, letters in second set
* Uppercase: four sets long, characters in the third set and capital letters in the fourth set.
* numbers: three sets long, numbers in the first set.
* special characters: five sets long, characters in the fifth set.

So with these rules, I made a script that will parse through and enter the flag, the script can be found [here](https://github.com/Cap-Size/CTF_Write_Ups/blob/master/ISITDTU_2019/chaos/chaos.py)

Original writeup (https://github.com/Cap-Size/CTF_Write_Ups/tree/master/ISITDTU_2019/chaos).