$ wget http://www.caesum.com/handbook/Stegsolve.jar -O stegsolve.jar
$ wget https://github.com/ctfs/write-ups-2014/raw/master/plaid-ctf-2014/doge-stege/doge_stege-bcea78ed7ce3588f89b56f125866c1e2.tar.bz2 $ tar xf doge_stege-bcea78ed7ce3588f89b56f125866c1e2.tar.bz2
file
でファイルの詳しい情報を見てみましょう$ file doge_stege.png doge_stege.png: PNG image data, 680 x 510, 8-bit colormap, non-interlaced
8-bit colormap
なのでパレットカラーです8-bit/color RGBA
PLTE
(paletteの略)というのが入ってます$ xxd doge_stege.png | head -n 10 0000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR 0000010: 0000 02a8 0000 01fe 0803 0000 0067 590c .............gY. 0000020: 1900 0003 0050 4c54 450a 0b07 4005 0102 .....PLTE...@... 0000030: 174b 1c1c 1829 01fe 5713 022f 2e24 3d32 .K...)..W../.$=2
$ java -jar /path/to/stegsolve.jar
で起動して、出てきた画面のFileから操作します$ wget https://raw.githubusercontent.com/ctfs/write-ups-2014/master/plaid-ctf-2014/doge-stege/change_palette.py
# replace palette entry 127 to 127 + n with white, the rest with black #paldata = ("\x00\x00\x00" * 127) + ("\xff\xff\xff"*n) + ("\x00\x00\x00" * (256 - (127 + n)))
$ for i in {0..128}; do python ./change_palette.py doge_stege.png "range-color-127+${i}.png" "${i}"; done
11111111
, 254は2進数で11111110
なので、LSBのみが変化している→「LSBを利用した方法」$ exiftool image.jpg
みたいな感じで見ることができます$ wget https://github.com/ianare/exif-samples/raw/master/jpg/gps/DSCN0029.jpg $ exiftool DSCN0029.jpg ... GPS Latitude : 43 deg 28' 5.68" N GPS Longitude : 11 deg 52' 48.62" E GPS Position : 43 deg 28' 5.68" N, 11 deg 52' 48.62" E ... $ exiftool -overwrite_original -rights="Yo Yo Jyoken" DSCN0029.jpg $ exiftool DSCN0029.jpg ... Rights : Yo Yo Jyoken
1111 1111
=255, 1111 1000
=247ぐらいの差しかないじゃん