Next Article in Journal
A Doppler Frequency-Offset Estimation Method Based on the Beam Pointing of LEO Satellites
Previous Article in Journal
LMEC-YOLOv8: An Enhanced Object Detection Algorithm for UAV Imagery
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Emulation-Based Fuzzing of Encrypted Firmware

College of Computer Science, Guangdong University of Science & Technology, Dongguan 523083, China
*
Author to whom correspondence should be addressed.
Electronics 2025, 14(13), 2537; https://doi.org/10.3390/electronics14132537
Submission received: 13 April 2025 / Revised: 6 June 2025 / Accepted: 11 June 2025 / Published: 23 June 2025
(This article belongs to the Special Issue Cybersecurity in Internet of Things)

Abstract

Internet of Things (IoT) devices are frequent targets of cyber attacks, and firmware emulation is essential for enabling automated techniques like fuzzing to uncover vulnerabilities. However, the growing use of encryption in firmware poses significant challenges for building accurate emulated environments. To overcome this, we present EncryptAFL, the first IoT fuzzer specifically tailored for devices with encrypted firmware. In contrast to existing methods that primarily focus on peripheral emulation, EncryptAFL places greater emphasis on automating the decryption process. We evaluate EncryptAFL using real-world firmware and known vulnerabilities, demonstrating its effectiveness in both emulation and vulnerability detection.

1. Introduction

The IoT ecosystem is a fundamental component of modern society, making it an attractive target for hackers worldwide. The integrity and availability of IoT devices are critical in contemporary cyber warfare, influencing both offensive and defensive operations. A notable example is the sophisticated cyber-attack on Ukraine’s power system in 2015, which not only disrupted services in the vicinity of Kiev but also triggered widespread blackouts across nearly half of the country [1]. As a result, proactively identifying and mitigating vulnerabilities in IoT systems has become essential for nations, spurring significant research efforts in both industry and academia [2].
Detecting security vulnerabilities in IoT devices presents a greater challenge than with traditional devices [2,3]. This difficulty arises not only from the complexity and diversity of IoT devices but also from the intricate integration of their software systems with electrical hardware, which hampers emulation using current automated vulnerability detection methods. For instance, conventional techniques such as static and dynamic program analysis struggle to identify bugs in the firmware of smart IoT nodes due to their complicated execution environments and the interdependent relationships among multiple executable binaries within their file systems. To tackle these challenges, researchers have turned to fuzzing with customized emulators [4,5,6,7] as a promising method for uncovering vulnerabilities in IoT devices. Fuzz testing (fuzzing) is an automated software testing technique that repeatedly executes target systems, monitoring for indicators such as program crashes to reveal potential security flaws [8].
However, current methods fall short in overcoming certain challenges when fuzzing IoT devices. A major hurdle is the difficulty in setting up automated fuzzing environments for many devices, especially due to encrypted firmware. Devices like industrial wireless routers employ additional encryption measures, requiring manual analysis and decryption before automated fuzz testing can proceed. This drives us to develop an efficient fuzzer with built-in auto-decryption capabilities, enabling effective fuzzing of IoT devices that use encrypted firmware. Although encryption methods vary, many devices opt for simpler techniques, such as XOR encryption with a specific key, to balance performance and security. These simpler algorithms leave identifiable traces at the binary level, making heuristic analysis feasible. Consequently, advanced classification strategies can be employed to detect these indicators and identify the underlying encryption method.
In this paper, we present EncryptAFL, the first efficient IoT fuzzer specifically designed for devices with encrypted firmware. First, to emulate executable environments for IoT firmware, EncryptAFL extends the state-of-the-art open-source emulator QEMU by introducing a new machine platform that includes custom peripheral components. This enhancement overcomes the challenges of setting up virtual machines when physical modules, such as serial ports with specific protocols, are absent. Second, to mirror the natural decryption process of physical devices, EncryptAFL modifies QEMU’s startup procedure to support automatic decryption of encrypted firmware and accurately emulate the boot process of real hardware. Finally, EncryptAFL employs heuristic analysis algorithms to identify encryption strategies used in target firmware based on the observation that many IoT devices utilize simple encryption methods with identifiable binary traits to balance performance and security.
We developed a prototype of EncryptAFL and evaluated it on popular industrial devices such as MOXA wireless routers. Our evaluation indicates that EncryptAFL can emulate a wider range of IoT devices compared to existing IoT emulators and fuzzers.
In conclusion, we make the following contributions:
  • We systematically review and analyze encryption algorithms used in the firmware of existing IoT devices. Building on this knowledge, we develop heuristic algorithms to automatically identify these encryption methods in firmware.
  • We present the design and implementation of EncryptAFL, a full-system emulation fuzzing tool specifically tailored for IoT devices, including electricity meters.
  • We evaluate EncryptAFL on popular industrial devices and automatically reproduce 12 previously known vulnerabilities. To the best of our knowledge, this is the first fuzzing tool capable of automated testing on devices with encrypted firmware.
The remainder of this paper is organized as follows. Section 2 provides the necessary technical background. In Section 3, we outline the design and details of EncryptAFL. Section 4 presents our evaluation results, and Section 5 discusses the limitations and potential future work. Finally, Section 6 concludes the paper.

2. Background and Related Work

In this section, we provide essential background on device emulation and the application of fuzzing in this context. We then elaborate on the core challenges addressed in device fuzzing.

2.1. System Platform Emulation

System platform emulation is a virtualization strategy that replicates an entire platform, including specific CPUs and all necessary peripheral components, to support full-system emulation [5,6,7,9,10]. Virtualization techniques [11] provide a set of abstract interfaces that mirror the functionalities of a real-world system at the same abstraction layer, ensuring that the virtualized target behaves as it would in its native environment. In this context, we refer to the provider of abstract resources as the H o s t , and the virtualized target that utilizes these resources as the G u e s t . Based on the types of physical resources being virtualized, these techniques can be categorized into three groups: computing resources (CPU) virtualization, memory resources virtualization, and device resources virtualization [12].
When running a virtual machine with the same instruction set architecture (ISA), most binary code is executed directly [13,14]. However, operations involving sensitive physical resources, such as physical ports or privileged registers, are intercepted and emulated with predetermined values, a technique known as the trap-and-emulate model [13,14]. Most ISAs now offer hardware-assisted virtualization features to accelerate virtual machine performance. However, hardware-assisted device virtualization typically requires specific physical peripheral devices to be present on the H o s t system. This approach is designed solely to redirect I/O requests to existing hardware and is less effective when emulating non-existent devices [12]. Additionally, hardware-assisted CPU virtualization is limited to virtual machines using the same ISA. Emulating systems with different ISAs still necessitates instruction interpretation.
QEMU (Quick Emulator) is a full-system emulator that leverages techniques such as instruction-by-instruction interpretation and dynamic binary code translation to execute instructions efficiently [13,15]. In addition to CPU and memory emulation, QEMU offers a range of emulated peripheral devices and pre-configured machine platform designs. It also features a custom, software-based Memory Management Unit (MMU) to manage memory accesses, enabling it to emulate a general machine platform for most ISAs. Compared to existed full-system emulation and virtualization solutions like VMWare and VirtualBox, QEMU is a fully open-source project with highly customizable functionalities and various types of emulated devices, which offers comprehensive support for hardware virtualization, precise control over execution, and extensive debugging capabilities. This makes QEMU much easier and more powerful than other projects for developers to build their customizable solutions. Given that many industrial devices operate on different ISA platforms, using emulators like QEMU to create virtual machines has become one of the most practical strategies in dynamic software testing [16]. As a result, several fuzzers, such as EQUAFL [5], have adopted QEMU as the foundation for their testing environments.

2.2. Fuzz Testing

Fuzz testing (fuzzing) is an automated software testing technique that uncovers bugs and vulnerabilities by repeatedly executing the target application with randomly or rule-based generated inputs while monitoring for abnormal behaviors, such as program crashes that often indicate memory violation bugs [8,17,18,19]. Fuzzers can be categorized into three types based on the level of insight they have into the target program:
  • White-box fuzzing: These tools have complete knowledge of the target, including source code and runtime execution details. They typically use metrics like code coverage to guide the generation of new inputs [20,21].
  • Black-box fuzzing: Operating without any feedback, black-box fuzzers treat the target program as an opaque entity. They generate inputs randomly without using static analysis techniques, such as constructing control-flow graphs [22,23].
  • Grey-box fuzzing: Striking a balance between the two, grey-box fuzzers do not have full insight into the target program but collect limited runtime feedback through lightweight monitoring. This information is then used to enhance the input generation process and improve the overall fuzzing effectiveness [6,8,24].
Coverage-guided fuzzing is the most widely adopted strategy among both white-box and grey-box fuzzers [6,8]. This approach is grounded in the principle that executing a greater proportion of code increases the likelihood of uncovering unknown vulnerabilities. Typically, code coverage is obtained through software-level instrumentation techniques that modify the target program’s source code or binary assembly to insert mechanisms for recording executed code blocks or branches. In white-box fuzzing, static instrumentation is commonly employed, integrating the process into the target program’s compilation. In contrast, grey-box fuzzing favors dynamic instrumentation since it does not require comprehensive insight into the target program. The resulting coverage data then guide the input generator in producing subsequent test cases. Inputs that trigger new execution paths are deemed "interesting" and are retained as seeds for further fuzzing, while those that do not enhance coverage are discarded. However, when fuzzing programs on specific platforms, an emulated environment is essential to correctly execute the binary. Full-system emulation becomes particularly critical for testing applications on IoT devices—such as wireless routers and smart electricity meters—that require specific peripheral components to perform hardware-dependent functions reliably.

2.3. Challenges with Encrypted Firmware from IoT

