### Install jsteg locally Source: https://www.aperisolve.com/wiki/tools/jsteg Install the jsteg tool using the Go toolchain. ```bash $ go install lukechampine.com/jsteg/cmd/jsteg@latest ``` -------------------------------- ### Install binwalk locally Source: https://www.aperisolve.com/wiki/tools/binwalk Install binwalk on Debian-based systems using apt. ```bash $ apt install binwalk ``` -------------------------------- ### Install ExifTool locally Source: https://www.aperisolve.com/wiki/tools/exiftool Install the ExifTool package on Debian-based systems using apt. ```bash $ apt install libimage-exiftool-perl ``` -------------------------------- ### Install OutGuess locally Source: https://www.aperisolve.com/wiki/tools/outguess Command to install the OutGuess package on Debian-based systems. ```bash $ apt install outguess ``` -------------------------------- ### Install OpenStego from .deb or .jar Source: https://www.aperisolve.com/wiki/tools/openstego Installation command for the .deb package, with an alternative to run the .jar file. Java is required. ```bash $ sudo dpkg -i openstego_0.8.6-1_all.deb # or: java -jar openstego.jar ``` -------------------------------- ### Installing steghide locally Source: https://www.aperisolve.com/wiki/tools/steghide Command to install steghide on Debian-based systems. ```bash $ apt install steghide ``` -------------------------------- ### Install stegsnow Source: https://www.aperisolve.com/wiki/tools/stegsnow Install the tool on Debian-based systems using the snow package. ```bash $ sudo apt install stegsnow # Kali/Debian; part of the "snow" package ``` -------------------------------- ### Sample file output examples Source: https://www.aperisolve.com/wiki/tools/file Example outputs from the 'file' command showing typical identifications: PNG image data, JPEG image data, Zip archive data, and 'data' when no signature matches. ```text PNG image data, 800 x 600, 8-bit/color RGBA, non-interlaced JPEG image data, JFIF standard 1.01, resolution (DPI), density 72x72 Zip archive data, at least v2.0 to extract data ``` -------------------------------- ### Example zsteg output lines Source: https://www.aperisolve.com/wiki/tools/zsteg Sample output showing the encoding notation for each detected payload. Each line starts with the encoding (e.g., b1,r,lsb,xy) followed by the detected content type and data. ```text b1,r,lsb,xy .. text: "hidden message" b1,rgb,lsb,xy .. file: Zip archive data b2,g,msb,yx .. text: "AAAAAAAA" ``` -------------------------------- ### Install poppler-utils Source: https://www.aperisolve.com/wiki/tools/pdfinfo Installs the poppler-utils package, which provides pdfinfo along with pdftotext, pdfimages, and pdftk-style helpers. ```bash $ apt install poppler-utils ``` -------------------------------- ### Install stegseek on Debian/Ubuntu Source: https://www.aperisolve.com/wiki/tools/stegseek Downloads the .deb package from the releases page and installs it with apt. Requires wget and sudo. ```bash $ # Debian/Ubuntu: grab the .deb from the releases page $ wget https://github.com/RickdeJager/stegseek/releases/latest/download/stegseek.deb $ sudo apt install ./stegseek.deb ``` -------------------------------- ### Brainfuck code example Source: https://www.aperisolve.com/wiki/techniques/text A sample Brainfuck program that outputs 'Hello World!'. ```brainfuck brainfuck> ++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>++.>+.+++++++..+++. ``` -------------------------------- ### Install GraphicsMagick locally Source: https://www.aperisolve.com/wiki/tools/identify Installs the GraphicsMagick flavor used by Aperi'Solve, including the ImageMagick compatibility layer. ```bash $ apt install graphicsmagick graphicsmagick-imagemagick-compat ``` -------------------------------- ### Install ImageMagick locally Source: https://www.aperisolve.com/wiki/tools/identify Installs the standard ImageMagick package on Debian-based systems. ```bash $ apt install imagemagick ``` -------------------------------- ### Install and run PCRT locally Source: https://www.aperisolve.com/wiki/tools/pcrt Commands to clone the PCRT repository and run the tool against a specific image file. ```bash $ git clone https://github.com/sherlly/PCRT $ python PCRT.py -i image.png ``` -------------------------------- ### Install foremost locally Source: https://www.aperisolve.com/wiki/tools/foremost Install the foremost package using the apt package manager on Debian-based systems. ```bash $ apt install foremost ``` -------------------------------- ### Install zsteg via gem Source: https://www.aperisolve.com/wiki/tools/zsteg Installation command for the zsteg Ruby tool using the gem package manager. ```bash $ gem install zsteg ``` -------------------------------- ### Example identify output Source: https://www.aperisolve.com/wiki/tools/identify A sample output showing the format, geometry, depth, colorspace, and channel statistics of an image. ```text Image: image.png Format: PNG (Portable Network Graphics) Geometry: 800x600 Depth: 8 bits-per-pixel component Colorspace: sRGB Channel Statistics: ... ``` -------------------------------- ### Install pngcheck via apt Source: https://www.aperisolve.com/wiki/tools/pngcheck Installs pngcheck on Debian-based systems using the apt package manager. ```bash $ apt install pngcheck ``` -------------------------------- ### Extract sample LSB data with stegolsb wavsteg Source: https://www.aperisolve.com/wiki/cheatsheet/audio Extract hidden data from the least significant bits of a WAV file. The example reads 1000 bytes from 1 LSB. Requires the stego-lsb package (pip install stego-lsb). Vary -n (bits per sample) and -b (byte count) if the output is garbage. ```bash $ stegolsb wavsteg -r -i audio.wav -o out.bin -n 1 -b 1000 # 1 LSB, 1000 bytes $ file out.bin ``` -------------------------------- ### Example audit.txt output Source: https://www.aperisolve.com/wiki/tools/foremost Foremost generates an audit.txt file summarizing the carved files, their sizes, and their offsets within the source image. ```text Num Name (bs=512) Size File Offset Comment 0: 00000105.zip 1 KB 54187 1: 00000000.jpg 52 KB 0 ``` -------------------------------- ### Example pdfid output Source: https://www.aperisolve.com/wiki/tools/pdfid The output displays a table of keyword counts found within the PDF document. ```text PDFiD 0.2.8 document.pdf PDF Header: %PDF-1.7 obj 8 endobj 8 stream 2 endstream 2 /JS 1 /JavaScript 1 /OpenAction 1 /Launch 0 /EmbeddedFile 1 /URI 0 ``` -------------------------------- ### Example pdfinfo output Source: https://www.aperisolve.com/wiki/tools/pdfinfo Sample output from pdfinfo showing metadata fields such as Title, Author, Producer, CreationDate, Pages, Encrypted, Page size, and PDF version. ```text Title: Annual Report Author: alice Producer: LibreOffice 7.4 CreationDate: Sat Jul 5 12:00:00 2025 UTC Pages: 3 Encrypted: no Page size: 612 x 792 pts (letter) PDF version: 1.7 ``` -------------------------------- ### Reproduce color remapping locally with Python (Pillow and NumPy) Source: https://www.aperisolve.com/wiki/tools/color_remapping Use this snippet to replicate Aperi'Solve's color remapping locally. It loads an image, converts it to RGB, creates a random 256-entry lookup table, and saves the remapped result. Run it multiple times to get different random maps; each run produces a new mapping. ```python import numpy as np from PIL import Image img = np.array(Image.open("image.png").convert("RGB")) lut = np.random.randint(0, 256, 256, dtype=np.uint8) Image.fromarray(lut[img]).save("remapped.png") ``` -------------------------------- ### Example strings output from a CTF image Source: https://www.aperisolve.com/wiki/tools/strings Sample output showing readable islands: chunk names, editor signature, base64 blob, and a flag. Long alphanumeric blobs ending in '=' are likely base64; text near the end often sits after image data. ```text IHDR Adobe Photoshop 2024 XML:com.adobe.xmp aHR0cHM6Ly9leGFtcGxlLmNvbQ== CTF{str1ngs_f1rst_alw4ys} ``` -------------------------------- ### Example pngcheck verbose output for a healthy PNG Source: https://www.aperisolve.com/wiki/tools/pngcheck Shows the expected output for a valid PNG: IHDR, IDAT, and IEND chunks with offsets and lengths, ending with 'No errors detected'. The compression percentage is also reported. ```text File: image.png (54321 bytes) chunk IHDR at offset 0x0000c, length 13 800 x 600 image, 32-bit RGB+alpha, non-interlaced chunk IDAT at offset 0x00025, length 54000 chunk IEND at offset 0x0d33d, length 0 No errors detected in image.png (3 chunks, 77.4% compression). ``` -------------------------------- ### Triage: capinfos and tshark protocol/conversation stats Source: https://www.aperisolve.com/wiki/cheatsheet/network Use these commands to get a quick overview of a capture file: size, packet count, time range, protocol hierarchy, and TCP conversations. The protocol hierarchy (io,phs) shows what protocols are present, and conv,tcp lists endpoints and byte counts. ```bash $ capinfos capture.pcap # size, packet count, time range $ tshark -r capture.pcap -q -z io,phs # protocol hierarchy — what's in here? $ tshark -r capture.pcap -q -z conv,tcp # TCP conversations (endpoints, bytes) ``` -------------------------------- ### Decode QR or barcode with zbarimg Source: https://www.aperisolve.com/wiki/techniques/images Use zbarimg --raw to decode QR or barcode from extracted image. Install zbar-tools. Upscale tiny codes first with convert. ```bash zbarimg --raw out.png ``` -------------------------------- ### PCRT log output example Source: https://www.aperisolve.com/wiki/tools/pcrt Example of the log output generated by PCRT when it detects and repairs an IHDR CRC error. ```text Error IHDR CRC found at offset 0x1d Chunk crc: 00000000, Correct crc: 575943df Found correct dimensions via exhaustive search: 800x600 ``` -------------------------------- ### Extract steghide payloads Source: https://www.aperisolve.com/wiki/cheatsheet/image Attempt to extract data from JPEG images using steghide, starting with an empty password. ```bash $ steghide info image.jpg # is there a steghide payload? $ steghide extract -sf image.jpg -p '' # ALWAYS try the empty password first $ steghide extract -sf image.jpg -p 'guess' ``` -------------------------------- ### Carve data manually with dd Source: https://www.aperisolve.com/wiki/techniques/files-archives Use dd to extract a payload from a target file starting at a known offset. ```bash $ dd if=target of=payload.bin bs=1 skip=$OFFSET ``` -------------------------------- ### Example pngcheck output showing a CRC error Source: https://www.aperisolve.com/wiki/tools/pngcheck Shows the output when a chunk has a CRC error, including the computed and expected CRC values. This indicates edited chunk data without recomputing the CRC. ```text chunk IHDR at offset 0x0000c, length 13 CRC error in chunk IHDR (computed 575943df, expected 12345678) ERRORS DETECTED in image.png ``` -------------------------------- ### Run jpseek with expect Source: https://www.aperisolve.com/wiki/tools/jpseek Aperi'Solve drives jpseek with expect because it has no password flag and prompts interactively. The command takes the input image and output file, then answers the passphrase prompt with the upload password or an empty line. ```bash $ jpseek image.jpg jpseek.out Passphrase: ``` -------------------------------- ### Convert lossless WebP to PNG with dwebp Source: https://www.aperisolve.com/wiki/techniques/images Convert lossless WebP to PNG before running PNG toolkit. Use dwebp with -o to specify output file. ```bash dwebp file.webp -o file.png ``` -------------------------------- ### Crack PDF and Office passwords with john Source: https://www.aperisolve.com/wiki/cheatsheet/brute-force Convert PDF and Office files to john hashes, then crack with rockyou. Use john --show to print the cracked password. ```bash $ pdf2john secret.pdf > h && john --wordlist=rockyou.txt h $ office2john secret.docx > h && john --wordlist=rockyou.txt h $ john --show h # print the cracked password ``` -------------------------------- ### Upscale and decode QR with convert and zbarimg Source: https://www.aperisolve.com/wiki/techniques/images Upscale a tiny QR code before decoding. Use convert to resize 400% and then zbarimg to decode. ```bash convert out.png -resize 400% big.png && zbarimg big.png ``` -------------------------------- ### Upscale WebP with nearest-neighbor using magick Source: https://www.aperisolve.com/wiki/techniques/images Upscale WebP to reveal faint patterns using nearest-neighbor filter. Use -filter point and -resize 400% to avoid destroying LSB data. ```bash magick file.webp -filter point -resize 400% out.png ``` -------------------------------- ### Probe video container streams Source: https://www.aperisolve.com/wiki/techniques/video Use these commands to identify streams, codecs, and metadata before performing pixel-level analysis. ```bash $ ffprobe -hide_banner file.mp4 # streams, codecs, durations $ mediainfo file.mkv # human-readable track table $ exiftool -a -u -g1 file.mp4 # container metadata + tags ``` -------------------------------- ### Build jphs from source Source: https://www.aperisolve.com/wiki/tools/jpseek The jphs source bundles its own libjpeg (jpeg-8a) which must be built first. The build produces ./jphide and ./jpseek. Aperi'Solve's Docker image builds it this way with small patches to the Makefile and jpseek.c. ```bash $ git clone https://github.com/h3xx/jphs $ cd jphs/jpeg-8a && ./configure && make && cd .. $ make all # produces ./jphide and ./jpseek ``` -------------------------------- ### Identify the container Source: https://www.aperisolve.com/wiki/methodology Initial commands to determine the file type and check for unexpected file size. ```bash $ file target $ ls -lah target # is the file bigger than it looks? ``` -------------------------------- ### Check PNG structure and inflate IDAT Source: https://www.aperisolve.com/wiki/cheatsheet/image Verify PNG structure or manually inflate raw IDAT chunks. ```bash $ pngcheck -vtp7f image.png # structure, CRCs, text chunks $ zlib-flate -uncompress < idat.bin # manually inflate a raw IDAT if needed ``` -------------------------------- ### Crack a passphrase with stegseek using rockyou.txt Source: https://www.aperisolve.com/wiki/tools/stegseek Runs stegseek against file.jpg with the rockyou.txt wordlist. On a hit, prints the passphrase and writes the embedded file to file.jpg.out. Use -wl to specify a larger wordlist if rockyou fails. ```bash $ stegseek file.jpg /usr/share/wordlists/rockyou.txt ``` -------------------------------- ### Run binwalk extraction Source: https://www.aperisolve.com/wiki/tools/binwalk Use the --matryoshka flag to recursively extract all recognized signatures from a file. ```bash $ binwalk --matryoshka -e image.png ``` -------------------------------- ### Analyze TIFF metadata with exiftool and tiffinfo Source: https://www.aperisolve.com/wiki/techniques/files-archives Inspect extra IFDs and tags in TIFF files. ```bash exiftool -a -u -g1 file.tif tiffinfo ``` -------------------------------- ### Split streams with tcpflow Source: https://www.aperisolve.com/wiki/techniques/files-archives Use tcpflow to split streams when standard export methods fail, then use binwalk or foremost on the results. ```bash tcpflow -r cap.pcap ``` -------------------------------- ### Initial Text Inspection Commands Source: https://www.aperisolve.com/wiki/cheatsheet/text Use these commands to compare byte counts, reveal hidden control characters, and inspect raw code points in a file. ```bash $ wc -c file.txt && wc -m file.txt # bytes vs characters — a gap = hidden code points $ cat -A file.txt # $ at line ends, ^I tabs, M-… high bytes $ hexdump -C file.txt | less # see the raw code points ``` -------------------------------- ### Inspect image metadata with exiftool Source: https://www.aperisolve.com/wiki/tools/exiftool Use this command to display all metadata tags, including duplicates and unknown tags, grouped by metadata block. ```bash $ exiftool -a -u -g1 image.jpg ``` -------------------------------- ### Run pngcheck with verbose output Source: https://www.aperisolve.com/wiki/tools/pngcheck Use -v to list every chunk with its offset and length. Non-PNG uploads are reported as unsupported; pngcheck only handles PNG, JNG, and MNG files. ```bash $ pngcheck -v image ``` -------------------------------- ### Try common passwords with steghide Source: https://www.aperisolve.com/wiki/cheatsheet/brute-force Always try the empty password first, then the filename and clue text. The loop breaks on the first successful extraction. ```bash $ steghide extract -sf image.jpg -p '' # always try this $ for p in "$(basename image.jpg .jpg)" "$(cat clue.txt)"; do \ steghide extract -sf image.jpg -p "$p" && break; done ``` -------------------------------- ### Run zsteg on an image Source: https://www.aperisolve.com/wiki/tools/zsteg Basic invocation without extra flags. Scans the most common bit/channel combinations and prints anything that looks like text, a known file signature, or a high entropy region. ```bash $ zsteg image.png ``` -------------------------------- ### XOR Analysis and Decoding Commands Source: https://www.aperisolve.com/wiki/techniques/encodings Use xortool to identify key length and candidate keys, or a Python one-liner to perform single-byte XOR decryption. ```bash $ xortool -c 00 blob.bin # find key length + candidate keys $ python3 -c "print(bytes(b^0x2a for b in open('blob.bin','rb').read()))" # single-byte XOR ``` -------------------------------- ### Run pdfinfo on a PDF file Source: https://www.aperisolve.com/wiki/tools/pdfinfo Executes pdfinfo on document.pdf to display its metadata. The output is returned as a table of non-blank lines. ```bash $ pdfinfo document.pdf ``` -------------------------------- ### Process WebP, TIFF, and BMP Source: https://www.aperisolve.com/wiki/cheatsheet/image Convert or inspect alternative image formats for hidden data. ```bash $ dwebp image.webp -o image.png # convert, then treat as PNG $ exiftool -a -u -g1 image.tiff # TIFF hides plenty in tags $ magick image.bmp image.png # normalise odd BMP variants ``` -------------------------------- ### Decode FSK/modem with minimodem Source: https://www.aperisolve.com/wiki/techniques/audio Decodes frequency-shift keying signals. Try common bauds (300, 1200, 2400, RTTY 45.45); if none work, read the two tone frequencies from Audacity's Plot Spectrum and pass them explicitly with -M and -S. ```bash minimodem -r -8 -f file.wav 1200 ``` ```bash minimodem -r 100 -M 18000 -S 1952 -f file.wav ``` -------------------------------- ### Check and decompress rockyou wordlist Source: https://www.aperisolve.com/wiki/cheatsheet/brute-force Verify the default CTF wordlist exists and decompress it if it is still gzipped. ```bash $ ls -la /usr/share/wordlists/rockyou.txt # the default CTF list $ gunzip -k /usr/share/wordlists/rockyou.txt.gz # if it's still gzipped ``` -------------------------------- ### Decode common encodings via CLI Source: https://www.aperisolve.com/wiki/techniques/encodings Use these command-line utilities to decode Base64, Base32, Hex, and Binary strings. ```bash $ echo 'aGVsbG8=' | base64 -d # base64 $ echo 'NBSWY3DP' | base32 -d # base32 $ echo '68656c6c6f' | xxd -r -p # hex -> bytes $ echo '01101000 01101001' | perl -lpe '$_=pack"B*",join"",split" "' # binary -> ASCII ``` -------------------------------- ### Analyze and extract from PNG/BMP Source: https://www.aperisolve.com/wiki/cheatsheet/image Use zsteg to detect and extract data hidden in bit/channel combinations. ```bash $ zsteg image.png # common bit/channel combos $ zsteg -a image.png # ALL combos: every channel, bit, order $ zsteg -E 'b1,rgb,lsb,xy' image.png > out.bin # extract one combo to a file $ file out.bin && binwalk out.bin # what did we pull? ``` -------------------------------- ### Extract files and strings from pcap Source: https://www.aperisolve.com/wiki/cheatsheet/network Search for interesting strings, carve embedded files with binwalk, export HTTP and SMB objects, and carve by signature with foremost. The export-objects command supports HTTP, SMB, TFTP, and IMF. ```bash $ strings -n 8 capture.pcap | grep -iE 'flag|CTF|pass|user' $ binwalk -e capture.pcap # embedded files in payloads $ tshark -r capture.pcap --export-objects http,out/ # carve HTTP objects $ tshark -r capture.pcap --export-objects smb,out/ # SMB / TFTP / IMF too $ foremost -i capture.pcap -o carved/ # carve by signature ``` -------------------------------- ### Generate spectrograms with sox and ffmpeg Source: https://www.aperisolve.com/wiki/cheatsheet/audio Quickly create a spectrogram to look for text or QR codes drawn in the frequency domain. The first sox command is a quick version; the second increases resolution with -X 500 and -y 1025. The ffmpeg command uses showspectrumpic to produce a 1280x720 image. ```bash $ sox audio.wav -n spectrogram -o spec.png # quick spectrogram $ sox audio.wav -n spectrogram -X 500 -y 1025 -o spec.png # higher resolution $ ffmpeg -i audio.wav -lavfi showspectrumpic=s=1280x720 spec.png ``` -------------------------------- ### Extract all images from ICO with icotool Source: https://www.aperisolve.com/wiki/techniques/images Extract all images from an ICO container using icotool -x. Check each extracted image for hidden data. ```bash icotool -x file.ico ``` -------------------------------- ### Inspect binary sections with readelf and objdump Source: https://www.aperisolve.com/wiki/techniques/files-archives Examine specific sections of an ELF binary for hidden data. ```bash readelf -p .comment file objdump -s -j .rodata file ``` -------------------------------- ### Extract credentials from HTTP and FTP Source: https://www.aperisolve.com/wiki/cheatsheet/network Display HTTP request hosts and URIs, extract HTTP basic authentication credentials, and find FTP PASS commands. The filters target http.request, http.authbasic, and ftp.request.command==PASS. ```bash $ tshark -r capture.pcap -Y http.request -T fields -e http.host -e http.request.uri $ tshark -r capture.pcap -Y 'http.authbasic' -T fields -e http.authbasic $ tshark -r capture.pcap -Y 'ftp.request.command==PASS' -T fields -e ftp.request.arg ``` -------------------------------- ### Inspect Office Documents and APKs Source: https://www.aperisolve.com/wiki/cheatsheet/files Commands to extract and search through ZIP-based document formats like DOCX or APK files. ```bash $ 7z x report.docx -o docx/ # media/, embeddings/, and XML parts $ grep -rInE 'flag|CTF|http' docx/ $ unzip -o app.apk -d apk/ && cat apk/AndroidManifest.xml ``` -------------------------------- ### Run foremost on an image Source: https://www.aperisolve.com/wiki/tools/foremost Use the -i flag to specify the input image and the -o flag to define the output directory for carved files. ```bash $ foremost -o output/ -i image.png ``` -------------------------------- ### Identify image format Source: https://www.aperisolve.com/wiki/cheatsheet/image Determine the actual file format and view metadata using standard identification tools. ```bash $ file image.* $ identify -verbose image.png | head -n 40 # GraphicsMagick/ImageMagick ``` -------------------------------- ### Decode Base-N and Hex via CLI Source: https://www.aperisolve.com/wiki/cheatsheet/encodings Use standard Linux utilities to decode Base64, Base32, and hex strings. The xxd utility is useful for inspecting raw bytes after decoding. ```bash $ echo "SGVsbG8=" | base64 -d $ echo "NBSWY3DP" | base32 -d $ echo "48656c6c6f" | xxd -r -p # hex → bytes $ echo "Q0lZ..." | base64 -d | xxd | head # decode then inspect bytes ``` -------------------------------- ### stegoveritas automated analysis Source: https://www.aperisolve.com/wiki/techniques/images Run a full battery of tests on an image file at once. ```bash $ stegoveritas image.png ``` -------------------------------- ### Run strings on an image Source: https://www.aperisolve.com/wiki/tools/strings Basic invocation of strings on a file. By default, it prints every run of 4+ printable ASCII characters in file order. ```bash $ strings image.png ``` -------------------------------- ### Inspect Archive Structure Source: https://www.aperisolve.com/wiki/techniques/files-archives Commands to view the internal structure and contents of a ZIP archive. ```bash $ zipdetails -v target.zip # full structure $ zipinfo target.zip $ 7z l target.zip ``` -------------------------------- ### Run file with -b flag Source: https://www.aperisolve.com/wiki/tools/file Aperi'Solve runs 'file -b image.png'. The -b (brief) flag omits the filename from the output, printing only the identification. ```bash $ file -b image.png ``` -------------------------------- ### Steganalysis tool commands Source: https://www.aperisolve.com/wiki/techniques/steganalysis Common command-line invocations for zsteg, StegExpose, and stegdetect to perform statistical detection on suspect files. ```bash $ zsteg -a suspect.png $ java -jar StegExpose.jar ./images_dir $ stegdetect -t opjf suspect.jpg ``` -------------------------------- ### Interpret binwalk output Source: https://www.aperisolve.com/wiki/tools/binwalk The output displays the decimal and hexadecimal offsets of identified signatures. The first line typically represents the carrier file, while subsequent lines indicate potential hidden data. ```text DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------- 0 0x0 PNG image, 800 x 600, 8-bit/color RGBA 54187 0xD3AB Zip archive data, name: flag.txt ``` -------------------------------- ### Analyze container metadata and appended data Source: https://www.aperisolve.com/wiki/techniques/video Inspect format tags and check for data appended after the logical end of the file. ```bash $ ffprobe -show_format -show_streams file.mp4 # format tags = metadata $ binwalk file.mp4 # second file / archive inside $ tail -c 256 file.mp4 | xxd # trailing data after the media ``` -------------------------------- ### Confirm hidden whitespace Source: https://www.aperisolve.com/wiki/tools/stegsnow Use cat -A to visualize whitespace characters and wc -c to check file size against visible content. ```bash $ cat -A file.txt # spaces stay blank, tabs show as ^I, line ends as $ $ wc -c file.txt # compare to the visible character count ``` -------------------------------- ### Extract and process codes with zbarimg Source: https://www.aperisolve.com/wiki/techniques/encodings Use zbarimg to extract raw data from various code types. Upscaling tiny images with ImageMagick's convert tool can improve detection success. ```bash $ zbarimg --raw code.png # QR, DataMatrix, EAN, Code128... $ convert code.png -resize 400% big.png && zbarimg --raw big.png # upscale a tiny code ``` -------------------------------- ### Extract NTFS streams with Sleuth Kit Source: https://www.aperisolve.com/wiki/techniques/files-archives Use icat from The Sleuth Kit to extract data from an image. ```bash icat ``` -------------------------------- ### Useful local strings flags Source: https://www.aperisolve.com/wiki/tools/strings Common flags: -n sets minimum run length, -e selects encoding (UTF-16LE), -t prints hex offsets, and piping to grep hunts the flag format directly. Grepping for the challenge's flag format is the fastest first move. ```bash $ strings -n 8 image.png # only runs of 8+ chars (less noise) $ strings -e l image.png # UTF-16LE ("wide") strings $ strings -t x image.png # print hex offset of each string $ strings image.png | grep -i "ctf{" # hunt the flag format directly ``` -------------------------------- ### Open audio in Audacity to inspect waveform Source: https://www.aperisolve.com/wiki/cheatsheet/audio Open the audio file in Audacity to visually inspect the waveform for Morse code on/off bursts. ```bash $ audacity audio.wav # eyeball the waveform for Morse on/off bursts ``` -------------------------------- ### Run pdfid.py locally Source: https://www.aperisolve.com/wiki/tools/pdfid Execute the pdfid.py script directly using Python 3. ```bash $ python3 pdfid.py document.pdf ``` -------------------------------- ### Validate and enumerate PNG chunks Source: https://www.aperisolve.com/wiki/techniques/images Use these commands to inspect the structure and metadata of a PNG file. ```bash $ pngcheck -vtp7 file.png $ identify -verbose file.png ``` -------------------------------- ### Extract data with MP3Stego Source: https://www.aperisolve.com/wiki/techniques/audio Use the MP3Stego decoder with a password to extract hidden data from an MP3 file. ```bash decode -X -P stego.mp3 ``` -------------------------------- ### Inspect SVG files with xmllint Source: https://www.aperisolve.com/wiki/techniques/files-archives Use xmllint to pretty-print and read SVG files, which can hide content in XML elements or comments. ```bash xmllint --format file.svg | less ``` -------------------------------- ### Crack WPA handshakes with aircrack-ng Source: https://www.aperisolve.com/wiki/cheatsheet/brute-force Use aircrack-ng with a wordlist on a captured handshake, or convert with hcxpcapngtool for hashcat mode 22000. ```bash $ aircrack-ng -w rockyou.txt capture.pcap # or hcxpcapngtool → hashcat -m 22000 ``` -------------------------------- ### Analyze and explode GIF/APNG frames Source: https://www.aperisolve.com/wiki/cheatsheet/image Examine animation frames and timings, or extract them into individual files. ```bash $ identify image.gif # lists every frame + delay $ convert image.gif -coalesce out/f%03d.png # explode to full frames $ ffmpeg -i image.gif -vsync 0 out/f%d.png # alternative $ gifsicle --explode image.gif -o frame # frame-per-file (frame.000…) ``` -------------------------------- ### zsteg common commands Source: https://www.aperisolve.com/wiki/techniques/images Basic commands for using zsteg to analyze PNG and BMP images for LSB-hidden data. ```bash $ zsteg image.png # common combinations $ zsteg -a image.png # every channel/bit/order combination $ zsteg -E 'b1,rgb,lsb,xy' image.png > payload.bin # extract one combination ``` -------------------------------- ### Recover Password from Keys Source: https://www.aperisolve.com/wiki/techniques/files-archives Retrieve the original password from recovered keys using bkcrack. ```bash $ bkcrack -k -r 10 ?p ``` -------------------------------- ### Detect Duplicate End-of-Central-Directory Markers Source: https://www.aperisolve.com/wiki/techniques/files-archives Use binwalk to search for multiple end-of-central-directory signatures, often used in evasion tricks. ```bash $ binwalk -R "PK\x05\x06" ``` -------------------------------- ### Run pdfid on a document Source: https://www.aperisolve.com/wiki/tools/pdfid Execute the pdfid tool against a target PDF file to scan for keywords. ```bash $ pdfid document.pdf ``` -------------------------------- ### Render spectrogram with sox and ffmpeg Source: https://www.aperisolve.com/wiki/techniques/audio One-shot CLI commands to generate a spectrogram image from an audio file. The first sox command produces a default-resolution image; the second adds -X 200 -Y 2050 -z 120 for high resolution. The ffmpeg command uses showspectrumpic with a 1920x1080 output. Use high resolution to avoid smearing faint hidden text. ```bash $ sox file.wav -n spectrogram -o spec.png $ sox file.wav -n spectrogram -o spec.png -X 200 -Y 2050 -z 120 # high-res $ ffmpeg -i file.wav -lavfi showspectrumpic=s=1920x1080 spec.png # ffmpeg ``` -------------------------------- ### Inspect and extract embedded file signatures Source: https://www.aperisolve.com/wiki/techniques/files-archives Use these commands to identify file types, inspect trailers for appended data, and list or extract embedded signatures. ```bash $ file target $ tail -c 200 target | xxd # inspect the trailer $ binwalk target # list embedded signatures $ binwalk -e target # auto-extract them ``` -------------------------------- ### Extract binary metadata fields Source: https://www.aperisolve.com/wiki/tools/exiftool Use the -b flag to extract raw binary data from specific metadata fields like thumbnails or ICC profiles and save them to a file. ```bash $ exiftool -b -ThumbnailImage image.jpg > thumb.jpg $ exiftool -b -ICC_Profile image.jpg > profile.icc ``` -------------------------------- ### Normalize and pipe raw audio to multimon-ng Source: https://www.aperisolve.com/wiki/techniques/audio Converts audio to raw 16-bit, 22050 Hz, mono before decoding. multimon-ng only reads raw 16-bit, 22050 Hz, mono; feeding other formats silently decodes nothing. ```bash sox in.wav -t raw -r 22050 -e signed -b 16 -c 1 - | multimon-ng -t raw -a DTMF - ``` -------------------------------- ### Decode QR codes and barcodes with zbarimg Source: https://www.aperisolve.com/wiki/cheatsheet/encodings Use zbarimg to extract raw data from QR codes or barcodes. Piping to xxd allows for inspection of binary payloads. ```bash $ zbarimg --raw code.png # QR / EAN / Code128 / DataMatrix $ zbarimg --raw -q code.png | xxd | head # inspect binary QR payloads ``` -------------------------------- ### OpenStego extraction with AES128 Source: https://www.aperisolve.com/wiki/tools/openstego Command to extract data using OpenStego with the RandomLSB algorithm and AES128 encryption. Requires a password and outputs to the specified directory. ```bash $ openstego extract -a randomlsb --cryptalgo AES128 -sf image -xd extracted -p "password" ``` -------------------------------- ### Extracting data with steghide Source: https://www.aperisolve.com/wiki/tools/steghide Commands used by Aperi'Solve to identify and extract embedded data from an image file using a specified password. ```bash $ steghide info image.jpg -p "password" $ steghide extract -sf image.jpg -xf secret.txt -p "password" ``` -------------------------------- ### Identify Polyglot Files Source: https://www.aperisolve.com/wiki/cheatsheet/files Commands to detect multiple file signatures within a single file, indicating a polyglot. ```bash $ binwalk target # multiple signatures at nonzero offsets $ xxd target | grep -iE '25504446|504b0304|ffd8ff|47494638' # PDF/ZIP/JPEG/GIF magic ``` -------------------------------- ### Crack steghide with stegseek Source: https://www.aperisolve.com/wiki/cheatsheet/image Use stegseek to brute-force or detect steghide payloads. ```bash $ stegseek image.jpg /usr/share/wordlists/rockyou.txt # cracks rockyou in seconds $ stegseek --seed image.jpg # detect a steghide payload w/o wordlist ``` -------------------------------- ### Extract metadata and strings Source: https://www.aperisolve.com/wiki/methodology Commands to inspect file metadata and extract readable strings, including support for different endianness. ```bash $ exiftool -a -u -g1 target $ strings -n 8 target | less $ strings -e l -n 8 target # 16-bit little-endian (UTF-16) text $ strings -e b -n 8 target # 16-bit big-endian text ``` -------------------------------- ### Reassemble a single TCP stream Source: https://www.aperisolve.com/wiki/cheatsheet/network Follow a single TCP stream (stream index 0) and convert the raw hex output to a binary file, or use tcpflow to write one file per direction per flow. The tshark command uses follow,tcp,raw,0 and pipes through tr and xxd. ```bash $ tshark -r capture.pcap -qz follow,tcp,raw,0 | tr -d '\n' | xxd -r -p > stream0.bin $ tcpflow -r capture.pcap -o flows/ # one file per direction per flow ``` -------------------------------- ### Crack ZIP passwords with john and fcrackzip Source: https://www.aperisolve.com/wiki/cheatsheet/brute-force Use zip2john to extract a hash for john, or fcrackzip with -u to verify. The -b mode brute-forces with charset 'a1' and length 1-6. ```bash $ zip2john secret.zip > zip.hash && john --wordlist=rockyou.txt zip.hash $ fcrackzip -u -D -p /usr/share/wordlists/rockyou.txt secret.zip # -u verifies $ fcrackzip -b -c 'a1' -l 1-6 secret.zip # brute force ``` -------------------------------- ### Perform Known-Plaintext Attack with bkcrack Source: https://www.aperisolve.com/wiki/techniques/files-archives Recover internal keys from a ZIP archive using a known plaintext prefix, then decrypt the archive. ```bash $ bkcrack -C secret.zip -c inner.png -p known_prefix.bin # recover 3 keys $ bkcrack -C secret.zip -k -D unlocked.zip # decrypt everything ``` -------------------------------- ### List ZIP Archive Contents Source: https://www.aperisolve.com/wiki/cheatsheet/files Commands to list contents of a ZIP file, noting encryption and compression methods. ```bash $ 7z l target.zip # list; note encryption + compression method $ unzip -l target.zip ``` -------------------------------- ### Extract USB HID keyboard data with tshark Source: https://www.aperisolve.com/wiki/techniques/files-archives Extract USB keyboard reports from a pcap file. Filter by usb.data_len==8 to isolate keyboard reports. ```bash tshark -r usb.pcap -Y 'usb.capdata && usb.data_len==8' -T fields -e usb.capdata ``` -------------------------------- ### Carve files manually with dd Source: https://www.aperisolve.com/wiki/tools/binwalk Use the dd command to extract a specific region of a file based on the offset identified by binwalk, then unzip the resulting file. ```bash $ dd if=image.png of=hidden.zip bs=1 skip=54187 $ unzip hidden.zip ``` -------------------------------- ### Crack steghide with stegseek Source: https://www.aperisolve.com/wiki/cheatsheet/brute-force stegseek is much faster than stegcracker. The --seed mode detects a payload without a wordlist. On success it writes the passphrase and extracted file. ```bash $ stegseek image.jpg /usr/share/wordlists/rockyou.txt # ~seconds on rockyou $ stegseek --seed image.jpg # detect payload, no wordlist ``` -------------------------------- ### Crack ZipCrypto Passwords Source: https://www.aperisolve.com/wiki/techniques/files-archives Use fcrackzip to perform a dictionary attack on archives protected with weak ZipCrypto. ```bash $ fcrackzip -u -D -p rockyou.txt target.zip ``` -------------------------------- ### zsteg extraction commands Source: https://www.aperisolve.com/wiki/techniques/images Commands to dump a specific combination to stdout or extract raw bytes to a file for further analysis. ```bash $ zsteg image.png b1,rgb,lsb,xy # dump one combination to stdout $ zsteg -E 'b1,rgb,lsb,xy' image.png > out.bin # raw bytes -> file / binwalk ``` -------------------------------- ### Analyze PDF files Source: https://www.aperisolve.com/wiki/techniques/files-archives Commands for inspecting PDF metadata, extracting embedded attachments, and decompressing streams for text searching. ```bash $ pdfinfo file.pdf $ pdfdetach -list file.pdf && pdfdetach -saveall file.pdf # embedded attachments $ qpdf --qdf --object-streams=disable file.pdf out.pdf # decompress for grep ``` -------------------------------- ### Extract subtitle, attachment, and chapter tracks Source: https://www.aperisolve.com/wiki/techniques/video Extract non-video streams which are often used to hide data as timed text, attachments, or chapter titles. ```bash $ ffmpeg -i file.mkv -map 0:s:0 subs.srt # rip the first subtitle track $ mkvextract tracks file.mkv 2:subs.ass # Matroska, track id from mkvmerge -i $ ffmpeg -dump_attachment:t "" -i file.mkv # dump every attached file (fonts, images) $ ffprobe -show_chapters file.mp4 # chapter titles can spell a message ``` -------------------------------- ### Access NTFS Alternate Data Streams Source: https://www.aperisolve.com/wiki/techniques/files-archives List or read hidden data streams in Windows files. ```bash dir /r Get-Content file -Stream secret ``` -------------------------------- ### Hide and reveal data locally Source: https://www.aperisolve.com/wiki/tools/jsteg Commands to embed a file into a JPEG and subsequently extract the payload to stdout or a file. ```bash $ jsteg hide cover.jpg secret.txt out.jpg # embed secret.txt $ jsteg reveal out.jpg # print payload to stdout $ jsteg reveal out.jpg payload.bin # or write it to a file ``` -------------------------------- ### OpenStego extraction with AES256 Source: https://www.aperisolve.com/wiki/tools/openstego Command to extract data using OpenStego with the RandomLSB algorithm and AES256 encryption. This attempt only runs if the AES128 attempt fails. ```bash $ openstego extract -a randomlsb --cryptalgo AES256 -sf image -xd extracted -p "password" ``` -------------------------------- ### OpenStego local extraction command Source: https://www.aperisolve.com/wiki/tools/openstego CLI command to extract data locally. The -a flag can usually be omitted because randomlsb is the default algorithm. ```bash $ openstego extract -sf image.png -p password -xd outdir ``` -------------------------------- ### Run identify with verbose output Source: https://www.aperisolve.com/wiki/tools/identify Executes the identify command with the -verbose flag to display detailed image information. ```bash $ identify -verbose image ``` -------------------------------- ### Hide data in a file Source: https://www.aperisolve.com/wiki/tools/stegsnow Embed a message into a cover file using -m for the message, -C for compression, and -p for a password. ```bash $ stegsnow -C -m "hidden message" -p "secret" cover.txt out.txt ``` -------------------------------- ### Extract and List ZIP Contents Source: https://www.aperisolve.com/wiki/cheatsheet/files Commands to list or extract contents from a ZIP archive. ```bash $ unzip target # or: 7z x target $ 7z l target # list contents without extracting ``` -------------------------------- ### Extract GIF frames and compare changes Source: https://www.aperisolve.com/wiki/techniques/images Commands to extract frames from a GIF using ffmpeg or gifsicle, and to identify pixel changes between frames using ImageMagick. ```bash $ ffmpeg -i file.gif -vsync 0 out/f%d.png # extract frames $ gifsicle --explode file.gif # alternative frame split $ compare frame_001.png frame_002.png diff.png # ImageMagick: pixels that changed ``` -------------------------------- ### Decode SSTV image from WAV with sstv Source: https://www.aperisolve.com/wiki/techniques/audio Decodes a slow-scan TV image from a WAV file. The headless tool auto-detects the mode; the challenge title often hints at the mode (e.g., Scottie, Robot, Martin). ```bash sstv -d file.wav -o out.png ``` -------------------------------- ### Analyze PDF Files Source: https://www.aperisolve.com/wiki/cheatsheet/files Commands to extract attachments, parse objects, recover revisions, and dump embedded content from PDF files. ```bash $ pdfdetach -list target.pdf && pdfdetach -saveall target.pdf # attachments $ pdf-parser --search flag target.pdf # objects/streams $ pdfresurrect -w target.pdf # recover overwritten revisions $ mutool extract target.pdf # dump embedded images/fonts ``` -------------------------------- ### Extract audio tracks Source: https://www.aperisolve.com/wiki/techniques/video Demux the audio track to analyze it for hidden messages, such as those visible in a spectrogram. ```bash $ ffmpeg -i file.mp4 -vn -acodec copy audio.aac # extract without re-encoding $ ffmpeg -i file.mp4 -vn audio.wav # decode to WAV for spectrogram/LSB ``` -------------------------------- ### Useful zsteg local flags Source: https://www.aperisolve.com/wiki/tools/zsteg Commands for thorough scanning, extracting a specific payload, and limiting to LSB combinations. -E extracts raw bytes of a specific combination; pipe to a file and inspect with file, xxd, or binwalk. ```bash $ zsteg -a image.png # try ALL known combinations (slow, thorough) $ zsteg -E "b1,rgb,lsb,xy" image.png > payload.bin # extract one payload $ zsteg --lsb image.png # only LSB combinations ``` -------------------------------- ### Extract LSB data from BMP with zsteg Source: https://www.aperisolve.com/wiki/techniques/images Use zsteg -a on BMP files to extract LSB data, just like PNG. BMP is uncompressed, making it a prime LSB carrier. ```bash zsteg -a file.bmp ``` -------------------------------- ### Extract OOXML archive contents Source: https://www.aperisolve.com/wiki/techniques/files-archives Use 7z to extract the contents of an OOXML document, which are essentially ZIP archives of XML parts. ```bash $ 7z x report.docx -o report/ ``` -------------------------------- ### Extract video frames for analysis Source: https://www.aperisolve.com/wiki/techniques/video Split video into images to check for hidden data in frames. Use lossless formats like PNG to preserve LSBs. ```bash $ ffmpeg -i file.mp4 -vsync 0 frames/f%05d.png # every frame, lossless $ ffmpeg -i file.mp4 -vf "select=eq(pict_type\,I)" -vsync 0 key/k%03d.png # keyframes only $ ffmpeg -ss 12.5 -i file.mp4 -frames:v 1 shot.png # a single frame at a timestamp ``` -------------------------------- ### Extract USB HID keyboard keystrokes Source: https://www.aperisolve.com/wiki/cheatsheet/network Extract 8-byte HID reports from USB captures to recover keystrokes. The filter usb.capdata && usb.data_len==8 selects keyboard reports; save the output to keys.txt and map HID usage IDs with a decoder script. ```bash # Keyboard: 8-byte HID reports on usb.capdata $ tshark -r capture.pcap -Y 'usb.capdata && usb.data_len==8' -T fields -e usb.capdata > keys.txt ```