HeroCTF v3 2021: A(i)crostic

A(i)crostic

Category: AI

chal

85 points

There, have you ever coded an AI ?
Hey, after this challenge the answer to that question will be yes.
I advise you to get started there (Google Colab) Second, go to File -> Save a Copy in Google drive
When done, you can then import files in the notebook’s file section.
After that, it’s up to you.
You will have to code out the flag. :wink:

Otherwise, you must have jupyter-notebook with the following :

  • Numpy
  • Tensorflow
  • Matplotlib

Format : Hero{FLAGYOUFOUND}
Author : iHuggsy

Solution

I’ve extracted given archive and used the data within (cat photos) with pretrained model to get predictions. First letters of labels combined together gave flag.

results = {}
for a in os.listdir('/content/npy'):
  array = np.load('/content/npy/' + a)
  img_array_expanded_dims = np.expand_dims(array, axis=0)
  pp = pretrained_model.predict(img_array_expanded_dims)
  results.update({a: get_imagenet_label(pp)})
results

keys = sorted(results, key=lambda x: x)
flag = ''
for key in keys:
  flag = flag + results[key][1][0]
print('Flag: Hero{{{}}}'.format(flag.upper()))

flag

Flag

Hero{AIISWONDERFUL}

Privacy Policy
luc © 2021