Sebastian's Blog

software developer. security enthusiast.

HACKvent 2019

HV19.05 Santa Parcel Tracking

Sebastian

To handle the huge load of parcels Santa introduced this year a parcel tracking system. He didn’t like the black and white barcode, so he invented a more solemn barcode. Unfortunately the common barcode readers can’t read it anymore, it only works with the pimped models santa owns. Can you read the Barcode

Challenge Description

Parsing the barcode as a CODE_128 barcode reveals Not the solution. So, it must be about the colors. Analyzing the color hex values showed, that the channel value are all within ASCII range. I extracted the following part from the Image to work with:

The following python script was my idea to parse the Image data.

from PIL import Image

im = Image.open("hv.png")

width, height = im.size
colors = []
for x in range(width):
    for y in range(height):
        r,g,b,a = im.getpixel((x,y))
        if not (r,g,b) in colors:
            colors += [(r,g,b)]

s = ''

for c in colors:
    s += chr(c[0])
for c in colors:
    s += chr(c[1])
for c in colors:
    s += chr(c[2])
print(s)

The script extracts all unique colors from the image sample and then maps the channel value to the corresponding ASCII character. The important thing was to first parse all red channel values, then all green channel values and then all blue channel values. The script reveals the following flag: HV19{D1fficult_to_g3t_a_SPT_R3ader}.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.