# -*- coding: utf-8-*- from base64 import * from string import * defcheck(s): for i in s: if i notin"flag{-1234567890abcdef}": returnFalse returnTrue flag = 'uLdAuO8duojAFLEKjIgdpfGeZoELjJp9kSieuIsAjJ/LpSXDuCGduouz' a='pTjMwJ9WiQHfvC+eFCFKTBpWQtmgjopgqtmPjfKfjSmdFLpeFf/Aj2ud3tN7u2+enC9+nLN8kgdWo29ZnCrOFCDdFCrOFoF=' b='YXNobGtqIUBzajEyMjMlXiYqU2Q0NTY0c2Q4NzlzNWQxMmYyMzFhNDZxd2prZDEySjtESmpsO0xqTDtLSjg3MjkxMjg3MTM=' alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789abcdefABCDEF+/' FLAG='' print("fail words") for i in flag: if i in a: index = a.index(i) FLAG+=b[index] else: FLAG+='!' print i, print"\nFLAG cipher" print FLAG #'ZmxhZ3sxZTNhMm!lN!0xYz!yLT!mNGYtOWIyZ!!hNGFmYW!kZj!xZTZ!' print"alternative words" aw="" for i in alpha: if i notin b: aw += i print aw '@#$%^&' table = 'ACHJKPRVefnuvw156789efAC+/' print("for z") for i in table: if b64decode("ZTZ"+i)[-1] == '}': FLAG = FLAG.replace("ZTZ!","ZTZ9") table = table.replace(i,"") #print FLAG print("for G") for i in table: if check(b64decode("Zj"+i+"x")) and check(b64decode("Yz"+i+"y")): #print b64decode("Zj"+i+"x") FLAG = FLAG.replace("Zj!x","Zj"+i+"x").replace("Yz!y","Yz"+i+"y") table = table.replace(i,"") #print i #print FLAG print("for I and s") for i in table: for j in table: if check(b64decode("N"+i+"0x")) and check(b64decode("Z"+i+j+"h")): #print b64decode("N"+i+"0x"),b64decode("Z"+i+j+"h") FLAG = FLAG.replace("N!0x","N"+i+"0x").replace("Z!!h","Z"+i+j+"h") table = table.replace(i,"").replace(j,"") #print i,j #print FLAG print("for X and E") for i in table: for j in table: if j == i: continue s = b64decode(FLAG.replace("Mm!l","Mm"+i+"l").replace("LT!m","LT"+i+"m").replace("YW!k","YW"+j+'k')) if check(s): print s