Found Key Hidden in JPEG File
Screen capture of picoCTF Webshell in picoGym

Found Key Hidden in JPEG File

Today, solved the picoGym ethical hacking challenge titled Information, which challenged users to find a picoCTF key hidden in a JPEG image file. But decided to respectfully tech-splain or summarize instead of blatantly giving away detailed spoilers.

The JPEG image features a kitten which appeared to have commandeered a laptop computer, but failed to hack it using redundant code.

On My Local Machine

  • used the xxd hex dump tool, which created a dump of cat.jpg. I found an interesting looking CTF string segment in that dump, but there was no picoCTF key.
  • installed exiftool locally using the tar.gz archive found at exiftool.org, but, for some reason, it failed to return enough metadata from the cat.jpg file which was downloaded to this local machine. In short, the metadata returned by ./exiftool ~/Desktop/cat.jpg failed to list the key/value needed to help solve the challenge. Am able to state this now from a hind-sight-is-twenty-twenty point of view.

Next time: may try to git-clone exiftool/exiftool from github.com, desiring to use it locally in the future.

Using the picoCTF Webshell

  1. used GNU wget tool to download cat.jpg to a picoCTF Webshell instance (see header image).
  2. used exiftool to print a list of metadata keys/values to the picoCTF Webshell display. The Current IPTC Digest key's hexadecimal-based hash looked interesting. Scrolling down further, found the License key which contained a promising base64 hash value.
  3. used Bash's built-in echo command to stdout the base64 hash string, which then was piped to base64 -d or base64 --decode, and which became my solution. Success.

exiftool (update)

Above I mentioned cloning the exiftool repo from github.com. Well, I tried it and it worked on my machine locally, so I may follow up with a short script that returns the picoCTF key solution—perhaps a gist link.

nick3499/find-hidden-key-cat-jpg.sh (update)

I wrote a three-line script that returns the picoCTF key. After first using wget to download cat.jpg to the local machine, then grepping the line with that base64 hash, then isolating the hash and passing it to base64 --decode.

The new shell script is linked below:

find-hidden-key-cat-jpg.sh

To view or add a comment, sign in

More articles by Nicholas T

  • PicoGym GET aHEAD Practice Challenge

    I solved the picoCTF/picoGym GET aHEAD challenge. The problem involved the HTTP methods GET, POST and HEAD, since HEAD…

  • 'Stonks' Format String Attack

    I solved the picoGym Stonks practice challenge which featured binary exploitation of code written in C in order to…

  • Convert Port Numbers to picoCTF Key

    I solved picoCTF's Nice netcat..

  • Translated Pictograms to picoCTF Key

    I solved the picoGym challenge titled Transformation, which involved the translation of encoded Chinese pictograms to a…

  • Decoding ROT13-Encoded Strings

    My first cryptographic practice challenge in picoGym involved decoding a string encoded with the ROT13 cypher. A cypher…

  • I Broke Pi-Hole

    As a way to gain more experience with cybersecurity software, I installed Pi-hole in my desktop computer. Pi-hole is a…

  • First CTF Flag Submission

    Tonight, my first flag was submitted to Carnegie Mellon University's picoGym Practice Challenges—a challenge titled…

Insights from the community

Others also viewed

Explore topics