import random flag = 'moectf{xxxxxxxxxxx}' digit = '' for i in flag: digit += str(ord(i)) i = 0 while i < len(digit): n = random.randint(0, 128) iford('a') <= n <= ord('z') orord('A') <= n <= ord('Z'): digit = digit[0:i] + chr(n) + digit[i:] i += 1 withopen('puzzle.txt', 'w') as out: out.write(digit)
a=[109,111,101,99,116,102,123,112,121,116,104,48,110,95,49,115,95,115,48,95,115,49,109,112,108,101,125] for i in a: print(chr(i),end='') # 109,111,101,99,116,102,123,112,121,116,104,48,110,95,49,115,95,115,48,95,115,49,109,112,108,101,125 # moectf{pyth0n_1s_s0_s1mple}
import os from base64 import * count = 0 path = "自己的目录\puzzle" dirs1 = os.listdir(path) for i in dirs1: path_1 = os.path.join(path,i) dirs2 = os.listdir(path_1) for j in dirs2: path_2 = os.path.join(path_1,j) dirs3 = os.listdir(path_2) for k in dirs3: path_3 = os.path.join(path_2,k) dirs4 = os.listdir(path_3) for m in dirs4: path_4 = os.path.join(path_3,m) print(path_4) f=open(path_4) file = f.read() f.close() count += file.count('FrankNB!') print(count.b64encode())
import os from base64 import * count_n = 0 count_y = 0 count = 0
path = "H:\Competitions\moectf\Algorithm\Eqqie\puzzle" dirs1 = os.listdir(path) for i in dirs1: path_1 = os.path.join(path,i) dirs2 = os.listdir(path_1) for j in dirs2: path_2 = os.path.join(path_1,j) dirs3 = os.listdir(path_2) for k in dirs3: path_3 = os.path.join(path_2,k) dirs4 = os.listdir(path_3) for m in dirs4: path_4 = os.path.join(path_3,m) print(path_4) #遍历文件 f = open(path_4) file = f.read() f.close() #读取文件 if file[7]=='?': count_n += 1 continue count_y += 1 a = "" a += file[7:] flag = 1 for i in a: if ('9'>=i>='0'or'z'>=i>='a'or'Z'>=i>='A'): if flag==1: flag = 0 count += 1 else: flag=1