Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import base64
- import random
- flag="TSCTF-J{fake_flag}"
- def GBK2312():
- head = random.randint(0xb0, 0xf7)
- body = random.randint(0xa1, 0xfe)
- val = f'{head:x} {body:x}'
- str = bytes.fromhex(val).decode('gb2312')
- return str
- def b64encode(a):
- encode = base64.b64encode(a.encode('utf-8'))
- return encode
- if __name__ == '__main__':
- for i in range(777):
- choice=random.random()
- if choice <= 0.3:
- chinese=GBK2312()
- else :
- chinese=str(random.choice(dic_word))
- chinese_base64=b64encode(chinese)
- print(f'Input base64(???) = {chinese_base64} plz!')
- s = input()
- if s == chinese:
- print(f'{i+1}:succeed')
- else :
- print(f'{i+1}:failed')
- quit()
- print(flag)
Add Comment
Please, Sign In to add comment