Misc - Broken Pieces
479 points | 48 solves
Description
Oh no! I broke this framed image. Unless you can magically put it together, I’m in big trouble. Flag format: CTF{...}
Downloads
Solution
The official category is OSINT but I think its really more of a Misc challenge so I am going to label it as a Misc challenge.
In this challenge, we are given 400 images and each of them is of the size 15x15. The challenge objective is straight-forward but not many people would know how to write a script to combine the images. Writing the script is trivial in python thanks to the Pillow library. The final script is as such:
from PIL import Image
# Since there are no dimensions specified and we are given 400 images,
# we assume it is a 20 by 20 square matrix. Hence, 15*20, 15*20.
src = Image.new('RGB', (300, 300))
for j in range(1,21):
for i in range(1,21):
dst = Image.open("pieces/" + str(i).zfill(2) + str(j).zfill(2) + ".jpg")
column = 1 if j == 1 else (j-1)*15
row = 1 if i == 1 else (i-1)*15
src.paste(dst, (column, row))
src.save('out.png')
The final image generated is a QR code image:
Decoding using my favourite online QR code reader, we get the flag.

Flag: CTF{th@nk2_f0r_h3lping}
Last updated