The invention discloses an MCU
firmware grey box fuzzy test method and device based on
simulation and
strategy selection, and the method comprises the following steps: 1) loading an MCU
firmware binary file to a Unicorn simulator, and starting to run from a
firmware entry point; 2) intercepting all MMIO accesses generated during firmware running, and judging whether a corresponding MMIO access model exists or not; (3) the energy-saving fuzzifier selects a variation strategy with the maximum probability of generating a new path to perform variation on the seeds, and inputs the variation strategy into the simulator; (4) the simulator obtains the variation seeds, the
processing mode of the seeds is selected according to the access model, and therefore
peripheral input needed by firmware is generated, and
simulation operation is recovered; 5) recording and feeding back execution conditions of the variant seeds to the exploration-utilization model, and simultaneously determining whether the variant seeds are discarded or added into the
seed sample set; and 6) calculating the probabilities of different variation
modes by the exploration-utilization model according to feedback information of a seed operation result for
strategy selection in the step 3). According to the method, MCU firmware
peripheral modeling and an energy-saving fuzzifier are combined, and
vulnerability mining is carried out on full-
simulation firmware by using input overhead judgment and abrupt change selection strategies. Through the input overhead judgment of the simulator and the exploration-utilization model of the fuzzer, the input overhead of
peripheral modeling is reduced, the generation of redundant seeds is reduced, and the
code coverage rate of
fuzz testing is ensured.