While full-system emulation-based fuzzing is a practical strategy, significant challenges persist when applying it to smart IoT devices.
Electricity-related Peripheral Components Many smart IoT devices incorporate specialized electrical components that differ from those found in common devices like wireless routers. These components are tightly integrated with physical electrical equipment and are typically not supported by standard emulators such as QEMU [10]. This limitation often prevents the establishment of a fully functional emulated environment required for the corresponding device firmware to operate correctly.
Encrypted Firmware. Smart device firmware in the IoT is frequently designed to be encrypted, with decryption occurring during the boot process via boot code or dedicated hardware components [25,26]. This presents a major challenge for conventional IoT fuzzers, as popular emulators like QEMU lack the capability to automatically identify and decrypt encrypted firmware. Consequently, this shortfall hinders the successful setup of a testing environment for such firmware.

2.4. Motivations

Given the limitations of current research approaches, our goal is to develop an effective grey-box fuzzer for smart IoT devices. Although existing fuzzing methods and emulators for IoT lack strategies tailored to this scenario, we identified potential solutions to overcome these challenges. First, many smart IoT devices operate under proprietary protocols that are typically simple by design, allowing specific peripheral components to function via techniques like packet-replaying that uses tools like Wireshark to capture contents of network packets and forgery the procedure of packet transmission via Python 3.9 scripts. For example, when smart electricity meters transmit electricity usage data over serial ports, the response packets are usually in a fixed format. By leveraging this consistency, we can develop custom peripheral components in QEMU that respond with predefined packets, enabling most functions of these smart devices to operate successfully in an emulated environment. Second, many devices with encrypted firmware utilize basic encryption algorithms, such as simple XOR with a specific key string, to balance performance and security. This result is obtained from our observation in analysis of many different IoT firmware including devices from various manufacturers. For example, wireless AP/bridge/client like AWK-3121 series from MOXA Corp usually adopt a simple XOR encryption on its firmware, whose key is always stored in a specific location in the firmware. This simplicity makes it feasible to apply heuristic analysis to encrypted firmware. Our observation is that such encryption algorithms often leave discernible patterns at the binary level, which can be detected and classified using advanced analysis techniques. Motivated by these insights, our work addresses both challenges to provide a viable solution for fuzzing smart devices with encrypted firmware in the IoT.

3. Design

In this section, we present the design of EncryptAFL along with the rationale behind our design choices.

3.1. Overview

We provide a high-level overview of our encrypted firmware fuzzer design before delving into the implementation details of each component in Section 3. The overall architecture of EncryptAFL is illustrated in Figure 1 and can be divided into three main components: the virtualization infrastructure, the encryption resolver, and the fuzzing engine.
The virtualization infrastructure comprises two main elements: a software system running within the decrypted target firmware on the Guest side and a full-system emulated hardware environment built on a customized QEMU with additional emulated electrical peripherals on the Host side. The encryption resolver operates prior to setting up the emulated environment. It identifies the encryption algorithm used in the target firmware and decrypts it accordingly. Meanwhile, the fuzzing engine maintains a pool of seeds derived from a malicious input database gathered from real-world cyber-attack activities (e.g., data sequences from NIDS and honeypots). Seed scheduling and mutation processes continuously generate new inputs, which are then fed into the binary executables within the target firmware via customized QEMU emulated peripherals or network adapters. An external monitor observes the emulated environment, flagging inputs that trigger notable events such as crashes.
Figure 2 illustrates the sequence of communications and events during a fuzzing procedure. Initially, the encryption resolver examines the target firmware using a heuristic algorithm to detect binary-level indicators that reveal the encryption method. Once identified and successfully decrypted, the firmware is transformed into the appropriate format required by the virtualization infrastructure for booting an emulated environment.
Subsequently, the virtualization infrastructure launches a new virtual machine with the decrypted firmware provided by the encryption resolver. Once the virtual machine has successfully booted—avoiding a recursive rebooting stage that typically occurs when the system fails to initialize—and begins probing peripheral devices to communicate with the expected electrical infrastructure, QEMU on the Host side notifies the fuzzing engine via a local domain socket. The fuzzing engine then begins feeding inputs into corresponding QEMU peripherals, such as serial or network ports, while continuously monitoring the virtual machine’s status.
We modify the error handler subsystem and instruction set architecture emulator in QEMU to hijack the procedure of error handling and runtime state switching to detect the runtime state and exception events. Therefore, we can determine how the virtual machine is running now in real time and handle potential upcoming machine faults and events on our own. If the emulated environment crashes, the incident is recorded, and the input responsible is flagged as an interesting seed for subsequent input generation cycles.

3.2. Design Details

3.2.1. Virtualization Infrastructure

