CN113591141A - Firmware image file flash verification method, system and terminal based on fuzzy test - Google Patents

Firmware image file flash verification method, system and terminal based on fuzzy test Download PDF

Info

Publication number
CN113591141A
CN113591141A CN202110590633.2A CN202110590633A CN113591141A CN 113591141 A CN113591141 A CN 113591141A CN 202110590633 A CN202110590633 A CN 202110590633A CN 113591141 A CN113591141 A CN 113591141A
Authority
CN
China
Prior art keywords
firmware
image file
firmware image
flash
tested
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110590633.2A
Other languages
Chinese (zh)
Other versions
CN113591141B (en
Inventor
赵淼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yingxin Computer Technology Co Ltd
Original Assignee
Shandong Yingxin Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yingxin Computer Technology Co Ltd filed Critical Shandong Yingxin Computer Technology Co Ltd
Priority to CN202110590633.2A priority Critical patent/CN113591141B/en
Publication of CN113591141A publication Critical patent/CN113591141A/en
Application granted granted Critical
Publication of CN113591141B publication Critical patent/CN113591141B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The application discloses a firmware image file flash verification method, a system and a terminal based on fuzzy test, wherein the method comprises the following steps: establishing a data model according to a UEFI file system structure; identifying the firmware image file to be detected by using a data model; modifying each segment in the firmware image file to be tested in sequence by adopting a fuzzy test method to form N mutated firmware image files to be tested; flashing the first firmware to the target hardware; judging whether firmware flash security holes exist in the target hardware according to the flash result; if so, positioning the fragment which is not subjected to the validity check in the firmware image file to be detected according to the first firmware which is not subjected to the validity check. The system comprises: the device comprises a data model establishing module, an identification module, a variation module, a flash module, a judgment module and a positioning module. The terminal includes: a processor and a memory communicatively coupled to the processor. Through the method and the device, the accuracy of vulnerability detection can be effectively improved.

Description

Firmware image file flash verification method, system and terminal based on fuzzy test
Technical Field
The application relates to the technical field of computer security penetration testing, in particular to a firmware image file flash verification method, a firmware image file flash verification system and a firmware image file flash verification terminal based on fuzzy testing.
Background
With the rapid development of information technologies such as 5G, Internet of things, industrial Internet, intelligent manufacturing and smart home, users have higher and higher requirements on the security of computers, including software security and firmware security. Compared with software security, the life cycle of firmware security vulnerabilities is often longer, and the factors that cause firmware security vulnerabilities are many, for example: platform configuration errors, platform update lag, lack of user awareness of firmware security, etc.
In firmware security, firmware flush security is an important item. Firmware flashing refers to the process of writing new firmware into target hardware to replace the original firmware. The firmware flash security can prevent hackers from writing the maliciously tampered firmware image file into target hardware, so that major security consequences such as denial of service, buffer overflow, remote code execution and the like are avoided, and therefore, how to verify the firmware image file flash is very important.
At present, a method for verifying firmware image file flash is generally: and modifying any content in the firmware through an editor, storing the modifications, attempting to use the maliciously modified firmware for flash, and finally checking whether a security vulnerability exists, thereby determining a verification mechanism and a verification effect of the target host.
However, in the current method for checking the firmware image file flash, there is a possibility that a user may: some firmware functions have a verification requirement, other firmware functions do not have a verification requirement, and when the security vulnerability is judged to exist, the verification mechanism and the verification effect of the target host can be determined to have problems; when it is determined that there is no security vulnerability, it may be that there is no security vulnerability due to the fact that the user has no verification requirement for some firmware, and at this time, it cannot be determined whether the verification mechanism of the target host functions and how the verification effect is. Therefore, the accuracy of the verification result is not high enough in the existing method for verifying the firmware image file by flashing.
Moreover, because the firmware is a file in a binary format, and the content and the structure of the firmware cannot be identified by security penetration testing personnel, the content of the firmware modified by an editor has no pertinence, the relationship between the modified content and the firmware structure cannot be judged, even if the security vulnerability is judged to exist, the vulnerability cannot be accurately positioned, and the problem that the accuracy of the verification result is not high enough is also caused.
Disclosure of Invention
The application provides a firmware image file flash verification method, a firmware image file flash verification system and a firmware image file flash verification terminal based on fuzzy test, and aims to solve the problem that the accuracy of a verification result is not high enough by a verification method in the prior art.
In order to solve the technical problem, the embodiment of the application discloses the following technical scheme:
a firmware image file flash verification method based on fuzzy test comprises the following steps:
establishing a data model for describing the structure composition of a Firmware image file according to a Unified Extensible Firmware Interface (UEFI) file system structure, wherein in the data model, the Firmware image file is divided into N segments, and each segment keeps an independent function in the Firmware image file, wherein N is a natural number and is more than or equal to 2;
identifying the firmware image file to be detected by using the data model;
after the firmware image file to be tested is identified, modifying each segment in the firmware image file to be tested in sequence by adopting a fuzzy test method to form N mutated firmware image files to be tested;
according to whether the function of the firmware image file to be tested needs to be subjected to validity check or not, a first firmware is written to target hardware in a flashing mode, wherein the first firmware is the firmware image file to be tested after variation corresponding to the function needing to be subjected to validity check;
judging whether the target hardware has firmware flashing security holes or not according to the flashing result;
if so, positioning the fragment which is not subjected to the validity check in the firmware image file to be detected according to the first firmware which is not subjected to the validity check.
Optionally, the method for identifying the firmware image file to be tested by using the data model includes:
packaging the data model as a computer program having a particular format, the particular format comprising: mapping relationships between fragments and functions;
and identifying the format of the firmware image file to be detected by using the computer program.
Optionally, the segment is a minimum unit of the firmware image file that maintains independent functionality.
Optionally, after modifying each segment in the firmware image file to be tested in sequence by using a fuzzy test method to form N mutated firmware image files to be tested, the method further includes:
and storing the N mutated firmware image files to be tested.
Optionally, the flushing the first firmware to the target hardware according to whether the function of the firmware image file to be tested needs to be legally checked includes:
determining a function which needs to be subjected to legality verification and a function which does not need to be subjected to legality verification in a firmware image file to be detected;
defining a mutated firmware image file corresponding to a function needing to be subjected to legality verification as a first firmware, and defining a mutated firmware image file corresponding to a function needing not to be subjected to legality verification as a second firmware;
the first firmware is flushed to the target hardware.
Optionally, the determining whether the target hardware has a firmware flush security hole according to the flush result includes:
summarizing the flash result of the first firmware, and determining the result of lack of validity check;
judging whether the quantity M of the lack of the validity check results meets the following conditions: m is more than or equal to 1 and is a natural number or O;
if so, judging that the target hardware has firmware flash security holes;
and if not, judging that the target hardware does not have firmware flashing security holes.
Optionally, the positioning, according to the first firmware which is not subjected to the validity check, a fragment which is not subjected to the validity check in the firmware image file to be tested includes:
determining a first firmware matched with the result of lack of validity check;
viewing the modified segments in the first firmware that match the result;
and taking the modified segment in the first firmware as a segment which is not subjected to validity check in the firmware image file to be detected.
A firmware image file flash verification system based on fuzz testing, the system comprising:
the data model establishing module is used for establishing a data model for describing the structure composition of the firmware image file according to a UEFI file system structure, wherein in the data model, the firmware image file is divided into N segments, and each segment keeps an independent function in the firmware image file, wherein N is a natural number and is more than or equal to 2;
the identification module is used for identifying the firmware image file to be detected by utilizing the data model;
the variation module is used for modifying each segment in the firmware image file to be tested in sequence by adopting a fuzzy test method after identifying the firmware image file to be tested to form N varied firmware image files to be tested;
the flash module is used for flashing the first firmware to the target hardware according to whether the function of the firmware image file to be tested needs to be subjected to validity check or not, wherein the first firmware is the firmware image file to be tested after variation corresponding to the function needing to be subjected to validity check;
the judging module is used for judging whether firmware flash security holes exist in the target hardware or not according to the flash result;
and the positioning module is used for positioning the fragments which are not subjected to the legality verification in the firmware image file to be detected according to the first firmware which is not subjected to the legality verification when the target hardware has the firmware flash security loophole.
Optionally, the system further includes: and the storage module is used for storing the N mutated firmware image files to be tested.
A terminal, the terminal comprising: a processor, and a memory communicatively coupled to the processor, wherein,
the memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the processor to execute the firmware image file flash verification method based on the fuzz test.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
the method comprises the steps of firstly, establishing a data model according to a UEFI file system structure, wherein the data model is used for describing the structure composition of a firmware image file, dividing the firmware image file into N segments, and keeping each segment with an independent function; secondly, identifying the firmware image file to be detected by using the data model; after the firmware image file to be tested is identified, modifying each segment in the firmware image file to be tested in sequence by adopting a fuzzy test method to form N mutated firmware image files to be tested; according to whether the function of the firmware image file to be tested needs to be subjected to validity check or not, the first firmware is written to the target hardware in a flashing mode; then judging whether firmware flash security holes exist in the target hardware according to the flash result; and if the security loophole exists, positioning the fragments which are not subjected to the legality check in the firmware image file to be detected according to the first firmware which is not subjected to the legality check.
In the data model established according to the UEFI file system structure, the firmware image file is segmented according to the independent function, so that the self format of the firmware image file can be analyzed. The content and the structure of the firmware can be identified in a targeted manner during subsequent vulnerability detection and vulnerability positioning, and an effective basis is provided for the subsequent vulnerability detection and positioning, so that the vulnerability detection accuracy is greatly improved. After the firmware image file to be tested is identified, each segment in the firmware image file to be tested is modified in sequence by adopting a fuzzy test method, the fuzzy test is applied to the firmware image file flash check vulnerability detection, and the random unexpected data modification of each segment in the firmware image file can better simulate the attack behavior of hackers on malicious tampering of the firmware image file, thereby being beneficial to further improving the accuracy of the test result and the test coverage rate. The embodiment also performs the validity check according to whether the function of the firmware image file to be checked needs to perform the validity check, and writes the first firmware to the target hardware, that is, only writes the first firmware matched with the validity check function to the target hardware, but does not write the second firmware with the function not required to perform the validity check. After the firmware flashing security vulnerability of the target hardware is judged, the fragment which is not subjected to the validity check in the firmware image file to be detected is positioned according to the first firmware which is not subjected to the validity check, so that the accuracy and the checking efficiency of the firmware image file flashing check are further improved, and the powerful guarantee is provided for the follow-up bug repairing. In addition, because the embodiment can locate the segment which is not subjected to the validity check in the firmware image file to be detected, the corresponding relation between the modified content and the firmware structure can be accurately judged, the fault location is directly carried out from the aspects of the content and the structure of the firmware, and the location accuracy and the location precision are higher.
The application also provides a firmware image file flash verification system based on the fuzzy test, which mainly comprises: the device comprises a data model establishing module, an identification module, a variation module, a flash module, a judgment module and a positioning module. The firmware image file can be segmented according to independent functions through the data model building module, so that the self format of the firmware image file is analyzed. The content and the structure of the firmware can be identified in a targeted manner during subsequent vulnerability detection and vulnerability positioning, and an effective basis is provided for the subsequent vulnerability detection and positioning, so that the vulnerability detection accuracy is greatly improved. The established data model can be used for accurately identifying the firmware image file to be detected through the identification module. Through the variation module, each segment in the firmware image file to be tested can be modified in sequence by adopting a fuzzy test method, so that N varied firmware image files to be tested are formed, the attack behavior of malicious tampering of the firmware image file by a hacker can be better simulated by applying the fuzzy test method in the variation module, the accuracy of a test result is favorably improved, and the uncertainty of the fuzzy test is favorably improved in the test coverage rate. Through the flash module, whether the function of the firmware image file to be detected needs to be subjected to legality verification or not can be determined, the first firmware is flashed to the target hardware, and the flash module is arranged, so that the system is limited to flash the first firmware, the second firmware matched with the legality verification function is prevented from being flashed to the target hardware, the flash quantity of the firmware can be effectively reduced, the flash time of the firmware is reduced, and the flash verification efficiency of the firmware image file is improved. Whether the firmware flash security vulnerability exists in the target hardware can be accurately judged through the judging module. Through the positioning module, the vulnerability can be further positioned under the condition that the firmware flash security vulnerability exists in the target hardware, so that the accuracy and precision of flash verification of the firmware image file are further improved. Moreover, in the embodiment, the fragments which are not subjected to the validity check in the firmware image file to be detected can be accurately positioned, the fault positioning is directly performed from the aspects of the content and the structure of the firmware, and the positioning accuracy is higher. And the positioning mode of the positioning module can accurately judge the corresponding relation between the modified content and the firmware structure, is favorable for providing powerful guarantee for subsequent bug repair, and improves the efficiency of flash verification of the firmware image file and the market competitive value.
The application also provides a terminal, and the terminal also has the technical effects corresponding to the firmware image file flash verification method and system based on the fuzzy test, and the details are not repeated herein.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a firmware image file flash verification method based on a fuzzy test according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a firmware image file flash verification system based on a fuzz test according to an embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
For a better understanding of the present application, embodiments of the present application are explained in detail below with reference to the accompanying drawings.
Example one
Referring to fig. 1, fig. 1 is a schematic flowchart of a firmware image file flash verification method based on a fuzz test according to an embodiment of the present disclosure. As shown in fig. 1, the firmware image file flash verification method based on the fuzzy test in this embodiment mainly includes the following steps:
s1: and establishing a data model for describing the structure composition of the firmware image file according to the UEFI file system structure.
In the data model established in this embodiment, the firmware image file is divided into N segments, and each segment maintains an independent function in the firmware image file, where N is a natural number and N ≧ 2.
That is, in the present embodiment, the firmware image file is segmented according to the independent function by establishing the data model, and each segment has its own independent function in the firmware image file. By means of segmentation, the self format of the firmware image file can be analyzed, the content and the structure of the firmware can be identified in a targeted manner during subsequent vulnerability detection and vulnerability positioning, and an effective basis is provided for the subsequent vulnerability detection and positioning, so that the accuracy of vulnerability detection and the vulnerability detection efficiency are greatly improved.
Further, in this embodiment, the segment obtained by segmenting the firmware image file is the minimum unit for keeping the independent function in the firmware image file. The firmware image file is divided into the minimum units, so that the segmentation degree of the firmware image file can be minimized on the premise of ensuring that the flash verification of the firmware image file is smoothly carried out, a basis is provided for subsequent vulnerability positioning from the aspect of firmware structure, and the vulnerability detection accuracy is further improved.
With continued reference to fig. 1, after the data model is built, step S2 is executed: and identifying the firmware image file to be detected by using the data model.
Specifically, step S2 includes the following processes:
s21: packaging the data model into a computer program having a specific format, wherein the specific format comprises: mapping between fragments and functions.
S22: and identifying the format of the firmware image file to be tested by using a computer program.
As can be seen from the above steps S21 and S22, in this embodiment, after the data model is created, the data model is described in the computer language and is packaged into a computer program, and the computer program can correctly identify the format of the firmware image file to be tested.
After the firmware image file to be tested is identified, step S3 is executed: and modifying each segment in the firmware image file to be tested in sequence by adopting a fuzzy test method to form N mutated firmware image files to be tested.
Step S1 shows that the firmware image file can be divided into N segments by the data model, and each segment in the firmware image file to be tested is modified in step S3, where each modification only involves one segment in the firmware image file to be tested, N segments generate N mutated firmware image files to be tested, and one modified segment corresponds to one mutated firmware image file to be tested. Because each segment maintains an independent function in the firmware image file, the N segments correspond to N functions, and each mutated firmware image file to be tested corresponds to a different function.
Fuzz testing is a method of discovering software bugs by providing target systems with unexpected inputs that are not logical, and monitoring for anomalous results, where automatic fuzz testing does not guess which data will cause damage, but rather puts as much of the messy data into the program as possible, and thus the anomalous results discovered by fuzz testing tend to be unexpected to the developer's expectations. By using the fuzzy test, important bugs in the program can be revealed, error modes in the real world can be verified, and potential problems to be repaired can be displayed before the product is released.
In the embodiment, each segment in the firmware image file to be tested is modified in sequence by adopting a fuzzy test method, so that the attack behavior that a hacker maliciously tampers the firmware image file can be simulated more accurately, the accuracy of the test result is further improved, the unexpected characteristic of the test is simulated, the coverage rate of the verification test can be improved, and the improvement of the test accuracy is facilitated.
Further, after the N mutated firmware image files to be tested are formed, the present embodiment further includes step S4: and storing the N mutated firmware image files to be tested.
Specifically, the saving operation in this embodiment is executed after each modification operation, that is, after any segment in the firmware image file to be tested is modified, a mutated firmware image file to be tested is formed, and at this time, the mutated firmware image file to be tested is immediately saved. And by analogy, modifying the next segment in the firmware image file to be tested by adopting a fuzzy test method, and storing the varied firmware image file to be tested corresponding to the next segment until the N segments are modified.
As can be seen from fig. 1, after each segment in the firmware image to be tested is modified in sequence by using the fuzzy test method to form N mutated firmware image to be tested, step S5 is executed: and according to whether the function of the firmware image file to be tested needs to be subjected to validity check, the first firmware is written to the target hardware in a flashing way.
The first firmware is a mutated firmware image file corresponding to a function needing validity check.
Specifically, step S5 includes the following process:
s51: and determining the function which needs to be subjected to the legality check and the function which does not need to be subjected to the legality check in the firmware image file to be tested.
According to the method and the device, which functions in the firmware image file to be tested need to be subjected to validity check and which functions do not need to be subjected to validity check are confirmed according to user requirements.
S52: and defining the mutated firmware image file to be tested corresponding to the function needing to be subjected to the validity check as a first firmware, and defining the mutated firmware image file to be tested corresponding to the function needing not to be subjected to the validity check as a second firmware.
S53: the first firmware is flushed to the target hardware.
That is, for the function that needs to be legally checked, the corresponding mutated firmware image file to be tested does not need to be subjected to firmware flashing, and only the mutated firmware image file to be tested matched with the function that needs to be legally checked is subjected to flashing. In the embodiment, only the first firmware is flushed to the target hardware, so that the number of the firmware needing to be flushed can be reduced, the firmware flushing time and the firmware flushing verification time are saved, and the firmware image file flushing verification efficiency is further improved.
S6: and judging whether the target hardware has firmware flashing security holes or not according to the flashing result.
Specifically, step S6 includes the following processes:
s61: the flash results of the first firmware are aggregated and the lack of a result of the validity check is determined.
In this embodiment, because the second firmware is not flashed, when the flashing result is summarized, the second firmware flashing result can be directly defined as: by, i.e., defining that the second firmware does not exhibit the result of lack of validity checking. The method for only summarizing the first firmware flash result can further improve the flash verification efficiency of the firmware image file.
S62: judging whether the quantity M of the lack of the validity check results meets the following conditions: m is more than or equal to 1 and is a natural number or O.
If the number M of missing validity check results satisfies: if M is greater than or equal to 1, go to step S63: and judging that the target hardware has firmware flash security holes.
If the number M of missing validity check results is < 1, that is, M is 0, that is, no result of missing validity check occurs, step S64 is executed: and judging that the target hardware does not have firmware flash security holes.
In this embodiment, a method for determining whether a firmware flush security vulnerability exists in target hardware according to a flush result may be shown in table 1 below.
Figure BDA0003089381400000091
Table 1 statistical table for determining whether firmware flash security hole exists in target hardware
As can be seen from table 1, the N mutated firmware image files to be tested, referred to as mutated firmware for short, correspond to the N modified segments, and further correspond to the N functions of the firmware image files to be tested. And determining which functions in the firmware image file to be tested need to be subjected to legality verification according to the actual conditions of the user, and judging that the experimental result of the variant firmware corresponding to the functions which do not need to be subjected to legality verification passes, wherein the experimental result is represented by NA. And finally comparing the output N flash verification results of the firmware image files to be tested, and finally judging that the firmware flash security loopholes exist in the firmware image files to be tested as long as one or more functions needing to be subjected to the legitimacy verification lack the legitimacy verification. The variant firmware 2 in table 1 needs to be subjected to validity check, and lacks a validity check result, so the final conclusion is: failing.
With continued reference to fig. 1, after determining that the target hardware has a firmware flush security hole, step S7 is executed: and positioning the fragments which are not subjected to the validity check in the firmware image file to be detected according to the first firmware which is not subjected to the validity check.
Specifically, step S7 includes the following process:
s71: and determining the first firmware matched with the result of the lack of validity check.
S72: the modified segment in the first firmware that matches the result is viewed.
S73: and taking the modified segment in the first firmware as a segment which is not subjected to validity check in the firmware image file to be detected.
As can be seen from the steps S71-S73, in this embodiment, after it is determined that the target hardware has the firmware flash security bug, the security bug is also accurately located, which is beneficial to further improving the accuracy of flash verification of the firmware image file to be detected, and can provide a powerful guarantee for subsequent bug repair, and is beneficial to improving user experience and market competitive value.
Example two
Referring to fig. 2 based on the embodiment shown in fig. 1, fig. 2 is a schematic structural diagram of a firmware image file flash verification system based on fuzz testing according to an embodiment of the present disclosure.
As can be seen from fig. 2, the firmware image file flashing verification system based on the fuzz test in this embodiment mainly includes: the device comprises a data model establishing module, an identification module, a variation module, a flash module, a judgment module and a positioning module. The data model establishing module is used for establishing a data model for describing the structure composition of the firmware image file according to a UEFI file system structure, wherein in the data model, the firmware image file is divided into N segments, each segment keeps an independent function in the firmware image file, N is a natural number and is more than or equal to 2, and the segment is a minimum unit for keeping the independent function in the firmware image file; the identification module is used for identifying the firmware image file to be detected by using the data model; the variation module is used for modifying each segment in the firmware image file to be tested in sequence by adopting a fuzzy test method after identifying the firmware image file to be tested to form N varied firmware image files to be tested; the flash module is used for flashing the first firmware to the target hardware according to whether the function of the firmware image file to be tested needs to be subjected to validity check or not, wherein the first firmware is the firmware image file to be tested after variation corresponding to the function needing to be subjected to validity check; the judging module is used for judging whether firmware flash security holes exist in the target hardware or not according to the flash result; and the positioning module is used for positioning the fragments which are not subjected to the legality verification in the firmware image file to be detected according to the first firmware which is not subjected to the legality verification when the target hardware has the firmware flash security loophole.
Further, the identification module includes: a packaging unit and an identification unit. The packaging unit is used for packaging the data model into a computer program with a specific format, and the specific format comprises: mapping relationships between fragments and functions; and the identification unit is used for identifying the format of the firmware image file to be detected by utilizing the computer program.
The flash module includes: the device comprises a function confirmation unit, a definition unit and a flash unit. The function confirmation unit is used for determining a function which needs to be subjected to validity check and a function which does not need to be subjected to validity check in the firmware image file to be detected; the definition unit is used for defining the mutated firmware image file to be detected corresponding to the function needing to be subjected to the validity check as a first firmware and defining the mutated firmware image file to be detected corresponding to the function needing not to be subjected to the validity check as a second firmware; and the flash unit is used for flashing the first firmware to the target hardware.
The judging module comprises: a collecting unit and a judging unit. The collecting unit is used for collecting the flash result of the first firmware and determining the result lacking in validity check; a judging unit, configured to judge whether the number M of missing validity check results satisfies: and M is more than or equal to 1 and is a natural number or O, if so, the target hardware is judged to have firmware flash security holes, and otherwise, the target hardware is judged to have no firmware flash security holes.
The positioning module includes: the device comprises a firmware determining unit, a viewing unit and a fragment positioning unit. The firmware determining unit is used for determining a first firmware matched with the result according to the result of lack of validity check; the viewing unit is used for viewing the modified segments in the first firmware matched with the result; and the fragment positioning unit is used for taking the modified fragment in the first firmware as a fragment which is not subjected to validity check in the firmware image file to be detected.
Further, the firmware image file flash verification system based on the fuzz test of the embodiment further includes: and the storage module is used for storing the N mutated firmware image files to be tested.
In this embodiment, the working principle and the working method of the firmware image file flash verification system based on the fuzz test have been described in detail in the embodiment shown in fig. 1, and are not described herein again, and the two embodiments may refer to each other.
EXAMPLE III
The present application further provides a terminal, including: the firmware image flash verification system comprises a processor and a memory which is in communication connection with the processor, wherein the memory stores instructions which can be executed by the processor, and the instructions are executed by the processor so as to enable the processor to execute the firmware image flash verification method based on the fuzzy test.
The firmware image file flash verification method based on the fuzzy test executed by the processor comprises the following steps:
s1: according to the UEFI file system structure, establishing a data model for describing the structure composition of the firmware image file, wherein in the data model, the firmware image file is divided into N segments, each segment keeps an independent function in the firmware image file, wherein N is a natural number and is more than or equal to 2;
s2: identifying the firmware image file to be detected by using a data model;
s3: after the firmware image file to be tested is identified, modifying each segment in the firmware image file to be tested in sequence by adopting a fuzzy test method to form N mutated firmware image files to be tested;
s5: according to whether the function of the firmware image file to be tested needs to be subjected to validity check or not, the first firmware is written to the target hardware in a flashing mode, and the first firmware is the firmware image file to be tested after variation corresponding to the function needing to be subjected to validity check;
s6: judging whether the target hardware has firmware flashing security holes or not according to the flashing result;
if the target hardware is determined to have the firmware flash security hole, executing step S7: and positioning the fragments which are not subjected to the validity check in the firmware image file to be detected according to the first firmware which is not subjected to the validity check.
Specific implementation steps and principles of the above method can be referred to in the first embodiment shown in fig. 1, and are not described herein again.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A firmware image file flash verification method based on fuzzy test is characterized by comprising the following steps:
according to the UEFI file system structure, establishing a data model for describing the structure composition of the firmware image file, wherein in the data model, the firmware image file is divided into N segments, each segment keeps an independent function in the firmware image file, wherein N is a natural number and is more than or equal to 2;
identifying the firmware image file to be detected by using the data model;
after the firmware image file to be tested is identified, modifying each segment in the firmware image file to be tested in sequence by adopting a fuzzy test method to form N mutated firmware image files to be tested;
according to whether the function of the firmware image file to be tested needs to be subjected to validity check or not, a first firmware is written to target hardware in a flashing mode, wherein the first firmware is the firmware image file to be tested after variation corresponding to the function needing to be subjected to validity check;
judging whether the target hardware has firmware flashing security holes or not according to the flashing result;
if so, positioning the fragment which is not subjected to the validity check in the firmware image file to be detected according to the first firmware which is not subjected to the validity check.
2. The firmware image file flash verification method based on the fuzz test as claimed in claim 1, wherein the method for identifying the firmware image file to be tested by using the data model comprises the following steps:
packaging the data model as a computer program having a particular format, the particular format comprising: mapping relationships between fragments and functions;
and identifying the format of the firmware image file to be detected by using the computer program.
3. The firmware image file flash verification method based on the fuzz test as claimed in claim 1, wherein the segment is the minimum unit of the firmware image file which keeps independent functions.
4. The firmware image file flash verification method based on the fuzzy test as claimed in claim 1, wherein after each segment of the firmware image file to be tested is modified in sequence by the fuzzy test method to form N mutated firmware image files to be tested, the method further comprises:
and storing the N mutated firmware image files to be tested.
5. The firmware image file flash verification method based on the fuzz test as claimed in claim 1, wherein the flash writing the first firmware to the target hardware according to whether the function of the firmware image file to be tested needs to be verified legally comprises:
determining a function which needs to be subjected to legality verification and a function which does not need to be subjected to legality verification in a firmware image file to be detected;
defining a mutated firmware image file corresponding to a function needing to be subjected to legality verification as a first firmware, and defining a mutated firmware image file corresponding to a function needing not to be subjected to legality verification as a second firmware;
the first firmware is flushed to the target hardware.
6. The firmware image file flash verification method based on the fuzz test, according to the flash result, judging whether the target hardware has firmware flash security hole, includes:
summarizing the flash result of the first firmware, and determining the result of lack of validity check;
judging whether the quantity M of the lack of the validity check results meets the following conditions: m is more than or equal to 1 and is a natural number or O;
if so, judging that the target hardware has firmware flash security holes;
and if not, judging that the target hardware does not have firmware flashing security holes.
7. The firmware image file flash verification method based on the fuzz test, according to the first firmware which is not subjected to the validity verification, the method for locating the fragment which is not subjected to the validity verification in the firmware image file to be tested comprises the following steps:
determining a first firmware matched with the result of lack of validity check;
viewing the modified segments in the first firmware that match the result;
and taking the modified segment in the first firmware as a segment which is not subjected to validity check in the firmware image file to be detected.
8. A firmware image file flash verification system based on fuzz testing, the system comprising:
the data model establishing module is used for establishing a data model for describing the structure composition of the firmware image file according to a UEFI file system structure, wherein in the data model, the firmware image file is divided into N segments, and each segment keeps an independent function in the firmware image file, wherein N is a natural number and is more than or equal to 2;
the identification module is used for identifying the firmware image file to be detected by utilizing the data model;
the variation module is used for modifying each segment in the firmware image file to be tested in sequence by adopting a fuzzy test method after identifying the firmware image file to be tested to form N varied firmware image files to be tested;
the flash module is used for flashing the first firmware to the target hardware according to whether the function of the firmware image file to be tested needs to be subjected to validity check or not, wherein the first firmware is the firmware image file to be tested after variation corresponding to the function needing to be subjected to validity check;
the judging module is used for judging whether firmware flash security holes exist in the target hardware or not according to the flash result;
and the positioning module is used for positioning the fragments which are not subjected to the legality verification in the firmware image file to be detected according to the first firmware which is not subjected to the legality verification when the target hardware has the firmware flash security loophole.
9. The firmware image file flash verification system based on fuzz testing as claimed in claim 8, further comprising: and the storage module is used for storing the N mutated firmware image files to be tested.
10. A terminal, characterized in that the terminal comprises: a processor, and a memory communicatively coupled to the processor, wherein,
the memory stores instructions executable by the processor to enable the processor to perform the firmware image file flash verification method based on fuzz testing according to any one of claims 1 to 7.
CN202110590633.2A 2021-05-28 2021-05-28 Firmware mirror image file refreshing verification method, system and terminal based on fuzzy test Active CN113591141B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110590633.2A CN113591141B (en) 2021-05-28 2021-05-28 Firmware mirror image file refreshing verification method, system and terminal based on fuzzy test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110590633.2A CN113591141B (en) 2021-05-28 2021-05-28 Firmware mirror image file refreshing verification method, system and terminal based on fuzzy test

Publications (2)

Publication Number Publication Date
CN113591141A true CN113591141A (en) 2021-11-02
CN113591141B CN113591141B (en) 2023-09-26

Family

ID=78243314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110590633.2A Active CN113591141B (en) 2021-05-28 2021-05-28 Firmware mirror image file refreshing verification method, system and terminal based on fuzzy test

Country Status (1)

Country Link
CN (1) CN113591141B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013036223A1 (en) * 2011-09-07 2013-03-14 Intel Corporation Verifying firmware integrity of a device
CN108306959A (en) * 2018-01-29 2018-07-20 郑州云海信息技术有限公司 A kind of method, apparatus and storage medium of remote upgrade CPLD firmwares
CN109063470A (en) * 2018-07-26 2018-12-21 郑州云海信息技术有限公司 A kind of safe verification method and system of BMC firmware
CN109710315A (en) * 2017-10-25 2019-05-03 阿里巴巴集团控股有限公司 BIOS writes with a brush dipped in Chinese ink the processing method of method and BIOS image file
CN110362427A (en) * 2019-06-26 2019-10-22 苏州浪潮智能科技有限公司 A kind of processing method of image file, system, BMC and readable storage medium storing program for executing
CN112417461A (en) * 2020-12-07 2021-02-26 北京梆梆安全科技有限公司 Fuzzy test method and system for equipment firmware

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013036223A1 (en) * 2011-09-07 2013-03-14 Intel Corporation Verifying firmware integrity of a device
CN109710315A (en) * 2017-10-25 2019-05-03 阿里巴巴集团控股有限公司 BIOS writes with a brush dipped in Chinese ink the processing method of method and BIOS image file
CN108306959A (en) * 2018-01-29 2018-07-20 郑州云海信息技术有限公司 A kind of method, apparatus and storage medium of remote upgrade CPLD firmwares
CN109063470A (en) * 2018-07-26 2018-12-21 郑州云海信息技术有限公司 A kind of safe verification method and system of BMC firmware
CN110362427A (en) * 2019-06-26 2019-10-22 苏州浪潮智能科技有限公司 A kind of processing method of image file, system, BMC and readable storage medium storing program for executing
CN112417461A (en) * 2020-12-07 2021-02-26 北京梆梆安全科技有限公司 Fuzzy test method and system for equipment firmware

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
苏振宇 等: "服务器管理控制系统威胁建模与应用", 计算机应用, vol. 39, no. 7 *
郝冉冉: "UEFI BIOS恶意代码检测系统的研究与实现", 中国优秀硕士学位论文全文数据库 信息技术辑 *

Also Published As

Publication number Publication date
CN113591141B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
US11681595B2 (en) Techniques and system for optimization driven by dynamic resilience
US7845006B2 (en) Mitigating malicious exploitation of a vulnerability in a software application by selectively trapping execution along a code path
US10133651B2 (en) Software defect analysis tool
CN110995825B (en) Intelligent contract issuing method, intelligent node equipment and storage medium
CN110674506B (en) Method and system for rapidly verifying vulnerability state of application program
US10140201B2 (en) Software defect detection tool
CN107679423A (en) Partition integrity inspection method and device
CN117076301A (en) System performance test method and device and electronic equipment
CN113591141B (en) Firmware mirror image file refreshing verification method, system and terminal based on fuzzy test
CN107562565A (en) A kind of method for verifying internal memory Patrol Scurb functions
CN114237665A (en) Patch updating method and device, computing equipment and storage medium
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
CN113919841A (en) Block chain transaction monitoring method and system based on static characteristics and dynamic instrumentation
CN112560041A (en) Method, apparatus and computer storage medium for automated quality verification detection
CN113535580A (en) CTS (clear to send) testing method, device and testing equipment
CN115129495A (en) Fault processing method and device, terminal equipment and computer readable storage medium
CN117874772B (en) Application software vulnerability scanning method and system
CN116089306A (en) Method, device, storage medium and equipment for automatically repairing tracking number code
CN117873015A (en) Implementation method, system and storage medium for loading EOL software on production line
CN113986742A (en) Automatic testing method, device, equipment and storage medium
CN118138366A (en) Vulnerability scanning method, equipment, medium and product
US20090037165A1 (en) Method and Apparatus for Processing Transactions in a Simulation Environment
CN117234789A (en) Verification and error correction method and device, electronic equipment and storage medium
TWM649831U (en) Smart contract security and efficiency audit system
CN118170635A (en) Webpage test processing method, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant