Skip to content

Instantly share code, notes, and snippets.

@christophchamp
Last active October 31, 2021 17:34
Show Gist options
  • Save christophchamp/8e086f73c148510c0fc6 to your computer and use it in GitHub Desktop.
Save christophchamp/8e086f73c148510c0fc6 to your computer and use it in GitHub Desktop.
Steganography trick
# Steganography trick:
$ cat foo.zip >> bar.gif # "hides" 'foo.zip' inside 'bar.gif'
$ qiv bar.gif # views just fine (note: you can use any image viewer you like here)
$ unzip bar.gif # extracts 'foo.zip'
# Example:
$ echo "HELLO WORLD" > file.txt
$ zip -r foo.zip file.txt
$ cat foo.zip >> bar.gif
$ hexdump -C bar.gif |tail -12
000007f0 7c d3 46 69 6b e9 ce 0c 00 00 00 0c 00 00 00 08 ||.Fik...........|
00000800 00 1c 00 66 69 6c 65 2e 74 78 74 55 54 09 00 03 |...file.txtUT...|
00000810 ce 7c 84 55 d4 7c 84 55 75 78 0b 00 01 04 e8 03 |.|.U.|.Uux......|
00000820 00 00 04 e8 03 00 00 48 45 4c 4c 4f 20 57 4f 52 |.......HELLO WOR|
00000830 4c 44 0a 50 4b 01 02 1e 03 0a 00 00 00 00 00 4b |LD.PK..........K|
00000840 7c d3 46 69 6b e9 ce 0c 00 00 00 0c 00 00 00 08 ||.Fik...........|
00000850 00 18 00 00 00 00 00 01 00 00 00 b4 81 00 00 00 |................|
00000860 00 66 69 6c 65 2e 74 78 74 55 54 05 00 03 ce 7c |.file.txtUT....||
00000870 84 55 75 78 0b 00 01 04 e8 03 00 00 04 e8 03 00 |.Uux............|
00000880 00 50 4b 05 06 00 00 00 00 01 00 01 00 4e 00 00 |.PK..........N..|
00000890 00 4e 00 00 00 00 00 |.N.....|
00000897
# See the "HELLO WORLD" there?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment