Posts CSC CTF 2020: National Cyber Week
Post
Cancel

CSC CTF 2020: National Cyber Week

Aing,_Robot

Description

Sketch like Sonny https://www.youtube.com/watch?v=Bs60aWyLrnI

Author: Bigby

Problem

In this challenge we will provided with a mp4 file where the links can be downloaded from here: robot.mp4

From the video, it will contain our flag but it only print the flag line by line. It the same as the youtube link that has been provided in this challenge. Now what I do is extract all the frames that are in the video by using ffnpeg tools.

1
2
mkdir frames
ffmpeg -i robot.mp4 "frames/out-%03d.jpg"

After extracting all the frames from the video, we will see that there is hundreds of frames that have been extract.

files.jpg

Now what we need to do is save each of the frames into one blank image. I found a script of python 3 that used PIL in stackoverflow and modified it to save into results.jpg. Here is the full script that I used to extract the flag:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import PIL
from PIL import Image
from PIL import ImageChops # used for multiplying images

def black_onto(img1, img2):
    resized = Image.new("RGB", img1.size, "white")

    resized.paste(img2)
    return ImageChops.multiply(img1, resized)

# open images
results = Image.open("out-001.jpg")

for i in range(1,920):
    print(f"Processing {i}.jpg file")
    if i < 10:
        mask = Image.open(f"out-00{i}.jpg")
    elif i >= 10 and i<100:
        mask = Image.open(f"out-0{i}.jpg")
    else:
        mask = Image.open(f"out-{i}.jpg")
    results = black_onto(results, mask)

results.save("results.jpg")

results.jpg

Flag

Flag : CSCCTF{M4NT4P_53K4R4N9_B3rS1hK4n_F1L3}

References