The virtualization infrastructure is primarily built on the open-source emulator QEMU, enhanced with custom components. It allocates all the physical resources necessary to establish an emulated environment for running the target firmware. Additionally, during the boot process, it identifies the peripheral devices probed by the virtual machine, allowing the fuzzing engine to generate targeted input mutations accordingly.
QEMU enables the creation of custom emulated devices and machine architectures, allowing us to replicate full-system environments for nearly any smart IoT device. We designed and implemented dozens of emulated peripheral devices closely associated with the IoT. For instance, emulated electricity cables and equipment that support protocols such as IEC 61850 [27] are essential for electrical infrastructures.
To successfully emulate the firmware of a specific IoT device, the key requirement is that the emulated system can detect and interact with the necessary peripherals. However, these emulated devices do not need to fully replicate the functionality of their real-world counterparts. For example, running the firmware of a smart meter only requires monitoring and recording electricity usage, not a complete emulation of an electricity consumer such as a fully functional air conditioner with temperature adjustment capabilities. Consequently, our peripheral infrastructure implementations focus solely on providing the most essential functions.

3.2.2. Encryption Resolver

Compared to legacy solutions like EQUAFL that boot the firmware directly, our EncryptAFL introduces an additional stage that executes the Encryption Resolver before the beginning stage of booting. This provides us with the power to automatically and efficiently fuzz multiple types of firmware from different manufacturers compared to examples in existing work that need to manually decrypt the firmware before the fuzzing procedure. The encryption resolver is a core component of EncryptAFL that employs several custom heuristic algorithms to automatically identify and decrypt the encryption methods applied to the target firmware. A pre-established database stores identifiable indicators for various encryption algorithms, and a portion of the decryption process is integrated into the virtualization infrastructure to accelerate the booting of virtual machines with encrypted firmware.
The key to identifying encryption algorithms in target firmware is detecting distinct binary-level indicators. For example, XOR encryption typically leaves a recurring string within the firmware, as the results of calculations with zero-padded data can reveal information about the original encryption key. Another notable trait is the magic number 0 x 184 D 2204 , which appears in firmware encrypted with the LZ4 algorithm and is commonly associated with devices using u-Boot.
In our encryption resolver, we first scan the firmware for directly observable identifiers, such as magic numbers corresponding to known encryption algorithms. If no clear indicators are found, we then apply a series of heuristic algorithms to detect indirect traits, such as recurring loop strings that may hint at specific encryption methods. Since an encrypted firmware might employ multiple encryption algorithms simultaneously, we initially collect all potential indicators and perform the decryption process after this information is gathered. The complete process of our encryption resolution is detailed in Algorithm 1.
Algorithm 1 Figuring out encryption algorithms
Input: Encrypted Firmware as E F , Identifiers Set I s , Traits Set T s
Output: Decrypted Firmware as D F , Encryption Algorithm Set E A s
  1:
E A s
  2:
n i number of Identifiers in I s
  3:
n t number of Traits in T s
  4:
for i to  n i   do
  5:
   if  I s [ i ] . i d e n t E F  then
  6:
      E A s E A s   { Is[i] . a l g o }
  7:
   end if
  8:
end for
  9:
for i to  n t  do
10:
   if  T s [ i ] . i d e n t E F  then
11:
      E A s E A s   { Ts[i] . a l g o }
12:
   end if
13:
end for
14:
n e number of Algorithms in E A s
15:
D E
16:
for i to  n e   do
17:
    D F E A s [ i ] . d e c r y p t ( D F , E F )
18:
end for

3.2.3. Fuzzing Engine

The fuzzing engine orchestrates the entire fuzzing process, managing tasks such as seed mutation and VM scheduling. Rather than using traditional binary inputs, it employs operation sequences—actions like reading from or writing to specific ports—to simulate potential malicious behavior. Additionally, some components of the fuzzing engine are integrated into the virtualization infrastructure, enabling rapid transmission of inputs from emulated peripheral devices to the system within the virtual machine.
We developed a complex instruction set interpreter, called NORNIR, which serves as the core of our fuzzing engine. NORNIR defines a set of specific opcodes to represent common interactions with emulated devices and continuously reads a bytecode stream—sourced either from existing databases or from pseudo-random number generators—to generate operation sequences for the target environment.
When a bytecode stream is read from a database, it is first decoded into operation sequences used by the fuzzer to interact with the virtual machine. If no external stream is available, the system falls back on inputs generated by a pseudo-random number generator. By modifying the internal state of the PRNG, we can produce deterministic bytecode streams for the fuzzing process. If a particular bytecode stream triggers a crash, the fuzzer repeatedly executes the same input to reproduce the issue, then minimizes the input to its simplest form. This minimal input is stored in the database as a seed for further mutation. The architecture of this process is illustrated in Figure 3.

4. Evaluation

We evaluate the availability and performance of our design using our prototype implementation of EncryptAFL, aiming to address the following research questions:
  • RQ 1: How does EncryptAFL’s availability compare to state-of-the-art firmware emulation approaches such as legacy QEMU and Firmadyne?
  • RQ 2: Can we emulate malicious actions to effectively attack IoT devices?
  • RQ 3: Can we rediscover previously known vulnerabilities, such as CVE-2021-22714 [28] in Schneider’s smart meters?
