Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
file headers chall part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mud-ali committed Aug 18, 2023
1 parent ea2fcfe commit 955da33
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
16 changes: 16 additions & 0 deletions headers-ii/chall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Headers II
categories:
- foren
value: 75
flag: camp{wH@7s_an_3xTr@_f!l3_aNYw@y$_r3dhi8ib28bf}
description: |-
My friends are passing even weirder files within the group chat now.
I have no clue what they're trying to hide this time.
hints:
- There's no file extension, but what other way could I figure out what type of file it is?
- Someone told me there might be multiple files (even though they only sent one)
files:
- src: funnyfile
authors:
- Mudasir
visible: true
Binary file added headers-ii/flag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added headers-ii/funnyfile
Binary file not shown.
25 changes: 25 additions & 0 deletions headers-ii/generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'''
@author Mudasir
some util functions to generate flag and copy it to video
'''

from PIL import Image, ImageDraw, ImageFont

FLAG = 'camp{wH@7s_an_3xTr@_f!l3_aNYw@y$_r3dhi8ib28bf}'

def generate_flag():
img = Image.new('RGB', (600, 100), color = (0, 0, 0))
d = ImageDraw.Draw(img)
fnt = ImageFont.truetype('arial.ttf', 20)
d.text((40,30), FLAG, font=fnt, fill=(255,255,255))
img.save('flag.png')

def copy_img_to_video():
with open('flag.png', 'rb') as f:
flag = f.read()
with open('funnyfile', '+ab') as f2:
f2.write(flag)

generate_flag()
copy_img_to_video()

0 comments on commit 955da33

Please sign in to comment.