| name | stego-avance |
| description | Stéganographie avancée — LSB, DCT/JPG, WAV/MP3, vidéo, réseau, polyglottes, détection forensique, et outils de dissimulation/détection |
| tags | ["stego","forensics","LSB","DCT","WAV","polyglot","detection","exfiltration"] |
| version | 1 |
Stéganographie Avancée
Guide de stéganographie offensive et détection — dissimulation et extraction de données dans tous types de médias.
1. Image — LSB (Least Significant Bit)
LSB Basique (PNG/BMP)
import numpy as np
from PIL import Image
def hide_lsb(image_path, message, output_path):
img = Image.open(image_path)
arr = np.array(img).flatten()
message += "#####"
bits = ''.join(format(ord(c), '08b') for c in message)
if len(bits) > len(arr):
raise ValueError("Message trop long")
arr[:len(bits)] = (arr[:len(bits)] & 0xFE) | [int(b) for b in bits]
result = Image.fromarray(arr.reshape(img.size[1], img.size[0], -1))
result.save(output_path)
def extract_lsb(image_path):
img = Image.open(image_path)
arr = np.array(img).flatten()
bits = [str(b & 1) for b in arr]
chars = []
for i in range(0, len(bits), 8):
byte = bits[i:i+8]
char = chr(int(''.join(byte), 2))
chars.append(char)
if ''.join(chars[-5:]) == '#####':
return ''.join(chars[:-5])
return ''.join(chars)
Palette-Based (GIF)
2. Image — Transform Domain (JPEG)
DCT (Discrete Cosine Transform)
import jpeglib
def hide_jpeg(input_jpg, message, output_jpg, quality=85):
"""JPEG stego via DCT coefficient manipulation"""
im = jpeglib.read_dct(input_jpg)
coeffs = im.Y
bits = ''.join(format(ord(c), '08b') for c in message)
idx = 0
for i in range(coeffs.shape[0]):
for j in range(coeffs.shape[1]):
for k in range(1, 64):
if idx >= len(bits):
break
if abs(coeffs[i,j,k]) <= 2:
coeffs[i,j,k] = (abs(coeffs[i,j,k]) & 0xFE) | int(bits[idx])
idx += 1
im.Y = coeffs
im.write_dct(output_jpg)
F5 Algorithm (JPEG Stego)
3. Audio Steganography
WAV (LSB on samples)
import wave
def hide_wav(wav_path, message, output_path):
with wave.open(wav_path, 'rb') as wav:
frames = bytearray(wav.readframes(wav.getnframes()))
message += '#####'
bits = ''.join(format(ord(c), '08b') for c in message)
if len(bits) > len(frames):
raise ValueError("Message trop long")
for i, b in enumerate(bits):
frames[i] = (frames[i] & 0xFE) | int(b)
with wave.open(output_path, 'wb') as out:
out.setparams(wav.getparams())
out.writeframes(bytes(frames))
Spread Spectrum
Echo Hiding
MP3 Steganography
4. Video Steganography
Frame-wise
Motion Vector Stego
5. Network Steganography
TCP/IP Headers
DNS Tunneling
ICMP Covert Channel
6. File System Steganography
Alternate Data Streams (NTFS)
# Cacher fichier dans ADS
echo "hidden message" > normal.txt:hidden.txt
type normal.txt:hidden.txt
# Lister ADS
dir /R
streams.exe -s C:\
Metadata
Polyglot Files
7. Hardware Steganography
EEPROM / Firmware
8. Détection Forensique
Statistical Analysis
stegdetect -t jopi -s 100.0 image.jpg
Outils de Détection
zsteg -a image.png
zsteg -E 'b1,bgr,lsb' image.png
stegdetect -t jopi image.jpg
stegdetect -t jopi -s 100.0 image.jpg
stegbreak -d wordlist.txt -t jpg -F image.jpg
java -jar stegsolve.jar
Entropy Analysis
binwalk -E image.png
9. Blind Steganography
Bruteforce Keys
steghide extract -sf image.jpg -p password
steghide extract -sf image.jpg -xf extracted.txt -p "password"
Known Cover & Known Message
compare cover.png stego.png diff.png
10. Tools Compendium
| Outil | Formats | Usage |
|---|
| zsteg | PNG/BMP | zsteg -a image.png |
| steghide | JPEG/BMP/WAV | steghide embed -cf cover -ef secret |
| stegsolve | Multi | GUI analysis tool |
| stegdetect | JPEG | stegdetect -t jopi image.jpg |
| outguess | JPEG | outguess -r image.jpg output.txt |
| jsteg | JPEG | jsteg hide cover.jpg secret.txt |
| binwalk | Multi | binwalk -E image.png |
| mp3stego | MP3 | mp3stego-decode |
| stegbreak | JPEG | Brute-force password |
| Aperi'Solve | Multi | Web-based analysis |
| OpenStego | Multi | GUI + CLI |
| SilentEye | Multi | GUI (image + audio) |
11. Ressources