To evaluate whether EncryptAFL can successfully emulate encrypted firmware (RQ 1), we tested it on encrypted firmware from 15 different smart devices. EncryptAFL successfully ran all the firmware in an emulated environment, whereas existing IoT emulators failed to achieve comparable success rates.
For RQ 2, we manually crafted exploit scripts and converted them into the bytecode format for the NORNIR interpreter, using these as initial inputs to simulate real-world cyber attacks. We selected 12 previously known vulnerabilities and successfully induced crashes on devices using variations of the original inputs.
To address RQ 3, we assembled a set of firmware images with known vulnerabilities and tested whether EncryptAFL could rediscover these flaws within a reasonable timeframe. Overall, our experiments demonstrate that EncryptAFL can effectively rediscover all the targeted vulnerabilities.

4.1. Experiment Setup

All experiments were conducted on a server equipped with an Intel Xeon Gold processor (40 cores, 80 threads) and 256 GB of RAM. The host system runs Debian 12.6 (Bookworm) with the latest software packages.

4.2. Emulating Encrypted Firmware

To demonstrate that EncryptAFL can successfully create emulated environments for encrypted firmware, we evaluated a set of firmware images from various common IoT devices. The success of emulation in this context is defined as the ability to establish an execution environment for the target firmware to finish the booting stage and initiate the first userland process like the / s b i n / i n i t for general Linux environment. We compared our implementation against several state-of-the-art emulation and virtualization tools. The emulation results are presented in Table 1.
The results indicate that none of the existing state-of-the-art tools could successfully emulate any of the encrypted firmware, whereas EncryptAFL succeeded in all cases. For unencrypted firmware, FIRM-AFL [30] and FirmAE [10] failed to emulate the Schneider NOE 771 controller, Firmadyne [29] could not run firmware from two additional routers, QEMU only succeeded on two devices, and VirtualBox [31] could not emulate any firmware directly. In contrast, EncryptAFL successfully emulated all tested firmware, demonstrating its robust capability in handling the firmware of widely used IoT devices.

4.3. Reproduction of Known Vulnerabilities

To validate our fuzzer’s capability in uncovering bugs and vulnerabilities, we selected a set of firmware images with known vulnerabilities as targets to see whether our approach could rediscover them. Given that related work typically identifies CVEs as their benchmarks, we chose several well-known CVEs for this experiment. We compared our approach to the state-of-the-art IoT fuzzer, FIRM-AFL, setting a 24 h time limit for each vulnerability discovery test. The results are presented in Table 2.
The results demonstrate that AFL-Engird was able to identify more known vulnerabilities than FIRM-AFL, highlighting EncryptAFL’s superior effectiveness in discovering security issues. However, since we do not collect metrics such as code coverage like FIRM-AFL does, our approach does not show a significant advantage in terms of fuzzing time efficiency.

4.4. Simulating Malicious Actions

To evaluate EncryptAFL’s capability to simulate malicious attacks on IoT devices, we first manually crafted exploit scripts for several previously known vulnerabilities. These scripts served as initial inputs for the NORNIR interpreter, which generated mutated operation sequences. We then observed whether these mutated inputs could cause faults or trigger reboots in the emulated environment. For each exploit script, the NORNIR interpreter was configured to produce 100 variants. The results are presented in Table 3.
The findings indicate that the NORNIR interpreter within EncryptAFL can successfully generate exploit variants that effectively attack target devices, demonstrating the tool’s ability to simulate malicious actions reflective of real-world cyber attacks.

5. Limitations and Future Work

In this section, we discuss the limitations of our current design and outline future work to further improve our system.
Feedback Mechanism. Our current implementation of EncryptAFL does not incorporate common feedback mechanisms such as code coverage monitoring to guide the fuzzing process. This omission may reduce both effectiveness and efficiency [32]. In future work, we plan to integrate these techniques to optimize the fuzzing process.
Supported Devices. Although we developed several emulated peripheral components in QEMU to facilitate a functioning emulated environment, many devices possess unique characteristics that our tool cannot currently emulate. Given the vast diversity of device-specific peripherals, manually creating a comprehensive set of emulated components is not feasible. A promising approach would be to automatically generate the required emulated peripherals by running the firmware iteratively and analyzing its interactions with physical devices.
Real-time systems. Currently, our prototype is implemented on QEMU that does not provide real-time guarantees by default, which means that out approach might not be applicable to real-time systems. However, although we do not have native support for the real-time systems, as our emulation system is based on the QEMU, we can easily adopt open-source solutions like RT-QEMU from communities to integrate such features into our approach.
Hardware-assisted virtualization acceleration. Though we did not employ hardware-assisted virtualization techniques in our prototype yet, they are not difficult to integrate into our approach. As our system is built on QEMU, a state-of-the-art full-system emulation approach designed to be able to integrate firmly with KVM, our prototype is eligible to employ existing hardware-assisted virtualization solutions like using real physical peripherals to accelerate peripheral emulation with techniques including IOMMU and Virt-IO.
Complex Encryption Strategies. Our heuristic algorithms have enabled us to automatically decrypt many encrypted firmware images. However, some newer devices employ more complex encryption schemes, such as multi-stage encryption chains, that remain challenging to decrypt with our current methods. Addressing these cases often requires significant manual effort and deep expertise. We believe that advanced artificial intelligence techniques, such as large language models, may offer valuable assistance in overcoming these challenges.

