2 00:00:03,001 --> 00:00:07,000 Enjoy the movie. Nothing hidden in the subtitles – just a generic welcome message. We quickly glance at them with ffprobe just to be sure there’s nothing weird:
open('payload.bin', 'wb').write(out) print('Done – payload written to payload.bin') Run it:
# 1. List the tracks + attachments $ mkvmerge -i khatrimaza-org.mkv File 'khatrimaza-org.mkv': container: Matroska Track ID 0: video (V_MPEG4/ISO/AVC) Track ID 1: audio (A_AAC) Track ID 2: subtitles (S_TEXT/UTF8) The Khatrimaza-org-mkv
def xor(data, key): return bytes(b ^ k for b, k in zip(data, itertools.cycle(key)))
out = bytes([b ^ key[i % len(key)] for i, b in enumerate(data)]) 2 00:00:03,001 --> 00:00:07,000 Enjoy the movie
mkvextract tracks khatrimaza-org.mkv 0:video.h264 1:audio.aac 2:subtitles.srt mkvextract attachments khatrimaza-org.mkv 0:Roboto-Regular.ttf 1:hidden.bin Now we have the following files in our working directory:
$ python3 xor.py hidden.bin s3cr3t_k3y_4_f1ag payload.bin 🎉 List the tracks + attachments $ mkvmerge -i khatrimaza-org
$ mkvinfo khatrimaza-org.mkv | grep -i "title\|comment" |+ Title: The Khatrimaza Movie |+ Comment: s3cr3t_k3y_4_f1ag The MKV container has a comment field: