Image Steganography
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
Most CTF image stego reduces to one of these buckets:
- LSB/bit-planes (PNG/BMP)
- Metadata/comment payloads
- PNG chunk weirdness / corruption repair
- JPEG DCT-domain tools (OutGuess, etc)
- Frame-based (GIF/APNG)
๋น ๋ฅธ ์ด๊ธฐ ๋ถ์
์ฌ์ธต ์ฝํ ์ธ ๋ถ์ ์ ์ ์ปจํ ์ด๋ ์์ค์ ์ฆ๊ฑฐ๋ฅผ ์ฐ์ ํ์ธ์:
- ํ์ผ์ ๊ฒ์ฆํ๊ณ ๊ตฌ์กฐ๋ฅผ ๊ฒ์ฌํ์ธ์:
file,magick identify -verbose, format validators (e.g.,pngcheck). - ๋ฉํ๋ฐ์ดํฐ์ ๊ฐ์์ ๋ฌธ์์ด์ ์ถ์ถํ์ธ์:
exiftool -a -u -g1,strings. - ํฌํจ๋์๊ฑฐ๋ ๋ง๋ถ์ฌ์ง ์ฝํ
์ธ ๋ฅผ ํ์ธํ์ธ์:
binwalk๋ฐ ํ์ผ ๋ ๊ฒ์ฌ (tail | xxd). - ์ปจํ ์ด๋ ์ข ๋ฅ๋ณ๋ก ๋ถ๊ธฐ:
- PNG/BMP: bit-planes/LSB ๋ฐ chunk-level ์ด์ ์งํ.
- JPEG: metadata + DCT-domain ๋๊ตฌ (OutGuess/F5-style families).
- GIF/APNG: ํ๋ ์ ์ถ์ถ, ํ๋ ์ ์ฐจ๋ถ, ํ๋ ํธ ํธ๋ฆญ.
Bit-planes / LSB
๊ธฐ๋ฒ
PNG/BMP๋ ํฝ์ ์ ์ ์ฅํ๋ ๋ฐฉ์ ๋๋ฌธ์ CTF์์ ์ธ๊ธฐ๊ฐ ๋ง์ผ๋ฉฐ ๋นํธ ์์ค ์กฐ์์ด ์ฝ์ต๋๋ค. ์ ํ์ ์ธ ์จ๊น/์ถ์ถ ๋ฉ์ปค๋์ฆ์:
- ๊ฐ ํฝ์ ์ฑ๋(R/G/B/A)์ ์ฌ๋ฌ ๋นํธ๋ฅผ ๊ฐ์ง๋๋ค.
- ๊ฐ ์ฑ๋์ ์ตํ์ ๋นํธ(LSB)๋ ์ด๋ฏธ์ง์ ๊ฑฐ์ ์ํฅ์ ์ฃผ์ง ์์ต๋๋ค.
- ๊ณต๊ฒฉ์๋ ์ด๋ฌํ ์ ์์น ๋นํธ์ ๋ฐ์ดํฐ๋ฅผ ์จ๊ธฐ๋ฉฐ, ๋๋ก๋ stride, permutation ๋๋ ์ฑ๋๋ณ ์ ํ์ ์ฌ์ฉํฉ๋๋ค.
๋ฌธ์ ์์ ๊ธฐ๋ํ ๊ฒ:
- ํ์ด๋ก๋๋ ํ๋์ ์ฑ๋์๋ง ์์ต๋๋ค(์:
RLSB). - ํ์ด๋ก๋๊ฐ ์ํ ์ฑ๋์ ์์ต๋๋ค.
- ์ถ์ถ ํ ํ์ด๋ก๋๊ฐ ์์ถ๋๊ฑฐ๋ ์ธ์ฝ๋ฉ๋์ด ์์ ์ ์์ต๋๋ค.
- ๋ฉ์์ง๊ฐ ์ฌ๋ฌ plane์ ๋ถ์ฐ๋๊ฑฐ๋ plane๋ค ๊ฐ XOR์ผ๋ก ์จ๊ฒจ์ ธ ์์ ์ ์์ต๋๋ค.
์ถ๊ฐ๋ก ๋ง๋ ์ ์๋ ๋ณํ๋ค(๊ตฌํ์ ๋ฐ๋ผ ๋ค๋ฆ):
- LSB matching (๋จ์ํ ๋นํธ๋ฅผ ๋ค์ง๋ ๊ฒ์ด ์๋๋ผ ๋ชฉํ ๋นํธ์ ๋ง์ถ๊ธฐ ์ํด +/-1 ์กฐ์ ์ ํจ)
- Palette/index-based hiding (indexed PNG/GIF: ํ์ด๋ก๋๊ฐ ์์ RGB๊ฐ ์๋ ์ ์ธ๋ฑ์ค์ ์ ์ฅ๋จ)
- Alpha-only payloads (RGB ๋ณด๊ธฐ์์๋ ์์ ํ ๋ณด์ด์ง ์์)
๋๊ตฌ
zsteg
zsteg๋ PNG/BMP์ ๋ค์ํ LSB/bit-plane ์ถ์ถ ํจํด์ ์ด๊ฑฐํฉ๋๋ค:
zsteg -a file.png
Repo: https://github.com/zed-0xff/zsteg
StegoVeritas / Stegsolve
stegoVeritas: ๋ค์ํ ๋ณํ(๋ฉํ๋ฐ์ดํฐ, ์ด๋ฏธ์ง ๋ณํ, LSB ๋ณํ์ ๋ํ brute forcing)์ ์คํํฉ๋๋ค.stegsolve: ์๋ ์๊ฐ ํํฐ(์ฑ๋ ๋ถ๋ฆฌ, plane inspection, XOR ๋ฑ).
Stegsolve ๋ค์ด๋ก๋: https://github.com/eugenekolo/sec-tools/tree/master/stego/stegsolve/stegsolve
FFT-based visibility tricks
FFT๋ LSB extraction์ด ์๋๋๋ค; ์ฃผ๋ก ์ฝํ ์ธ ๊ฐ ์ฃผํ์ ๊ณต๊ฐ์ด๋ ๋ฏธ๋ฌํ ํจํด์ ์๋์ ์ผ๋ก ์จ๊ฒจ์ง ๊ฒฝ์ฐ์ ์ฌ์ฉ๋ฉ๋๋ค.
- EPFL demo: http://bigwww.epfl.ch/demo/ip/demos/FFT/
- Fourifier: https://www.ejectamenta.com/Fourifier-fullscreen/
- FFTStegPic: https://github.com/0xcomposure/FFTStegPic
CTF์์ ์์ฃผ ์ฌ์ฉ๋๋ ์น ๊ธฐ๋ฐ ๋๊ตฌ:
- AperiโSolve: https://aperisolve.com/
- StegOnline: https://stegonline.georgeom.net/
PNG internals: chunks, corruption, and hidden data
Technique
PNG์ ์ฒญํฌ ํ์์ ๋๋ค. ๋ง์ ์ฑ๋ฆฐ์ง์์ ํ์ด๋ก๋๋ ํฝ์ ๊ฐ์ด ์๋๋ผ ์ปจํ ์ด๋/์ฒญํฌ ๋ ๋ฒจ์ ์ ์ฅ๋ฉ๋๋ค:
IEND์ดํ์ ์ถ๊ฐ ๋ฐ์ดํธ (๋ง์ ๋ทฐ์ด๋ ํํ ๋ฐ์ดํธ๋ฅผ ๋ฌด์ํฉ๋๋ค)- ๋นํ์ค ancillary ์ฒญํฌ์ ํ์ด๋ก๋๊ฐ ๋ค์ด์์
- ์์๋ ํค๋๋ ํฌ๊ธฐ๋ฅผ ์จ๊ธฐ๊ฑฐ๋ ํ์๋ฅผ ๊ณ ์ฅ๋ด์ด ์์ ํ ๋๊น์ง ๋ฌธ์ ๋ฅผ ์ผ์ผํต๋๋ค
๊ฒํ ํ ์ฃผ์ ์ฒญํฌ ์์น:
tEXt/iTXt/zTXt(ํ ์คํธ ๋ฉํ๋ฐ์ดํฐ, ๋๋ก๋ ์์ถ๋จ)iCCP(ICC ํ๋กํ์ผ) ๋ฐ ๋ค๋ฅธ ancillary ์ฒญํฌ๋ค์ด ์บ๋ฆฌ์ด๋ก ์ฌ์ฉ๋จeXIf(PNG์ EXIF ๋ฐ์ดํฐ)
Triage commands
magick identify -verbose file.png
pngcheck -v file.png
ํ์ธํ ํญ๋ชฉ:
- ์ด์ํ width/height/bit-depth/colour-type ์กฐํฉ
- CRC/chunk ์ค๋ฅ (pngcheck๋ ๋ณดํต ์ ํํ ์คํ์ ์ ๊ฐ๋ฆฌํต๋๋ค)
IEND์ดํ ์ถ๊ฐ ๋ฐ์ดํฐ์ ๋ํ ๊ฒฝ๊ณ
๋ ์์ธํ chunk ๋ณด๊ธฐ๊ฐ ํ์ํ๋ฉด:
pngcheck -vp file.png
exiftool -a -u -g1 file.png
์ ์ฉํ ์ฐธ๊ณ ์๋ฃ:
- PNG specification (structure, chunks): https://www.w3.org/TR/PNG/
- ํ์ผ ํฌ๋งท ํ (PNG/JPEG/GIF corner cases): https://github.com/corkami/docs
JPEG: ๋ฉํ๋ฐ์ดํฐ, DCT-domain ๋๊ตฌ, ๊ทธ๋ฆฌ๊ณ ELA์ ํ๊ณ
๊ธฐ๋ฒ
JPEG์ raw ํฝ์ ๋ก ์ ์ฅ๋์ง ์์ผ๋ฉฐ DCT ๋๋ฉ์ธ์์ ์์ถ๋ฉ๋๋ค. ๊ทธ๋์ JPEG stego ๋๊ตฌ๋ PNG LSB ๋๊ตฌ์ ๋ค๋ฆ ๋๋ค:
- ๋ฉํ๋ฐ์ดํฐ/์ฝ๋ฉํธ ํ์ด๋ก๋๋ ํ์ผ ์์ค(์ ํธ ์ธ๊ธฐ๊ฐ ๋๊ณ ๋น ๋ฅด๊ฒ ๊ฒ์ฌ ๊ฐ๋ฅ)
- DCT-domain stego ๋๊ตฌ๋ ์ฃผํ์ ๊ณ์์ ๋นํธ๋ฅผ ์ฝ์
์ด์์์ผ๋ก๋, JPEG์ ๋ค์๊ณผ ๊ฐ์ด ์ทจ๊ธํ๋ค:
- ๋ฉํ๋ฐ์ดํฐ ์ธ๊ทธ๋จผํธ๋ฅผ ๋ด๋ ์ปจํ ์ด๋(์ ํธ ๊ฐ๋ ๋์, ๋น ๋ฅด๊ฒ ๊ฒ์ฌ ๊ฐ๋ฅ)
- ํน์ํ stego ๋๊ตฌ๊ฐ ์๋ํ๋ ์์ถ๋ ์ ํธ ๋๋ฉ์ธ(DCT ๊ณ์)
๋น ๋ฅธ ํ์ธ
exiftool file.jpg
strings -n 6 file.jpg | head
binwalk file.jpg
์ ์๋ฏธํ ์์น:
- EXIF/XMP/IPTC metadata
- JPEG ์ฝ๋ฉํธ ์ธ๊ทธ๋จผํธ (
COM) - ์ ํ๋ฆฌ์ผ์ด์
์ธ๊ทธ๋จผํธ (
APP1for EXIF,APPnfor vendor data)
์ผ๋ฐ ๋๊ตฌ
- OutGuess: https://github.com/resurrecting-open-source-projects/outguess
- OpenStego: https://www.openstego.com/
JPEG์์ steghide ํ์ด๋ก๋๋ฅผ ๋ค๋ฃจ๋ ๊ฒฝ์ฐ, stegseek ์ฌ์ฉ์ ๊ณ ๋ คํ์ธ์ (๊ธฐ์กด ์คํฌ๋ฆฝํธ๋ณด๋ค ๋ ๋น ๋ฅธ bruteforce):
Error Level Analysis
ELA๋ ์๋ก ๋ค๋ฅธ ์ฌ์์ถ ์ํฐํฉํธ๋ฅผ ๊ฐ์กฐํฉ๋๋ค; ํธ์ง๋ ์์ญ์ ์ง์ ํ ์ ์์ง๋ง ์์ฒด์ ์ผ๋ก stego detector๋ ์๋๋๋ค:
์ ๋๋ฉ์ด์ ์ด๋ฏธ์ง
๊ธฐ๋ฒ
์ ๋๋ฉ์ด์ ์ด๋ฏธ์ง์ ๊ฒฝ์ฐ, ๋ฉ์์ง๋ ๋ค์๊ณผ ๊ฐ๋ค๊ณ ๊ฐ์ ํ์ธ์:
- ๋จ์ผ ํ๋ ์์ ์์(์ฌ์), ๋๋
- ํ๋ ์์ ๊ฑธ์ณ ๋ถ์ฐ๋จ(์์ ์ค์), ๋๋
- ์ฐ์๋ ํ๋ ์์ diffํ ๋๋ง ๋ณด์
ํ๋ ์ ์ถ์ถ
ffmpeg -i anim.gif frame_%04d.png
๊ทธ๋ฐ ๋ค์ ํ๋ ์์ ์ผ๋ฐ PNG์ฒ๋ผ ์ฒ๋ฆฌํ์ธ์: zsteg, pngcheck, channel isolation.
Alternative tooling:
gifsicle --explode anim.gif(fast frame extraction)imagemagick/magickfor per-frame transforms
Frame differencing์ ์ข ์ข ๊ฒฐ์ ์ ์ ๋๋ค:
magick frame_0001.png frame_0002.png -compose difference -composite diff.png
APNG pixel-count encoding
- APNG ์ปจํ
์ด๋ ๊ฐ์ง:
exiftool -a -G1 file.png | grep -i animationorfile. - ํ๋ ์์ ์ฌํ์ด๋ฐ ์์ด ์ถ์ถ:
ffmpeg -i file.png -vsync 0 frames/frame_%03d.png. - ํ๋ ์๋ณ ํฝ์ ์๋ก ์ธ์ฝ๋ฉ๋ ํ์ด๋ก๋ ๋ณต๊ตฌ:
from PIL import Image
import glob
out = []
for f in sorted(glob.glob('frames/frame_*.png')):
counts = Image.open(f).getcolors()
target = dict(counts).get((255, 0, 255, 255)) # adjust the target color
out.append(target or 0)
print(bytes(out).decode('latin1'))
์ ๋๋ฉ์ด์ ์ฑ๋ฆฐ์ง์์๋ ๊ฐ ํ๋ ์์์ ํน์ ์์ ๊ฐ์๋ฅผ ๊ฐ ๋ฐ์ดํธ๋ก ์ธ์ฝ๋ฉํ ์ ์์ผ๋ฉฐ, ๊ทธ ๊ฐ์๋ค์ ์ด์ด๋ถ์ด๋ฉด ๋ฉ์์ง๊ฐ ์ฌ๊ตฌ์ฑ๋ฉ๋๋ค.
๋น๋ฐ๋ฒํธ๋ก ๋ณดํธ๋ ์๋ฒ ๋ฉ
ํฝ์ ์์ค์ ์กฐ์์ด ์๋๋ผ passphrase๋ก ๋ณดํธ๋ embedding์ด๋ผ๊ณ ์์ฌ๋๋ค๋ฉด, ๋ณดํต ์ด๊ฒ์ด ๊ฐ์ฅ ๋น ๋ฅธ ๊ฒฝ๋ก์ ๋๋ค.
steghide
๋ค์ ํ์์ ์ง์ํฉ๋๋ค: JPEG, BMP, WAV, AU. ๋ํ embed/extract encrypted payloads๊ฐ ๊ฐ๋ฅํฉ๋๋ค.
steghide info file
steghide extract -sf file --passphrase 'password'
I donโt have access to the repository files. Please paste the contents of src/stego/images/README.md (or attach it) and I will translate the relevant English text to Korean while preserving all markdown/html tags, links, paths and code exactly as requested.
stegcracker file.jpg wordlist.txt
์ ์ฅ์: https://github.com/Paradoxis/StegCracker
stegpy
์ง์: PNG/BMP/GIF/WebP/WAV.
์ ์ฅ์: https://github.com/dhsdshdhk/stegpy
์ฐธ๊ณ ์๋ฃ
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


