Day10-14
This commit is contained in:
BIN
Day 11/challenge.png
Normal file
BIN
Day 11/challenge.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
21
Day 11/decode.py
Normal file
21
Day 11/decode.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from PIL import Image
|
||||
import re
|
||||
import textwrap
|
||||
|
||||
if __name__ == "__main__":
|
||||
img = Image.open("challenge.png")
|
||||
pix = img.load()
|
||||
width, height = img.size
|
||||
|
||||
out = ""
|
||||
for x in range(width):
|
||||
for y in range(height):
|
||||
out += chr(pix[x,y][0] ^ pix[x,y][2])
|
||||
|
||||
flag = re.search(r"HV23\{[^\}]*\}", out)[0]
|
||||
print("[+] Flag:", flag)
|
||||
bin_str = out.replace(flag, "").replace("Never gonna give you up. ", "0").replace("Never gonna let you down. ", "1")
|
||||
bin_str = re.sub(r"[^01]", "", bin_str)
|
||||
flag2 = "".join(chr(int(octet, 2)) for octet in textwrap.wrap(bin_str, 8))
|
||||
flag2 = re.search(r"HV23\{[^\}]*\}", flag2)[0]
|
||||
print("[+] Hidden Flag:", flag2)
|
||||
Reference in New Issue
Block a user