Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Binwalk analyses firmware images and other binary blobs, identifying embedded file systems, kernels, and certificates by signature and extracting them for examination.

What Is Binwalk?
Binwalk is a tool for analysing binary files, used almost exclusively against firmware. Point it at the update image a manufacturer publishes for a router, camera, or industrial controller, and it scans for the magic byte sequences that mark the beginning of known formats, reports what it finds and where, and then extracts those components into a directory tree you can read.
The reason it matters is that a firmware image is usually a container rather than a program. Inside a single file you typically find a bootloader header, a compressed Linux kernel, and a root file system in SquashFS, JFFS2, CramFS, or UBIFS format. Once that file system is unpacked, it is an ordinary directory of ordinary files, and everything the device runs can be read at leisure.
The signature scan is the first step and often the most informative. It gives an offset table: a uImage header at the start, an LZMA-compressed kernel a few hundred bytes in, a SquashFS file system at some later offset, and sometimes a certificate or a public key sitting on its own. Extraction then recursively unpacks each of those.
What a tester reads out of the extracted file system, in rough order of how often it appears:
/etc/passwd and /etc/shadow, frequently with a hash that falls to John the Ripper in seconds because it is a dictionary word, and often identical across an entire product line.Binwalk’s entropy graph is the quickest way to answer a question that determines how the rest of the assessment goes: is this image encrypted? Uncompressed code and data produce a varied, moderate entropy profile. Compressed data produces consistently high entropy with visible structure at the boundaries. Encrypted data produces a flat line at near-maximum entropy from beginning to end, with no structure at all.
A flat high-entropy image means signature scanning will find nothing, and the analysis has to go another way: obtaining the decrypted image from the device’s own flash through JTAG or UART, dumping the SPI flash chip directly, or recovering the decryption key from the bootloader. That is a considerably larger piece of work, which is precisely the point of encrypting firmware.
Extraction means invoking third-party decompressors on attacker-influenced data, and the tool itself has had security problems. CVE-2022-4510 was a path traversal flaw in Binwalk’s PFS file system extractor that allowed a crafted firmware image to write files outside the extraction directory and achieve code execution on the analyst’s machine. Treat firmware you did not build as hostile input: extract inside a disposable container or virtual machine, use a non-privileged account, and keep the tool updated.
Firmware extraction cannot be prevented once a device is in someone’s hands, so the objective is to make the extracted contents worthless.
ETSI EN 303 645 sets out these expectations as a baseline standard, and it is the reference the UK regime draws on.
At Privia Security, our IoT Penetration Testing includes firmware extraction and analysis as a standard part of device assessments.
Very little, and that is useful information in itself. A flat entropy graph at near-maximum value across the whole image indicates encryption, and signature scanning will return nothing. The analysis then has to obtain a decrypted image another way, typically by dumping the flash chip directly, using a UART or JTAG interface, or recovering the key from an unencrypted bootloader stage.
In the UK, analysing firmware from a device you own is generally lawful, and the Copyright, Designs and Patents Act 1988 permits decompilation in limited circumstances. Licence terms may still prohibit it contractually, and publishing extracted proprietary code is a separate matter. Testing someone else’s device, or any device still in service on a network you do not own, requires written authorisation under the Computer Misuse Act 1990.
It can scan any file for known signatures, but it is designed for firmware. Running it against a normal application binary produces mostly noise, since compiled code contains byte sequences that coincidentally match signature patterns. For application binaries, a disassembler such as Ghidra or IDA Pro is the correct tool, and the two are frequently used together on the executables Binwalk extracts.
Remove every shared secret from the image, provision per-device credentials and keys at manufacture, sign firmware and verify the signature in the bootloader, and update bundled components to current versions. In the UK, universal default passwords on consumer connectable products have been prohibited since 29 April 2024 under the PSTI regime, alongside published vulnerability disclosure and support period requirements.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.