密码学 mixed_base64(分值250)

点此进入南京邮电大学网络攻防训练平台

解题过程

看题目,因为那个random.choice(),所以只能爆破了,脚本如下:

import random
import base64

result = {
    '16':lambda x:base64.b16decode(x),
    '32':lambda x:base64.b32decode(x),
    '64':lambda x:base64.b64decode(x),
}

with open('code.txt', 'rb') as f:
    code = f.read()

for i0 in ['16','32','64']:
    for i1 in ['16', '32', '64']:
        for i2 in ['16', '32', '64']:
            for i3 in ['16', '32', '64']:
                for i4 in ['16', '32', '64']:
                    for i5 in ['16', '32', '64']:
                        for i6 in ['16', '32', '64']:
                            for i7 in ['16', '32', '64']:
                                for i8 in ['16', '32', '64']:
                                    for i9 in ['16', '32', '64']:
                                        try:
                                            print(result[i9](result[i8](result[i7](result[i6](result[i5](result[i4](result[i3](result[i2](result[i1](result[i0](code)))))))))))
                                        except:
                                            continue

运行脚本,可得flag为nctf{random_mixed_base64_encode}

你可能感兴趣的:(密码学 mixed_base64(分值250))