คลัง
stego

MP3 Steganography

MP3 เป็น lossy audio ที่ซ่อนข้อมูลต่างจาก WAV — เครื่องมือเฉพาะอย่าง MP3Stego ฝังใน process การ encode, ID3 tag เก็บ metadata, หรือแปลงเป็น WAV แล้วดู spectrogram บทนี้ลงลึกเทคนิค MP3 โดยเฉพาะและการเชื่อมกับเทคนิค audio ทั่วไป

IntermediateAdvanced#mp3#audio#stego#mp3stego#id3#spectrogram#ctf

1. MP3 ต่างจาก WAV อย่างไร

MP3 เป็น lossy (บีบอัดทิ้งข้อมูล) คล้าย JPEG ในฝั่งภาพ — LSB ตรงๆ ใช้ไม่ได้ เพราะข้อมูลถูกบีบ เทคนิคหลักคือ tool เฉพาะ (MP3Stego ที่ฝังตอน encode), ID3 metadata, ข้อมูลต่อท้าย/ฝัง, และ spectrogram (แปลงเป็น WAV ก่อน) ถ้าโจทย์ให้ MP3 มา มักเป็นหนึ่งในนี้

อย่ารัน WavSteg/zsteg กับ MP3 — ใช้ไม่ได้ ถ้าจะดู spectrogram/LSB ต้อง ffmpeg -i audio.mp3 audio.wav แปลงเป็น WAV ก่อน (แต่ LSB เดิมหายเพราะ lossy — spectrogram ยังเห็น)

2. Triage MP3

ตรวจเบื้องต้นLinux
file audio.mp3
exiftool audio.mp3              # ID3 tags (title/artist/comment) — flag อาจอยู่
strings audio.mp3 | grep -iE 'flag|ctf'
binwalk audio.mp3              # ไฟล์ฝัง/ต่อท้าย
binwalk -e audio.mp3

# ดู ID3 เต็ม
id3v2 -l audio.mp3
ffprobe audio.mp3              # metadata + stream info
ID3 tag (comment/lyrics) เป็นที่ซ่อน flag ง่ายๆ ที่พบบ่อย — เช็ค exiftool ก่อนเสมอ

3. MP3Stego — เครื่องมือเฉพาะ

MP3Stego ฝังข้อมูล (เข้ารหัสด้วย passphrase) ระหว่าง process การ encode WAV→MP3 ถ้าโจทย์ใบ้ถึง MP3Stego หรือมี passphrase ให้ ใช้ Decode ดึงออก

MP3Stego decodeWindows
# MP3Stego (Windows tool, รันผ่าน wine ได้)
Decode.exe -X -P passphrase audio.mp3
# -X = ดึงข้อมูลที่ซ่อน, -P = passphrase
# ผลได้ไฟล์ audio.mp3.txt (ข้อมูลที่ซ่อน)

# ผ่าน wine บน Linux
wine Decode.exe -X -P passphrase audio.mp3
passphrase มาจาก challenge/ชื่อไฟล์/คำใบ้; ผลออกมาเป็น .txt

4. Spectrogram (แปลงเป็น WAV ก่อน)

MP3 → WAV → spectrogramLinux
# แปลงเป็น WAV
ffmpeg -i audio.mp3 audio.wav
# สร้าง spectrogram
sox audio.wav -n spectrogram -o spectro.png
# หรือเปิดใน Sonic Visualiser ดู spectrogram (ดูหัวข้อ stego-wav)
เทคนิค audio ทั่วไป (spectrogram/DTMF/Morse/reverse) ใช้ได้หลังแปลงเป็น WAV — ดูรายละเอียดในหัวข้อ WAV Steganography
  • spectrogram — ภาพ/ข้อความในความถี่ (พบบ่อย)
  • DTMF/Morse — multimon-ng หลังแปลง WAV
  • reversed/speed — Audacity
  • ดูหัวข้อ WAV Steganography สำหรับรายละเอียดเทคนิค audio ทั้งหมด

5. Workflow

  1. 1exiftool + id3v2 — ID3 tag (flag ตรงๆ บ่อย)
  2. 2strings + binwalk — append/ฝัง
  3. 3MP3Stego decode (ถ้าใบ้ถึง / มี passphrase)
  4. 4ffmpeg → WAV → spectrogram (Sonic Visualiser)
  5. 5เทคนิค audio อื่น (DTMF/Morse/reverse) ตามหัวข้อ WAV

6. Quick Reference

  • MP3 = lossy → LSB ตรงๆ ใช้ไม่ได้
  • เริ่ม: exiftool + id3v2 (ID3 tag), strings, binwalk
  • MP3Stego: Decode.exe -X -P passphrase audio.mp3
  • spectrogram: ffmpeg → wav → sox/Sonic Visualiser
  • เทคนิค audio อื่น → ดูหัวข้อ WAV Steganography
  • ID3 comment/lyrics = จุดซ่อน flag ง่ายๆ ที่พบบ่อย

