Tags: reversing 

Rating: 5.0

Open the binary in IDA, I noticed that it just:
1. check input length;
2. permute input into ch1;
3. compare ch1 with ch2="t_nssiamwp_lsei_hatt{_gaalllF}"

This give me a quick solution.

1. debugging the program using gdb;
2. set a breakpoint at call to strcmp(ch1,ch2);
3. start the program and feed input "ABCDEFGHIJKLMNOabcdefghijklmno"
4. continue excution to breakpoint and check ch1, got "OaNbMcLdKeJfIgHhGiFjEkDlCmBnAo"
5. perform reverse permutation on ch2:
```
python -c 'print "".join(x for _,x in sorted(zip("OaNbMcLdKeJfIgHhGiFjEkDlCmBnAo","t_nssiamwp_lsei_hatt{_gaalllF}")))'
```
> => Flag{this_wasnt_simple_at_all}