6. Conclusions

In this paper, we present a comprehensive design for emulating the firmware of smart IoT devices and discovering their vulnerabilities. Compared to existed IoT-fuzzing approaches, we introduce an additional encryption solver to automatically detect the encryption algorithm in firmware with heuristic strategies which grant us with the power to emulate encrypted IoT firmware without manual decryption work. We evaluate both the effectiveness and efficiency of our approach on a set of selected firmware images and known bugs. Compared to state-of-the-art emulators, EncryptAFL successfully emulates a broader range of firmware in diverse scenarios and rediscovers more vulnerabilities than leading IoT fuzzers. Despite these advances, our current implementation has limitations that warrant further improvement, which we outline as future work for continued optimization.

Author Contributions

Conceptualization, Z.X. and Y.D.; Methodology, Z.X., Y.D. and S.L.; Validation, Z.X. and L.T.; Formal analysis, Y.D.; Investigation, Y.D.; Writing—original draft, Z.X.; Writing—review & editing, Y.D., L.T. and S.L.; Supervision, L.T. and S.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Sullivan, J.E.; Kamensky, D. How cyber-attacks in Ukraine show the vulnerability of the U.S. power grid. Electr. J. 2017, 30, 30–35. [Google Scholar] [CrossRef]
  2. Sheng, C.; Zhou, W.; Han, Q.L.; Ma, W.; Zhu, X.; Wen, S.; Xiang, Y. Network Traffic Fingerprinting for IIoT Device Identification: A Survey. IEEE Trans. Ind. Inform. 2025, 21, 3541–3554. [Google Scholar] [CrossRef]
  3. Zhang, H.; Lu, K.; Zhou, X.; Yin, Q.; Wang, P.; Yue, T. SIoTFuzzer: Fuzzing Web Interface in IoT Firmware via Stateful Message Generation. Appl. Sci. 2021, 11, 3120. [Google Scholar] [CrossRef]
  4. Yun, J.; Rustamov, F.; Kim, J.; Shin, Y. Fuzzing of Embedded Systems: A Survey. ACM Comput. Surv. 2022, 55, 137. [Google Scholar] [CrossRef]
  5. Zheng, Y.; Li, Y.; Zhang, C.; Zhu, H.; Liu, Y.; Sun, L. Efficient greybox fuzzing of applications in Linux-based IoT devices via enhanced user-mode emulation. In Proceedings of the the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2022), Virtual, 18–22 July 2022; pp. 417–428. [Google Scholar] [CrossRef]
  6. Yin, Q.; Zhou, X.; Zhang, H. FirmHunter: State-Aware and Introspection-Driven Grey-Box Fuzzing towards IoT Firmware. Appl. Sci. 2021, 11, 9094. [Google Scholar] [CrossRef]
  7. Srivastava, P.; Peng, H.; Li, J.; Okhravi, H.; Shrobe, H.; Payer, M. FirmFuzz: Automated IoT Firmware Introspection and Analysis. In Proceedings of the 2nd International ACM Workshop on Security and Privacy for the Internet-of-Things (IoT S&P’19), London, UK, USA, 15 November 2019; pp. 15–21. [Google Scholar] [CrossRef]
  8. Zhu, X.; Wen, S.; Camtepe, S.; Xiang, Y. Fuzzing: A Survey for Roadmap. ACM Comput. Surv. 2022, 54, 230. [Google Scholar] [CrossRef]
  9. Eceiza, M.; Flores, J.L.; Iturbe, M. Fuzzing the Internet of Things: A Review on the Techniques and Challenges for Efficient Vulnerability Discovery in Embedded Systems. IEEE Internet Things J. 2021, 8, 10390–10411. [Google Scholar] [CrossRef]
  10. Kim, M.; Kim, D.; Kim, E.; Kim, S.; Jang, Y.; Kim, Y. FirmAE: Towards Large-Scale Emulation of IoT Firmware for Dynamic Analysis. In Proceedings of the 36th Annual Computer Security Applications Conference (ACSAC’20), Austin, TX, USA, 7–11 December 2020; pp. 733–745. [Google Scholar] [CrossRef]
  11. Uhlig, R.; Neiger, G.; Rodgers, D.; Santoni, A.L.; Martins, F.C.; Anderson, A.V.; Bennett, S.M.; Kagi, A.; Leung, F.H.; Smith, L. Intel virtualization technology. Computer 2005, 38, 48–56. [Google Scholar] [CrossRef]
  12. Waldspurger, C.; Rosenblum, M. I/o virtualization. Commun. ACM 2012, 55, 66–73. [Google Scholar] [CrossRef]
  13. Rodríguez-Haro, F.; Freitag, F.; Navarro, L.; Hernánchez-sánchez, E.; Farías-Mendoza, N.; Guerrero-Ibáñez, J.A.; González-Potes, A. A summary of virtualization techniques. Procedia Technol. 2012, 3, 267–272. [Google Scholar] [CrossRef]
  14. Chiueh, S.N.T.c.; Brook, S. A survey on virtualization technologies. RPE Rep. 2005, 142. [Google Scholar]
  15. Bellard, F. QEMU, a fast and portable dynamic translator. In Proceedings of the Annual Conference on USENIX Annual Technical Conference (ATEC’05), Anaheim, CA, USA, 10–15 April 2005; USENIX Association: Berkeley, CA, USA, 2005. [Google Scholar]
  16. Feng, X.; Zhu, X.; Han, Q.L.; Zhou, W.; Wen, S.; Xiang, Y. Detecting Vulnerability on IoT Device Firmware: A Survey. IEEE/CAA J. Autom. Sin. 2023, 10, 25–41. [Google Scholar] [CrossRef]
  17. Liang, H.; Pei, X.; Jia, X.; Shen, W.; Zhang, J. Fuzzing: State of the art. IEEE Trans. Reliab. 2018, 67, 1199–1218. [Google Scholar] [CrossRef]
  18. Li, J.; Zhao, B.; Zhang, C. Fuzzing: A survey. Cybersecurity 2018, 1, 1–13. [Google Scholar] [CrossRef]
  19. Zhou, W.; Zhu, X.; Han, Q.L.; Li, L.; Chen, X.; Wen, S.; Xiang, Y. The security of using large language models: A survey with emphasis on ChatGPT. IEEE/CAA J. Autom. Sin. 2024, 12, 1–26. [Google Scholar] [CrossRef]
  20. Godefroid, P.; Levin, M.Y.; Molnar, D.A. Automated whitebox fuzz testing. In Proceedings of the NDSS, San Diego, CA, USA, 10–13 February 2008; Volume 8, pp. 151–166. [Google Scholar]
  21. Zhu, X.; Zhou, W.; Han, Q.L.; Ma, W.; Wen, S.; Xiang, Y. When Software Security Meets Large Language Models: A Survey. IEEE/CAA J. Autom. Sin. 2024, 12, 317–334. [Google Scholar] [CrossRef]
  22. Godefroid, P. Random testing for security: Blackbox vs. whitebox fuzzing. In Proceedings of the 2nd International Workshop on Random Testing: Co-Located with the 22nd IEEE/ACM International Conference on Automated Software Engineering (ASE 2007), Atlanta, GA, USA, 6 November 2007; p. 1. [Google Scholar]
  23. Shu, Z.; Yan, G. IoTInfer: Automated Blackbox Fuzz Testing of IoT Network Protocols Guided by Finite State Machine Inference. IEEE Internet Things J. 2022, 9, 22737–22751. [Google Scholar] [CrossRef]
  24. Böhme, M.; Pham, V.T.; Nguyen, M.D.; Roychoudhury, A. Directed greybox fuzzing. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, Dallas, TX, USA, 30 October–3 November 2017; pp. 2329–2344. [Google Scholar]
  25. Choi, B.C.; Lee, S.H.; Na, J.C.; Lee, J.H. Secure firmware validation and update for consumer devices in home networking. IEEE Trans. Consum. Electron. 2016, 62, 39–44. [Google Scholar] [CrossRef]
  26. Nadir, I.; Mahmood, H.; Asadullah, G. A taxonomy of IoT firmware security and principal firmware analysis techniques. Int. J. Crit. Infrastruct. Prot. 2022, 38, 100552. [Google Scholar] [CrossRef]
  27. IEC 61850; Communication Networks and Systems for Power Utility Automation. International Electrotechnical Commission (IEC): Geneva, Switzerland, 2004.
  28. CVE-2021-22714; Improper Restriction of Operations Within the Bounds of a Memory Buffer Vulnerability in Schneider Electric PowerLogic ION7400, PM8000, and ION9000 Devices (All Versions Prior to V3.0.0). National Institute of Standards and Technology (NIST): Gaithersburg, MD, USA, 2021.
  29. Chen, D.D.; Woo, M.; Brumley, D.; Egele, M. Towards automated dynamic analysis for linux-based embedded firmware. In Proceedings of the NDSS, San Diego, CA, USA, 21–24 February 2016; Volume 1, p. 1. [Google Scholar]
  30. Zheng, Y.; Davanian, A.; Yin, H.; Song, C.; Zhu, H.; Sun, L. FIRM-AFL: High-Throughput Greybox Fuzzing of IoT Firmware via Augmented Process Emulation. In Proceedings of the 28th USENIX Security Symposium (USENIX Security 19), Santa Clara, CA, USA, 14–16 August 2019; pp. 1099–1114. [Google Scholar]
  31. Oracle, V. VirtualBox; Oracle Corporation: Austin, TX, USA, 2015. [Google Scholar]
  32. Feng, X.; Sun, R.; Zhu, X.; Xue, M.; Wen, S.; Liu, D.; Nepal, S.; Xiang, Y. Snipuzz: Black-box fuzzing of iot firmware via message snippet inference. In Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security, Virtual, 15–19 November 2021; pp. 337–350. [Google Scholar]
