목록2020/05 (1)
CHIqueen
TJCTF 2020 Zipped Up
재미있는 문제 import shutil import os xflag = "tjctf{n0t_th3_fl4g}\n" open("0.txt","w").write(xflag) cwd = os.getcwd() j=0 while (flag:=open(str(j)+".txt").read()) == xflag: j+=1 for i in os.listdir(): if i.endswith("kz3"): os.rename(i,str(j)+".zip") i=str(j)+".zip" if i.startswith(str(j)): shutil.unpack_archive(i) break for k in os.listdir(cwd+"\\"+str(j)): shutil.move(cwd+"\\"+str(j)+"\\"+k,cwd+"\\"..
프로그래밍/Python
2020. 5. 27. 14:44