| name | video-audio-forensics |
| description | How to analyze video and audio files for hidden data, steganography, and forensic evidence. Use this skill whenever the user mentions audio files, video files, CTF forensics challenges, steganography, hidden messages, spectrograms, metadata analysis, or any task involving extracting secrets from media files. This includes .mp3, .wav, .mp4, .avi, .mkv, .flac, .ogg, and similar formats. |
Video and Audio File Forensics
This skill guides you through analyzing audio and video files to uncover hidden data, steganographic content, and forensic evidence. Common in CTF challenges and digital forensics investigations.
Quick Start Workflow
When presented with an audio or video file to analyze:
- Check file metadata - Use
exiftool or mediainfo to inspect headers and embedded data
- Examine file structure - Look for appended data, unusual file sizes, or multiple streams
- Analyze audio content - Use spectrograms, waveform analysis, and audio manipulation
- Check video streams - De-multiplex containers, examine individual tracks
- Look for steganography - Test LSB manipulation, hidden channels, encoded tones
Step 1: Metadata Analysis
Start by extracting all metadata from the file. This often reveals hidden information, creation timestamps, or embedded data.
Using exiftool
exiftool <filename>
exiftool -Comment -Description -Author <filename>
exiftool -b -Comment <filename>
Using mediainfo
mediainfo <filename>
mediainfo --Output=Text <filename>
mediainfo --Output=JSON <filename>
What to look for:
- Unusual or suspicious comments/descriptions
- Multiple authors or conflicting metadata
- Hidden text in metadata fields
- File creation/modification timestamps that don't match content
- Embedded thumbnails or attachments
Step 2: File Structure Examination
Check if the file contains appended data or unusual structure.
Check for appended data
xxd <filename> | tail -100
file <filename>
strings <filename> | grep -i "PK\|RIFF\|ID3\|FLAC"
Extract appended files
If you find data after the main file ends:
Check for steganography containers
binwalk <filename>
binwalk -e <filename>
Step 3: Audio Analysis
Spectrogram Analysis
Spectrograms reveal visual patterns in audio that may contain hidden text or images.
Using Audacity:
- Open the audio file
- Select the track
- Go to View → Spectrogram
- Look for text, QR codes, or unusual patterns
- Try different spectrogram settings (FFT size, window type)
Using Sonic Visualiser:
- Load the audio file
- Add Spectrogram view (View → Add Spectrogram)
- Adjust frequency range and time scale
- Look for hidden visual data
What to look for:
- Text embedded in frequency patterns
- QR codes or barcodes
- Unusual frequency spikes
- Patterns that appear at specific times
Audio Manipulation
Sometimes hidden messages require audio transformation to reveal.
Using Audacity:
- Reverse the track (Effect → Reverse)
- Slow down playback (Track → Track Speed/Tempo)
- Change pitch (Effect → Change Pitch)
- Invert the waveform (Effect → Invert)
Using Sox (command-line):
sox input.wav output.wav reverse
sox input.wav output.wav speed 0.5
sox input.wav output.wav pitch -12
sox input.wav output.mp3
DTMF and Morse Code Detection
Hidden messages may be encoded as tones.
Using Multimon-ng:
multimon-ng -f 44100 -a DTMF -d input.wav
multimon-ng -f 44100 -a MORSE -d input.wav
multimon-ng -f 44100 -a DTMF,MORSE,POCSAG -d input.wav
Using SoX for tone analysis:
sox input.wav -n spectrogram -o spectrogram.png
Step 4: Video Analysis
Container Analysis
Video files often contain multiple streams (video, audio, subtitles, metadata).
Using FFmpeg:
ffmpeg -i <filename>
ffprobe -v error -show_streams <filename>
ffprobe -v quiet -print_format json -show_streams <filename>
Stream Extraction
ffmpeg -i input.mp4 -c:v copy -an output.mkv
ffmpeg -i input.mp4 -c:a copy -vn output.aac
ffmpeg -i input.mp4 -map 0:1 output_audio.aac
ffmpeg -i input.mp4 -map 0:v video.mkv -map 0:a audio.aac
Video Frame Analysis
Hidden data may be in individual frames or between frames.
ffmpeg -i input.mp4 frame_%04d.png
ffmpeg -i input.mp4 -vf "select=eq(n\,100)" frame_100.png
ffmpeg -i input.mp4 -vf "select='not(mod(n\,100))'" frame_%04d.png
Check for Hidden Streams
ffprobe -v error -select_streams s -show_streams <filename>
ffprobe -v error -select_streams d -show_streams <filename>
Step 5: Steganography Detection
LSB (Least Significant Bit) Analysis
LSB steganography hides data in the least significant bits of audio/video samples.
For audio files:
For video files:
ffmpeg -i input.mp4 -vf "split[a][b];[a]channelsplit=channels=r:red.png;[b]channelsplit=channels=g:green.png" -q:v 2
Common Steganography Tools
steghide extract -sf <filename>
zsteg <filename>
Step 6: Advanced Analysis
Python with ffmpy
For programmatic analysis:
from ffmpy import FFmpeg
ff = FFmpeg(
inputs={'input.mp4': None},
outputs={'output.aac': '-vn -acodec copy'}
)
ff.run()
import subprocess
result = subprocess.run(
['ffprobe', '-v', 'quiet', '-print_format', 'json', '-show_streams', 'input.mp4'],
capture_output=True, text=True
)
import json
streams = json.loads(result.stdout)
Automated Analysis Script
Create a script to run common checks:
#!/bin/bash
FILE="$1"
echo "=== Metadata ==="
exiftool "$FILE"
echo "=== File Structure ==="
file "$FILE"
binwalk "$FILE"
echo "=== Stream Info ==="
ffprobe -v error -show_streams "$FILE"
echo "=== Strings ==="
strings "$FILE" | grep -i "flag\|secret\|hidden\|password"
Common Patterns and What to Look For
Audio Files
- Spectrogram text: Hidden messages visible in frequency visualization
- Reversed audio: Messages played backwards
- Slow/fast audio: Messages at unusual speeds
- DTMF tones: Phone keypad tones encoding data
- Morse code: Audio beeps encoding text
- Metadata: Hidden text in ID3 tags or comments
- Appended data: Files attached after audio ends
Video Files
- Multiple streams: Hidden audio or subtitle tracks
- Frame anomalies: Individual frames with hidden data
- Metadata: Embedded text or files
- Container tricks: Data in container headers
- Color channel manipulation: Hidden data in RGB channels
- Subtitle streams: Text hidden in subtitle tracks
Troubleshooting
File won't open
- Try
file <filename> to check actual file type
- Check for magic bytes:
xxd <filename> | head -1
- Try different players or tools
No obvious hidden data
- Check all metadata fields thoroughly
- Try reversing/slowing audio
- Look at spectrograms with different settings
- Check for appended data at end of file
- Use
binwalk to find embedded files
Large file, slow analysis
- Extract specific streams first
- Sample frames rather than extracting all
- Use
ffprobe for quick inspection before full analysis
References