Firmware Emulation 102

Now that you’ve got a clear idea of what firmware emulation is and why it matters, it’s time to actually dive in. In this blog, we’ll walk through setting up the tools and running your first emulation session. We’ll be using Firmware Analysis Toolkit (FAT) and Firmadyne, two of the most popular tools for analyzing and emulating router firmware.
If your environment and firmware file are ready, let’s get to it.
Once everything’s set, run the following command to start emulating your firmware image:
Fig 1: Setting up the Firmware Analysis Toolkit (FAT) environment in Ubuntu.
If you run into errors at this step — no stress. It happens. If FAT doesn’t work out for your image, you can switch to Method 2: Firmadyne and keep moving forward.
Firmadyne is another super handy tool when it comes to firmware emulation. It’s designed to automatically extract, set up, and emulate firmware in a controlled environment. The great thing about Firmadyne is that it makes analyzing firmware behavior much smoother and gives you the flexibility to poke around, spot vulnerabilities, and see how things work under the hood.
Before getting started, make sure you’ve got these ready:
Perfect — let’s humanize that into your clean, educational, straight-to-the-point blog tone. Here’s your revised Setting Things Up section for Firmadyne:
Alright before you can start emulating firmware with Firmadyne, you’ll need to get a few things sorted. Here’s a simple step-by-step to get everything in place:
Firmadyne relies on several tools and dependencies. Run this command to install everything in one go:
Some systems still ship with Python 2 as default. If that’s the case for you, switch it to Python 3:
Now, grab the Firmadyne source code from GitHub:
Binwalk is essential for unpacking firmware images:
Navigate to the Binwalk folder and install its dependencies:
Firmadyne uses PostgreSQL to manage firmware data. Install it and set up the database like this:
# (Enter a password for the 'firmadyne' user)
Download extra required resources for Firmadyne to work properly:
Finally, install QEMU along with the necessary architecture support:
Fig 2: Editiing Firmadyne Configuration file
Fig 3: Editing Configuration Paths in Firmadyne Script
Fig 4: Configuration path has been updated to /home/user/firmadyne
Firmadyne comes with a tool specifically for extracting firmware images. To extract the NETGEAR firmware, run the following command on your router’s binary file:
This will unpack the firmware image and place the extracted files into the images directory, getting it ready for emulation.
Once the extraction process is done, you’ll need to make sure it completed successfully. To check, just list the contents of the images directory:
If everything worked, you should see your extracted firmware files sitting there.
Fig 5: Extracting the Netgear WNAP320 firmware
Got it — here’s your humanized, clean, step-by-step version while preserving your original structure and tone:
You’ll need to figure out the architecture of your firmware before emulating it. Run this command to let Firmadyne detect it:
This will output the architecture type (like ARM, MIPS, etc.) for your firmware.
Next up, you’ll need to push your extracted firmware data into the Firmadyne database. Do it like this:
This step registers your firmware image with Firmadyne’s backend so it can be used for emulation.
Finally, it’s time to build the actual emulation image. Run:
This prepares everything needed for the firmware to boot up inside an emulated environment.
Fig 6: Creating and formatting a image from extracted firmware
Once the emulation image is ready, you’ll need to figure out the network settings it uses. Even though the output might look a little messy, this command will pull out the essential network configuration details:
Fig 7: Infers the network interface and IP address (192.168.0.100)
And there it is — you’ll get the emulated device’s IP address right here!
Before kicking things off, it’s a good idea to check the files in the scratch directory where your emulated environment is set up. Run:
Make sure everything’s in place.
Alright — time for the main event. Fire up the emulation with:
And just like that, your NETGEAR WNAP320 firmware is running in an emulated environment!
Fig 8: Running the firmware in an emulated environment
Fig 9: Firmware has been emulated
Fig 10: "Netgear WNAP320 ProSafe Access Point login page at 192.168.0.100"
USERNAME: admin
PASSWORD: password
FINALLY!!! EMULATION IS DONE!!
Once your emulation is running smoothly, you can go ahead and set up a proxy on Firefox and start intercepting the network traffic with Burp Suite. This lets you analyze how the device communicates, spot potential vulnerabilities, and play around with requests without touching the actual hardware.
Fig 11: Intercepting a traffic on burp suite
And there you go you’ve just emulated firmware using Firmadyne. From setting up the environment, extracting the firmware, to running it in a controlled setup it’s a solid way to safely test and explore how devices behave. Once you’ve got it running, you can hook up tools like Burp Suite to intercept and inspect traffic, spotting anything unusual. Firmware emulation isn’t as complicated as it sounds once you get the hang of it. Keep experimenting, and you’ll keep finding new things to break (and fix).