🧭 จับมือทำทีละขั้น (มีแค่ Kali) + ถ้าติดไปไหนต่อ

สมมติโจทย์แจกไฟล์ .mp3 มา มีแค่ Kali เปล่าๆ — MP3 เป็น lossy จึงต่างจาก WAV ทำตามนี้ทีละขั้น เริ่มจากจุดที่ตรวจง่ายสุดก่อน

  1. 1พิมพ์ file audio.mp3 ยืนยันชนิดไฟล์จริง
  2. 2พิมพ์ exiftool audio.mp3 และ id3v2 -l audio.mp3 — เช็ค ID3 tag (title/artist/comment/lyrics) เพราะ flag ซ่อนตรงนี้บ่อย
  3. 3พิมพ์ strings audio.mp3 | grep -iE 'flag|ctf' และ binwalk audio.mp3 — เช็คข้อความ/ไฟล์ต่อท้าย
  4. 4ถ้าโจทย์มีคำใบ้เรื่อง passphrase หรือกล่าวถึง MP3Stego ให้ลอง wine Decode.exe -X -P passphrase audio.mp3
  5. 5ถ้าไม่ใบ้อะไรเป็นพิเศษ แปลงเป็น WAV ก่อน: ffmpeg -i audio.mp3 audio.wav
  6. 6สร้าง spectrogram: sox audio.wav -n spectrogram -o spectro.png แล้วเปิดดูว่ามีข้อความ/รูปซ่อนในความถี่ไหม
  7. 7ถ้า spectrogram เรียบเฉย ลองฟังไฟล์ดูว่ามีเสียง beep (Morse), เสียงกดปุ่ม (DTMF), หรือเสียงกลับด้านไหม
  8. 8ถ้ามีเสียงแปลก ลอง multimon-ng -a DTMF -t wav audio.wav หรือ multimon-ng -a MORSE_CW -t wav audio.wav
  9. 9ถ้ายังไม่เจอทุกทาง ให้กลับไปดูว่า MP3 นี้ถูกแปลงมาจาก stego WAV เดิมหรือเปล่า (คุณภาพเสียง/comment ใบ้), หรือ flag อาจซ่อนใน ID3 frame แปลกๆ ที่ id3v2 ไม่แสดง
ไล่ตรวจ MP3 — ติดไปไหนต่อ
เจอ flag ใน ID3 ไหม?
✅ เจอ→ จบ ได้ flag
❌ ไม่เจอ→ เช็ค append/binwalk ต่อ
เจอไฟล์ฝังไหม?
✅ เจอ→ extract หา flag จบ
❌ ไม่เจอ→ มีใบ้ MP3Stego ไหม?
มีใบ้ MP3Stego/passphrase ไหม?
✅ มีใบ้→ Decode.exe -X -P passphrase (ผ่าน wine)
❌ ไม่มีใบ้→ แปลงเป็น WAV แล้วดู spectrogram
เห็นข้อความใน spectrogram ไหม?
✅ เห็น→ อ่านตัวอักษรเป็น flag จบ
❌ ไม่เห็น→ ฟังเสียง หา DTMF/Morse/reverse
multimon-ng (DTMF/Morse) / ฟัง reverse
ขั้นตอน/งานเครื่องมือใน Kaliติดตั้งเพิ่ม (ถ้าไม่มี)เครื่องมือออนไลน์
เช็ค ID3 tagexiftool, id3v2sudo apt install id3v2-
เช็คไฟล์ฝัง/ต่อท้ายbinwalk, stringssudo apt install binwalkaperisolve.com
ถอด MP3Stegowine + Decode.exesudo apt install wine; โหลด MP3Stego จาก petitcolas.net-
แปลงเป็น WAVffmpegsudo apt install ffmpeg-
ดู spectrogramsox, sonic-visualisersudo apt install sox sonic-visualiser-
ถอด DTMF/Morsemultimon-ngsudo apt install multimon-ng-
วิเคราะห์ waveform แบบละเอียดaudacitysudo apt install audacity-
🚑 ถ้าตันสนิท ลองท่าถัดไป: stego-wav สำหรับเทคนิค audio แบบเต็ม (spectrogram/DTMF/Morse/LSB) หลังแปลงเป็น WAV, exiftool/metadata ถ้ายังไม่เช็ค ID3 ให้ทั่ว, binwalk ถ้ายังไม่เช็คไฟล์ต่อท้าย — MP3 เป็น lossy ดังนั้นอย่าคาดหวัง LSB ตรงๆ เหมือน WAV

โน้ตของฉัน

ยังไม่มีโน้ตสำหรับหัวข้อนี้