Figure 1. High-level overview of the EncryptAFL architecture.
Figure 1. High-level overview of the EncryptAFL architecture.
Electronics 14 02537 g001
Figure 2. Overview of the EncryptAFL’s fuzzing procedure.
Figure 2. Overview of the EncryptAFL’s fuzzing procedure.
Electronics 14 02537 g002
Figure 3. Workflow of the NORNIR interpreter in EncryptAFL.
Figure 3. Workflow of the NORNIR interpreter in EncryptAFL.
Electronics 14 02537 g003
Table 1. Result of emulating firmware of different devices.
Table 1. Result of emulating firmware of different devices.
EmulatorEncrypted
Firmware
EncryptAFLQEMUVirtualBoxFirmadyne [29]FIRM-AFL [30]FirmAE [10]
Devices
D-Link DIR-882Y
D-Link DIR-3040Y
D-Link DIR-3060Y
DrayTek Vigor2962Y
MOXA AWK-3131AY
MOXA AWK-3121Y
Tenda AC8 v5.0Y
TB WR1800K MT7621Y
Siemems 9410 PAC metersN
Cisco RV34XN
TOTOLINK NR1800XPN
Trendnet TEW-632BRPN
D-Link DIR-825N
TPLink WR940NN
Schneider NOE 771N
Table 2. Result of simulating malicious attacks.
Table 2. Result of simulating malicious attacks.
CVE NumberDeviceEncryptAFL FoundEncryptAFL
Time to Crash
FIRM-AFL FoundFIRM-AFL
Time to Crash
CVE-2013-0230Trendnet TEW-632BRP10 h 21 min9 h 13 min
CVE-2016-1558D-Link DAP-26951 h 48 min2 h 53 min
CVE-2017-3193D-Link DIR-850L2 h 16 min1 h 29 min
CVE-2017-5164BINOM3 Electric Power Quality Meter6 h 4 minN/A
CVE-2017-5166BINOM3 Electric Power Quality Meter15 h 31 minN/A
CVE-2018-8941D-Link DSL-37821 h10 min24 min 37 s
CVE-2018-19241Trendnet TV-IP110WN3 h 26 min4 h 45 min
CVE-2021-44165Simen SICAM Q1005 h 24 minN/A
CVE-2022-43439Simen SICAM Q1008 h 46 minN/A
CVE-2022-43545Simen SICAM Q10012 h 7 minN/A
CVE-2023-30901Simen SICAM Q1004 h 33 minN/A
CVE-2023-31238Simen SICAM Q1007 h 21 minN/A
Table 3. Result of simulating malicious attacks.
Table 3. Result of simulating malicious attacks.
CVE NumberDeviceSuccessSuccessful Input Variants
CVE-2013-0230Trendnet TEW-632BRP23
CVE-2016-1558D-Link DAP-269545
CVE-2017-3193D-Link DIR-850L16
CVE-2017-5164BINOM3 Electric Power Quality Meter37
CVE-2017-5166BINOM3 Electric Power Quality Meter21
CVE-2018-8941D-Link DSL-378286
CVE-2018-19241Trendnet TV-IP110WN92
CVE-2021-44165Simen SICAM Q10065
CVE-2022-43439Simen SICAM Q10047
CVE-2022-43545Simen SICAM Q10052
CVE-2023-30901Simen SICAM Q10071
CVE-2023-31238Simen SICAM Q10033
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Xu, Z.; Ding, Y.; Tian, L.; Liu, S. Emulation-Based Fuzzing of Encrypted Firmware. Electronics 2025, 14, 2537. https://doi.org/10.3390/electronics14132537

AMA Style

Xu Z, Ding Y, Tian L, Liu S. Emulation-Based Fuzzing of Encrypted Firmware. Electronics. 2025; 14(13):2537. https://doi.org/10.3390/electronics14132537

Chicago/Turabian Style

Xu, Zhiyu, Yong Ding, Liwei Tian, and Suping Liu. 2025. "Emulation-Based Fuzzing of Encrypted Firmware" Electronics 14, no. 13: 2537. https://doi.org/10.3390/electronics14132537

APA Style

Xu, Z., Ding, Y., Tian, L., & Liu, S. (2025). Emulation-Based Fuzzing of Encrypted Firmware. Electronics, 14(13), 2537. https://doi.org/10.3390/electronics14132537

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop