binwalk --helpDisplays the main help menu listing all available options and flags
Analyses and extracts firmware images: finds embedded file systems, compressed data and executable code by signature and entropy.
sudo apt install binwalkbinwalk --helpDisplays the main help menu listing all available options and flags
binwalk -b firmware.binRuns a dumb scan that ignores smart signature keywords for broader matching
binwalk -I firmware.binShows all scan results including those marked as invalid by the magic definitions
binwalk -m ./magic.mgc firmware.binUses a custom magic signature file instead of the default system signatures
Example
binwalk -m ./custom_magic.mgc firmware.binbinwalk -R "\x1f\x8b\x08" firmware.binScans the file for a specific raw byte sequence
binwalk -R "Copyright" firmware.binScans the file for a specific ASCII string occurrence
binwalk -E firmware.binCalculates and displays the entropy of the file to identify compressed or encrypted data
binwalk -E -N firmware.binCalculates entropy but suppresses the generation of the entropy graph plot
binwalk -E -J firmware.binCalculates entropy and saves the resulting graph as a PNG image
binwalk -E -Q firmware.binCalculates entropy and omits the legend from the generated graph
binwalk -y "filesystem" firmware.binFilters output to only show results containing the string filesystem
binwalk -y "filesystem" -y "copyright" firmware.binFilters output to show results matching either filesystem or copyright
binwalk -x "invalid" firmware.binFilters output to exclude any results containing the string invalid
binwalk -e firmware.binAutomatically extracts known file types found during the signature scan
binwalk -D "png image:png" firmware.binExtracts files matching the png image signature and saves them with a png extension
binwalk -D "gzip compressed data:gz:gunzip %e" firmware.binExtracts gzip data, saves with gz extension, and runs gunzip on the extracted file
binwalk -e -r firmware.binExtracts known files and deletes the carved files after successful extraction
binwalk -e -z firmware.binCarves data based on signatures but does not execute external extraction utilities
binwalk -M -e firmware.binRecursively scans and extracts contents (Matryoshka mode) from extracted files
binwalk -M -e -d 4 firmware.binRecursively extracts files but limits the recursion depth to 4 levels
binwalk -M -e -C ./output_dir firmware.binRecursively extracts contents into a specific custom directory
binwalk -f scan.log firmware.binLogs the scan results to a specified text file
binwalk --csv firmware.binFormats the scan output as CSV for easy importing into spreadsheets
binwalk --csv -f results.csv firmware.binGenerates CSV formatted output and saves it directly to a file
binwalk -t firmware.binFormats the output nicely to fit the current terminal window width
binwalk -q firmware.binRuns the scan quietly, suppressing standard output unless errors occur
binwalk -v firmware.binEnables verbose logging to display internal tool processing details
binwalk -l 1024 firmware.binScans only the first 1024 bytes of the input file
binwalk -o 4096 firmware.binStarts the scan at offset 4096, skipping the beginning of the file
binwalk -O 0x800000 firmware.binSets a custom base address for the scan, useful for memory dumps
binwalk -g 2 firmware.binReverses every 2 bytes before scanning, useful for endianness swaps
binwalk -W firmware1.bin firmware2.binPerforms a hexdump comparison between two or more files
binwalk -W -G firmware1.bin firmware2.binDiffs files and only shows lines where bytes are identical (Green mode)
binwalk -W -i firmware1.bin firmware2.binDiffs files and only shows lines where bytes differ among all files (Red mode)
binwalk -W -U firmware1.bin firmware2.binDiffs files and only shows lines where bytes differ among some files (Blue mode)
binwalk -A -l 5000 firmware.binChecks the bootloader area (first 5000 bytes) for executable code signatures
binwalk -B -f report.txt --csv firmware.binGenerates a standard signature scan report in CSV format for external processing
binwalk -Me -f analysis.log firmware.binPerforms full recursive extraction and logs all findings to a file
binwalk -B -e -p firmware.binScans and extracts files while explicitly disabling plugins for raw handling
binwalk -y "filesystem" -e firmware.binExtracts only the identified filesystem components, ignoring other artifacts
binwalk -E -o 1000 -l 2000 firmware.binAnalyzes entropy for a specific middle chunk of the firmware image
binwalk -M -e -r --directory=investigation firmware.binClean recursive extraction into a named folder, deleting carved archives after expansion
binwalk --status firmware.binShows the memory usage and running status of the scan (if supported by version)
binwalk -D "jpeg:jpg" firmware.binCarves all JPEG files found in the binary without executing any helper scripts
binwalk -q -e firmware.binRuns extraction in quiet mode for use in automated pipelines or scripts
binwalk -3 firmware.binEnables 3D visualization of the entropy plot (requires pyqtgraph)
binwalk -B -v firmware.binRuns a signature scan with verbose output to debug false positive signatures
binwalk -D "uimage header:uimage" -D "gzip:gz:gunzip %e" firmware.binDefines multiple custom extraction rules for uImage headers and gzip data simultaneously
binwalk -y "squashfs" -t firmware.binLocates SquashFS offsets and formats the output for easy reading
binwalk -A -O 0x400000 firmware.binScans for opcodes assuming the firmware is loaded at memory address 0x400000
binwalk --rm firmware.binScans and cleans up zero-size files generated during extraction attempts
binwalk -E -K 1024 firmware.binPerforms entropy analysis using a custom block size of 1024 bytes
binwalk --examplesDisplays built-in usage examples and common command patterns
Recovers files from disk images and raw data by carving their headers and footers, even without a file system.
Prints sequences of printable characters from binary files — a fast first look at executables, memory dumps and unknown data.
Reads, writes and strips metadata in images, documents, audio and video — invaluable for OSINT and forensics.