ReSHER [stego]

ReSHER

Sherlock always wanted to be a little taller.

Recon

The image is 480x480 but based on the challenge desription we need to make the height "taller".

$ python jpegdump.py flag_there.jpg          
File: flag_there.jpg
  1 p=0x00000000    : m=ffd8 SOI
  2 p=0x00000002 d=0: m=ffe1 APP1  l=  134 e=2.456759 a=17.801527
  3 p=0x0000008a d=0: m=ffdb DQT   l=   67 e=0.114676 a=0.015625 remark: 65/65 = 1.000000
  4 p=0x000000cf d=0: m=ffdb DQT   l=   67 e=0.000000 a=0.000000 remark: 65/65 = 1.000000
  5 p=0x00000114 d=0: m=ffc2 SOF2  l=   17 e=2.549255 a=71.214286
  6 p=0x00000127 d=0: m=ffc4 DHT   l=   30 e=2.713455 a=1.851852
[...]

There is a JPEG marker SOF2 that can be seen at 0x00000114. It means "start of frame" (?). It contains information about the dimensions. I think the actual dimension should be 480x992 because SOF2 data:

<marker><payload length><payload (dimension)
FF C2 00 11 08 01 E0 01  E0 03 01 11

E0 01 = 480 E0 03 = 992

Hacky replace

cat sar2020_flag_there.jpg | python -c 'import sys; data=sys.stdin.read(); data=data.replace(b"\xE0\x01", b"\xE0\x03", 3); sys.stdout.write(data)' > out.jpg

out.jpg:

sar2020_resher1.png

Close enough ;-)

Fixed

sar2020_resher2.png

Flag

FLAG{G0Od_s3E!}