gif_path = args.gif.expanduser().resolve() if not gif_path.is_file(): parser.error(f"GIF file not found: {gif_path}")
output_dir = args.output or gif_path.with_name(f"{gif_path.stem}_frames") output_dir = output_dir.expanduser().resolve()
frame_count = extract_frames(gif_path, output_dir, args.prefix) print(f"Extracted {frame_count} frame(s) to: {output_dir}")
if __name__ == "__main__": main()
加个标志位
LitCTF{qr_h1gh_3rr_c0r_r3c0v3ry}
lit_welcome
LitCTF{w3lc0m3_t0_m1sc_w0rld}
lit_sstv
Martin-1 SSTV 获得
LitCTF{sstv_p4t13nc3}
lit_pyjail_reader
服务端主要逻辑
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
alphabet = string.ascii_uppercase # python自带的字符串:A-Z challenge = "".join(secrets.choice(alphabet) for _ in range(8)) # 随机选字符8次并拼接 secret比random更安全 conn.sendall( f"Please enter the reverse of '{challenge}' to continue: ".encode() ) # 把要求倒序的指令发给客户端 ans = recv_line(conn) if ans != challenge[::-1]: conn.sendall(b"Wrong reverse string. Bye.\n") return conn.sendall( b"Good.\n" b"Step 1: read /app/where_is_flag.txt (it contains the flag path).\n" b"Step 2: read that path.\n"
服务端随机生成 8 位大写字母验证码
要求你输入这个字符串的倒序
验证通过后,提示你分两次输入文件路径
第一次要求你读 /app/where_is_flag.txt
第二次要求你读上一步文件里给出的真实 flag 路径
漏洞点
1 2 3 4 5 6
def safe_read(path: str) -> str: p = path.strip() if not p or p.startswith("-") or "\x00" in p: raise ValueError("invalid path") with open(p, "r", errors="replace") as f: return f.read(MAX_FILE)
luxlu@C:\Users\hp>ncat challenge.cyclens.tech 31644 === LitCTF pyjail unicode === Send ONE line of Python. It will be eval() with full __builtins__. ASCII blacklist applies to your *source text* (see attachment jail.py). Goal: read /flag and get its str content. >
# 仅检查「你键入的文本」:ASCII 关键字用词边界,避免匹配到 important 等 BANNED = re.compile( r"\bimport\b|\bexec\b|\beval\b|\bopen\b|\bcompile\b|\bglobals\b|\blocals\b|__|" r"\bgetattr\b|\bsetattr\b|\bdelattr\b|\bvars\b|\bbreakpoint\b|\binput\b|" r"\bsubprocess\b|\bpty\b|os\.|sys\.|\bposix\b", re.IGNORECASE, ) def banned(raw: str) -> bool: if "\\u" in raw or "\\U" in raw or "\\x" in raw: return True return BANNED.search(raw) is not None