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MzEzMTMwMzAzMTIwMzEzMDMxMzAzMDMwMzEyMDMxMzAzMTMwMzEzMDMxMjAzMTMxMzAzMTMwMzEzMTIwMzEzMTMxMzAzMDMxMjAzMTMwMzEzMDMxMzEzMDIwMzEzMDMxMzAzMDMxMzAyMDMxMzAzMDMwMzEzMTMwMjAzMTMxMzEzMDMwMzEyMDMxMzAzMTMwMzAzMDMwMjAzMTMwMzEzMDMwMzEzMDIwMzEzMTMwMzEzMTMwMzAyMDMxMzEzMTMwMzAzMTIwMzEzMDMxMzEzMDMxMzAyMDMxMzAzMTMwMzEzMDMwMjAzMTMxMzAzMDMwMzEyMDMxMzAzMTMwMzEzMTMwMjAzMTMxMzEzMDMwMzE=
$ echo $data | base64 -d
Nice! Now keep going. 54776f206d6f72652e2031303030313130203131303130303120313130313131302031313030303031203131303131303020313030303030203130303031303020313130303130312031313030303131203131313030313020313131313030312031313130303030203131313031303020313130313030312031313031313131203131303131313020313030303031203130303030302031303130303031203131303030312031303130303130203130303031313120313130303031302031303030313131203130313031313020313130313030302031313030303131203131303131303120313130313031203131303131312031303130303131203130313031313020313131303031203130303030313020313031303130302031303130313130203131313030312031303130303031203130313031303120313130313031312031313130303120313031303131302031303130303130203130303031313020313131303031203130313030303020313031303031302031313031313030203131313030312031303131303130203130313031303020313130303031203130313031313020313131303031
This time it seems like hexadecimal data. Let’s decode it again:
$ data=54776f206d6f72652e2031303030313130203131303130303120313130313131302031313030303031203131303131303020313030303030203130303031303020313130303130312031313030303131203131313030313020313131313030312031313130303030203131313031303020313130313030312031313031313131203131303131313020313030303031203130303030302031303130303031203131303030312031303130303130203130303031313120313130303031302031303030313131203130313031313020313130313030302031313030303131203131303131303120313130313031203131303131312031303130303131203130313031313020313131303031203130303030313020313031303130302031303130313130203131313030312031303130303031203130313031303120313130313031312031313130303120313031303131302031303130303130203130303031313020313131303031203130313030303020313031303031302031313031313030203131313030312031303131303130203130313031303020313130303031203130313031313020313131303031
$ echo $data | xxd -r -p
Two more. 1000110 1101001 1101110 1100001 1101100 100000 1000100 1100101 1100011 1110010 1111001 1110000 1110100 1101001 1101111 1101110 100001 100000 1010001 110001 1010010 1000111 1100010 1000111 1010110 1101000 1100011 1101101 110101 110111 1010011 1010110 111001 1000010 1010100 1010110 111001 1010001 1010101 1101011 111001 1010110 1010010 1000110 111001 1010000 1010010 1101100 111001 1011010 1010100 110001 1010110 111001
And now we have binary data. We can decode it using Python in a “one-liner”:
$ data='1000110 1101001 1101110 1100001 1101100 100000 1000100 1100101 1100011 1110010 1111001 1110000 1110100 1101001 1101111 1101110 100001 100000 1010001 110001 1010010 1000111 1100010 1000111 1010110 1101000 1100011 1101101 110101 110111 1010011 1010110 111001 1000010 1010100 1010110 111001 1010001 1010101 1101011 111001 1010110 1010010 1000110 111001 1010000 1010010 1101100 111001 1011010 1010100 110001 1010110 111001'
$ python3 -c "print(''.join(map(lambda n: chr(int(n, 2)), '$data'.split())))"
Final Decryption! Q1RGbGVhcm57SV9BTV9QUk9VRF9PRl9ZT1V9
And we get another string encoded in Base64. We decode it one more time and we get the flag:
$ echo Q1RGbGVhcm57SV9BTV9QUk9VRF9PRl9ZT1V9 | base64 -d
CTFlearn{I_AM_PROUD_OF_YOU}