Post

Screenshot

NahamCon CTF 2025 Screenshot Challenge

Challenge description:

Oh shoot! I accidentally took a screenshot just as I accidentally opened the dump of a flag.zip file in a text editor! Whoopsies, what a crazy accidental accident that just accidented!

Well anyway, I think I remember the password was just password!

Alrighty! Let’s take a look at the provided screenshot.

Screenshot.png

While there is probably an easy way to do this, Let’s try using hexedit to make our flag.zip file.

First let’s use touch to create flag.zip, then open it using hexedit.

Specify the name for the file we want to edit:

hexedit

And now we see that we have an empty file, so let’s start adding things in from the provided screenshot, making sure to enter the hex in correctly.

hexedit

Once, we’re all done, it should look like this:

hexedit

CTR+X to exit, save changes, and then test the type using the file command:

1
2
3
┌─[slavetomints@parrot]─[~]
└──╼ $file flag.zip
flag.zip: Zip archive data, at least v5.1 to extract, compression method=AES Encrypted

Hm, since it’s v5.1 my implementation of unzip might struggle with it, we can try anyways for the whimsies though:

1
2
3
4
┌─[slavetomints@parrot]─[~]
└──╼ $unzip flag.zip 
Archive:  flag.zip
   skipping: flag.txt                need PK compat. v5.1 (can do v4.6)

Yep just as expected, so lets just use 7zip instead, with the e option to specify that we want to extract.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
┌─[slavetomints@parrot]─[~]
└──╼ $7z e flag.zip 

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (REDACTED)

Scanning the drive for archives:
1 file, 239 bytes (1 KiB)

Extracting archive: flag.zip
--
Path = flag.zip
Type = zip
Physical Size = 239

    
Enter password (will not be echoed):
ERROR: CRC Failed in encrypted file. Wrong password? : flag.txt
               
Sub items Errors: 1

Archives with Errors: 1

Sub items Errors: 1

Hm, looks like there was an error, I wonder if the flag works still

1
2
3
┌──[slavetomints@parrot]─[~]
└──╼ $cat flag.txt
flag{907e5bb257cd8fc818e88a13622f3d46}

It worked!

FLAG: flag{907e5bb257cd8fc818e88a13622f3d46}

This post is licensed under CC BY 4.0 by the author.