PISA Pakistan — Community CERT

← 🚩 CTF: Getting Started

26. Steganography and Covert Channel Detection for CTF Forensics

⏱ 8 min

Introduction to Steganography\nSteganography hides data inside seemingly innocent files (images, audio, PDFs). In CTF forensics a flag can be concealed in the least‑significant bits (LSB) of a PNG or within the metadata of a JPEG. Attackers also use covert channels in DNS or HTTP headers to exfiltrate information.\n\n## Common Steganography Tools\n- zsteg – detects LSB PNG/BMP patterns and supports many payloads.\n- steghide – embeds/extracting data with a passphrase.\n- outguess – works on JPEG images.\n- binwalk / foremost – extracts embedded files from raw dumps.\n- Wireshark – inspects packets for hidden tunnel traffic.\n\n## Detecting Covert Channels in PCAP\n1. Filter dns queries with unusual long subdomains (e.g., 'exfil.XXXX.hack').\n2. Look for HTTP POST bodies with base64‑like strings in the URI.\n3. Use Suricata rules to alert on known exfiltration patterns.\n\nThese techniques mirror real‑world scams where WhatsApp forwards contain altered images that hide phishing links.\n\n## Hands‑On Lab: Extracting Hidden Data\n1. Download the sample PNG from pisa.maahir.io/ctf‑forensics.\n2. Run zsteg -a image.png and note any LSB findings.\n3. If a passphrase appears, use steghide extract -sf image.png.\n4. Parse the output; the flag will be in plain text.\n\nDocument each step in your write‑up for credit.\n\n## Quick Do / Don't\n- Do verify file integrity with md5sum before analysis.\n- Don't ignore metadata – EXIF tags can also hold encoded commands.\n\n## Takeaway\nAdopt a tool‑first mindset: run zsteg, steghide, and binwalk on every image you suspect. Combine stego analysis with Wireshark packet inspection to uncover covert channels. Report suspicious images forwarded via WhatsApp or posted on OLX to the NCCIA 1799 helpline for further investigation.

← PrevNext →