点击此处获得更好的阅读体验
WriteUp来源
https://dunsp4rce.github.io/csictf-2020/reversing/2020/07/21/Esrever.html
by anishbadhri
题目描述
I encrypted my flag so that nobody can see it, but now I realize I don't know how to decrypt it. Can you help me?
题目考点
解题思路
esrever.py
contains 4 functions enc1
, enc2
, enc3
and enc4
. The first step would be to determine how to reverse each of these functions
enc4
can be reversed by using the same mapping array but assigning in reverse.enc3
, similar toenc4
can be reversed using the same mapping aray and assiging in reverse.enc2
is an xor function and hence is its own reverse.enc1
is a caesar shift of a random value and hence needs to be iterated for the range of the random value
The encryptedText
and encryptedKey
being encrypted with enc1
a hundred times does not matter as the caesar shift can be tested on all values of 0 to 26.
The flag is obtained on reversing each function from the end.
Solution Script:
1 | def enc4rev(text): |
Flag
1 | csictf{esreverisjustreverseinreverseright} |