題目大致如下 👉: Move the stack pointer one cell to the right 👈: Move the stack pointer one cell to the lef 👍: Increment the current cell by one, bounded by 255 👎: Decrement the current cell by one, bounded by 0 💬: Print the ASCII value of the current cell 🔁##: Repeat the previous instruction 0x## times The Emoji Stack is 256 cells long, with each cell supporting a value between 0 - 255. 給輸出flag的emoji
for i inrange(1, 1001): challenge = r.recvline().strip().decode().split(': ')[1] challenge = base64.b64decode(challenge).decode() n = int(challenge.split('|')[1])
defpromptGen(): flipFlops = lambda x: chr(ord(x) + 1) withopen('topsneaky.txt', 'rb') as f: first = f.read() bittys = secrets.token_bytes(len(first)) onePointFive = int.from_bytes(first) ^ int.from_bytes(bittys) second = onePointFive.to_bytes(len(first)) third = b64encode(second).decode('utf-8') bittysEnc = b64encode(bittys).decode('utf-8') fourth = '' for each in third: fourth += flipFlops(each) fifth = f"Mwahahaha you will n{fourth[0:10]}ever crack into my pass{fourth[10:]}word, i'll even give you the key and the executable:::: {bittysEnc}" return fifth
defmain(): print(promptGen()) if __name__ == '__main__': main()
bittysEnc = "Zfo5ibyl6t7WYtr2voUEZ0nSAJeWMcN3Qe3/+MLXoKL/p59K3jgV" fourth = "Ocmu{9gtufMmQg8G0eCXWi3MY9QfZ0NjCrXhzJEj50fumttU0ymp" fifth = f"Mwahahaha you will n{fourth[0:10]}ever crack into my pass{fourth[10:]}word, i'll even give you the key and the executable:::: {bittysEnc}" third = "" for i in fourth: third += chr(ord(i)-1) third = "Nbltz8fsteLlPf7F/dBWVh2LX8PeY/MiBqWgyIDi4/etlssT/xlo" from base64 import * bitty = b64decode(bittysEnc) second = b64decode(third) onePointFive = int.from_bytes(second) from Crypto.Util.number import long_to_bytes first = long_to_bytes(onePointFive ^ int.from_bytes(bitty))
# Known part of the key and encrypted flag prefix = "vulture" suffix = "Shrine" words = ["urn", "arch", "snake", "bug", "plant", "staff", "foot"] enc_flag = b"FFxxg1OK5sykNlpDI+YF2cqF/tDem3LuWEZRR1bKmfVwzHsOkm+0O4wDxaM8MGFxUsiR7QOv/p904UiSBgyVkhD126VNlNqc8zNjSxgoOgs="
# Brute force all possible combinations of 4 to 7 words in between for length inrange(4, 8): for combo in itertools.permutations(words, length): key = prefix + ''.join(combo) + suffix obj = AESCipher(key) try: dec_flag = obj.decrypt(enc_flag) if"pctf"in dec_flag: print("Key found:", key) print("Flag:", dec_flag) break except: continue