message.wav
for rate in 8000 11025 16000 22050 32000 44100; do sox message.wav -r $rate "test_${rate}.wav"
done
for rate in 8000 11025 16000 22050 32000 44100; do sox message.wav -r $rate "test_${rate}.wav"
done
for rate in 8000 11025 16000 22050 32000 44100; do sox message.wav -r $rate "test_${rate}.wav"
done
for f in test_*.wav; do echo "Playing $f" play "$f"
done
for f in test_*.wav; do echo "Playing $f" play "$f"
done
for f in test_*.wav; do echo "Playing $f" play "$f"
done
sox input.wav output.wav -r 22050
sox input.wav output.wav -r 22050
sox input.wav output.wav -r 22050
sox input.wav -r 22050 output.wav
sox input.wav -r 22050 output.wav
sox input.wav -r 22050 output.wav
test_22050.wav
sox input.wav output.wav rate 16000
sox input.wav output.wav rate 16000
sox input.wav output.wav rate 16000
sox input.wav output.wav rate 8000
sox input.wav output.wav rate 8000
sox input.wav output.wav rate 8000
sox input.wav -r 16000 output.wav
sox input.wav -r 16000 output.wav
sox input.wav -r 16000 output.wav
sox message.wav -r 22050 output.wav
sox message.wav -r 22050 output.wav
sox message.wav -r 22050 output.wav
ls -lh message.wav
# 441000 bytes
ls -lh message.wav
# 441000 bytes
ls -lh message.wav
# 441000 bytes
for rate in 11025 16000 22050 32000 44100 88200; do sox message.wav -r $rate "test_${rate}.wav" echo "Testing ${rate}Hz..." play "test_${rate}.wav" 2>/dev/null sleep 1
done
for rate in 11025 16000 22050 32000 44100 88200; do sox message.wav -r $rate "test_${rate}.wav" echo "Testing ${rate}Hz..." play "test_${rate}.wav" 2>/dev/null sleep 1
done
for rate in 11025 16000 22050 32000 44100 88200; do sox message.wav -r $rate "test_${rate}.wav" echo "Testing ${rate}Hz..." play "test_${rate}.wav" 2>/dev/null sleep 1
done
# Extract left channel
sox stereo.wav left.wav remix 1 # Extract right channel sox stereo.wav right.wav remix 2 # Mix both channels
sox stereo.wav -c 1 mono.wav
# Extract left channel
sox stereo.wav left.wav remix 1 # Extract right channel sox stereo.wav right.wav remix 2 # Mix both channels
sox stereo.wav -c 1 mono.wav
# Extract left channel
sox stereo.wav left.wav remix 1 # Extract right channel sox stereo.wav right.wav remix 2 # Mix both channels
sox stereo.wav -c 1 mono.wav
``` Played all three. All sounded identical—just noise. I wasted 10 minutes trying different channel operations: swapping left/right, inverting one channel, isolating frequency bands per channel. Nothing. Eventually checked the file with `soxi`:
```
``` Played all three. All sounded identical—just noise. I wasted 10 minutes trying different channel operations: swapping left/right, inverting one channel, isolating frequency bands per channel. Nothing. Eventually checked the file with `soxi`:
```
``` Played all three. All sounded identical—just noise. I wasted 10 minutes trying different channel operations: swapping left/right, inverting one channel, isolating frequency bands per channel. Nothing. Eventually checked the file with `soxi`:
```
Channels: 1
Channels: 1
Channels: 1
soxi input.wav
sox message.wav -n spectrogram -o spec.png
sox message.wav -n spectrogram -o spec.png
sox message.wav -n spectrogram -o spec.png
sox noisy.wav clean.wav noisered profile.prof 0.21
sox noisy.wav clean.wav noisered profile.prof 0.21
sox noisy.wav clean.wav noisered profile.prof 0.21
sox clean.wav cleaner.wav noisered profile.prof 0.21
sox clean.wav cleaner.wav noisered profile.prof 0.21
sox clean.wav cleaner.wav noisered profile.prof 0.21
sox cleaner.wav cleanest.wav noisered profile.prof 0.21
sox cleaner.wav cleanest.wav noisered profile.prof 0.21
sox cleaner.wav cleanest.wav noisered profile.prof 0.21
sox hidden.mp3 -r 22050 test.wav
sox hidden.mp3 output.wav reverse
sox hidden.mp3 output.wav speed 0.5
sox hidden.mp3 -r 22050 test.wav
sox hidden.mp3 output.wav reverse
sox hidden.mp3 output.wav speed 0.5
sox hidden.mp3 -r 22050 test.wav
sox hidden.mp3 output.wav reverse
sox hidden.mp3 output.wav speed 0.5
ffmpeg -i hidden.mp3
# (Shows metadata in output)
ffmpeg -i hidden.mp3
# (Shows metadata in output)
ffmpeg -i hidden.mp3
# (Shows metadata in output)
exiftool hidden.mp3
exiftool hidden.mp3
exiftool hidden.mp3
sox message.wav filtered.wav lowpass 4000
play filtered.wav
sox message.wav filtered.wav lowpass 4000
play filtered.wav
sox message.wav filtered.wav lowpass 4000
play filtered.wav
soxi message.wav
# Sample Rate: 44100
# Duration: 5 seconds
soxi message.wav
# Sample Rate: 44100
# Duration: 5 seconds
soxi message.wav
# Sample Rate: 44100
# Duration: 5 seconds
sox message.wav -r 22050 output.wav
play output.wav
sox message.wav -r 22050 output.wav
play output.wav
sox message.wav -r 22050 output.wav
play output.wav
openssl enc -d -aes-256-cbc -in secret.enc -out secret.txt -k ectfba2024
openssl enc -d -aes-256-cbc -in secret.enc -out secret.txt -k ectfba2024
openssl enc -d -aes-256-cbc -in secret.enc -out secret.txt -k ectfba2024
flag{sampling_rate_lies}
# 1. Initial recon
file message.wav
soxi message.wav
play message.wav # 2. First hypothesis - lowpass
sox message.wav filtered.wav lowpass 4000
play filtered.wav
# (nope) # 3. Second hypothesis - sampling rate
sox message.wav -r 22050 output.wav
play output.wav
# (yes!) # 4. Decrypt
openssl enc -d -aes-256-cbc -in secret.enc -out secret.txt -k ectfba2024
cat secret.txt
# flag{sampling_rate_lies}
# 1. Initial recon
file message.wav
soxi message.wav
play message.wav # 2. First hypothesis - lowpass
sox message.wav filtered.wav lowpass 4000
play filtered.wav
# (nope) # 3. Second hypothesis - sampling rate
sox message.wav -r 22050 output.wav
play output.wav
# (yes!) # 4. Decrypt
openssl enc -d -aes-256-cbc -in secret.enc -out secret.txt -k ectfba2024
cat secret.txt
# flag{sampling_rate_lies}
# 1. Initial recon
file message.wav
soxi message.wav
play message.wav # 2. First hypothesis - lowpass
sox message.wav filtered.wav lowpass 4000
play filtered.wav
# (nope) # 3. Second hypothesis - sampling rate
sox message.wav -r 22050 output.wav
play output.wav
# (yes!) # 4. Decrypt
openssl enc -d -aes-256-cbc -in secret.enc -out secret.txt -k ectfba2024
cat secret.txt
# flag{sampling_rate_lies}
``` Clean, linear, reproducible. That's how you avoid getting lost.
Next Time I See Similar Conditions: Action Guidelines
Decision Criteria Summary for Using SoX I reach for SoX when: 1. **Problem hints suggest parameter tricks** - Keywords: "sounds wrong," "too fast," "can't hear," "hidden message" - File format: Standard WAV/FLAC, not exotic codecs 2. **Need systematic parameter exploration** - Test multiple sampling rates: 8k, 11k, 16k, 22k, 32k, 44k, 48k - Test channel operations: L/R split, mono conversion - Test time operations: reverse, speed changes 3. **Time is constrained** - Other unsolved problems waiting - GUI iteration feels too slow - Need to automate multiple tests 4. **Command-line environment available** - Can pipe outputs, use loops - Terminal history = automatic documentation
Decision Line for Not Using / Abandoning Midway I abandon SoX and switch tools when: 1. **5 different operations produce identical output** - Likely wrong problem domain - Switch to metadata tools (`exiftool`, `ffmpeg -i`) 2. **Visual inspection needed** - Need to see spectrogram clearly - Need to manually select waveform regions - Switch to Audacity 3. **Complex signal processing required** - FFT analysis, correlation, custom algorithms - Switch to Python (librosa, scipy) 4. **File format unsupported** - Exotic codecs, video with audio - Switch to ffmpeg for conversion first
Timing for Switching to Other Tools My typical workflow:
```
``` Clean, linear, reproducible. That's how you avoid getting lost.
Next Time I See Similar Conditions: Action Guidelines
Decision Criteria Summary for Using SoX I reach for SoX when: 1. **Problem hints suggest parameter tricks** - Keywords: "sounds wrong," "too fast," "can't hear," "hidden message" - File format: Standard WAV/FLAC, not exotic codecs 2. **Need systematic parameter exploration** - Test multiple sampling rates: 8k, 11k, 16k, 22k, 32k, 44k, 48k - Test channel operations: L/R split, mono conversion - Test time operations: reverse, speed changes 3. **Time is constrained** - Other unsolved problems waiting - GUI iteration feels too slow - Need to automate multiple tests 4. **Command-line environment available** - Can pipe outputs, use loops - Terminal history = automatic documentation
Decision Line for Not Using / Abandoning Midway I abandon SoX and switch tools when: 1. **5 different operations produce identical output** - Likely wrong problem domain - Switch to metadata tools (`exiftool`, `ffmpeg -i`) 2. **Visual inspection needed** - Need to see spectrogram clearly - Need to manually select waveform regions - Switch to Audacity 3. **Complex signal processing required** - FFT analysis, correlation, custom algorithms - Switch to Python (librosa, scipy) 4. **File format unsupported** - Exotic codecs, video with audio - Switch to ffmpeg for conversion first
Timing for Switching to Other Tools My typical workflow:
```
``` Clean, linear, reproducible. That's how you avoid getting lost.
Next Time I See Similar Conditions: Action Guidelines
Decision Criteria Summary for Using SoX I reach for SoX when: 1. **Problem hints suggest parameter tricks** - Keywords: "sounds wrong," "too fast," "can't hear," "hidden message" - File format: Standard WAV/FLAC, not exotic codecs 2. **Need systematic parameter exploration** - Test multiple sampling rates: 8k, 11k, 16k, 22k, 32k, 44k, 48k - Test channel operations: L/R split, mono conversion - Test time operations: reverse, speed changes 3. **Time is constrained** - Other unsolved problems waiting - GUI iteration feels too slow - Need to automate multiple tests 4. **Command-line environment available** - Can pipe outputs, use loops - Terminal history = automatic documentation
Decision Line for Not Using / Abandoning Midway I abandon SoX and switch tools when: 1. **5 different operations produce identical output** - Likely wrong problem domain - Switch to metadata tools (`exiftool`, `ffmpeg -i`) 2. **Visual inspection needed** - Need to see spectrogram clearly - Need to manually select waveform regions - Switch to Audacity 3. **Complex signal processing required** - FFT analysis, correlation, custom algorithms - Switch to Python (librosa, scipy) 4. **File format unsupported** - Exotic codecs, video with audio - Switch to ffmpeg for conversion first
Timing for Switching to Other Tools My typical workflow:
```
Start: SoX (3-5 minutes) ↓
Sampling rate, channels, speed, reverse → Any change? ↓ Yes ↓ No
Keep using SoX Switch to Audacity
(refine parameters) (visual inspection) ↓ ↓
Flag found? See patterns? ↓ Yes ↓ Yes ↓ No
Submit Process with Switch to metadata Python/SoX or steganography tools
Start: SoX (3-5 minutes) ↓
Sampling rate, channels, speed, reverse → Any change? ↓ Yes ↓ No
Keep using SoX Switch to Audacity
(refine parameters) (visual inspection) ↓ ↓
Flag found? See patterns? ↓ Yes ↓ Yes ↓ No
Submit Process with Switch to metadata Python/SoX or steganography tools
Start: SoX (3-5 minutes) ↓
Sampling rate, channels, speed, reverse → Any change? ↓ Yes ↓ No
Keep using SoX Switch to Audacity
(refine parameters) (visual inspection) ↓ ↓
Flag found? See patterns? ↓ Yes ↓ Yes ↓ No
Submit Process with Switch to metadata Python/SoX or steganography tools - Problem category : Listed under "Forensics" not "Audio Analysis"
- File size : 441KB for 5 seconds—that's suspiciously standard (44100Hz × 2 bytes × 1 channel × 5 sec)
- Problem description : "The message is there, you just need to hear it differently" - "Listen carefully" → Likely steganography or obscured speech
- "Hear it differently" → Parameter manipulation needed
- "Something's off" → Structural problem with the file - Effect → Change Speed
- Tracks → Stereo Track to Mono
- Effect → Equalize - Effect → Change Speed → Calculate ratio → Apply
- Repeat with different ratio - Menu navigation
- Parameter input via dialog box
- Processing time (even if short)
- Manual playback
- Mental note-taking of what I tried - Global options (-r, -c): "Interpret the data this way"
- Effects (rate, channels): "Transform the data" - Different rate values (8000, 11025, 16000…)
- Adding quality options (rate -h, rate -m)
- Checking if dither affected it
- Reading forums about sample rate conversion algorithms - 11025Hz : Very slow, deep voice, but comprehensible words
- 16000Hz : Slow, slightly lower pitch, also comprehensible
- 22050Hz : Normal speech speed—clear winner
- 32000Hz : Too fast, words blur
- 44100Hz : Original—unintelligible
- 88200Hz : Extremely fast squeaks - Audio gives "password" → Not directly the flag
- Problem gives encrypted file → Flag is inside
- Decrypt with password → Obtain actual flag
- Flag matches expected format → Confirmed - Open Audacity, look at spectrogram
- Run SoX sampling rate changes
- Try steganography tools
- Check metadata - "Wait, did I already try 16000Hz?"
- "Was this the file before or after I applied the effect?" - Solve the audio to get ectfba2024
- Submit it directly without reading "use it to decrypt" - SoX phase: Max 5 minutes. If no progress, switch.
- Audacity phase: Max 10 minutes for visual inspection.
- If nothing after 15 minutes total on audio: Problem might not be audio-focused. Re-read problem description. - Decide fast : 30 seconds to judge if normal playback is viable
- Test systematically : Loop through parameters, don't guess randomly
- Recognize dead ends : 3-5 attempts with no change = wrong direction
- Document as you go : Command history is your lab notebook
- Know the win condition : Flag format, submission requirements - FFmpeg in CTF: How to Analyze and Manipulate Audio/Video Files This article is introduced as a companion to the SoX guide, focusing on FFmpeg. It explains how to handle not only audio but also video files, which is crucial when flags are hidden within multimedia formats or require specific encoding/decoding techniques.
- dd in CTF: Disk Imaging, Extraction, and Common Challenge Patterns The second link points to a guide on the dd command. In the context of forensics, this article explores how to create disk images and extract hidden data from raw files, providing a broader perspective on data recovery beyond simple audio analysis.
- fdisk in CTF: Partition Analysis and Common Challenge Patterns The final recommendation focuses on fdisk , a tool for partition table manipulation. It teaches readers how to analyze disk structures and identify hidden partitions where secret information might be stored, rounding out the technical skills needed for comprehensive CTF forensics.