Chinese Journal of Network and Information Security ›› 2023, Vol. 9 ›› Issue (2): 94-103.doi: 10.11959/j.issn.2096-109x.2023024

• Papers • Previous Articles     Next Articles

Software diversification method based on binary rewriting

Benwei HE, Yunfei GUO, Yawen WANG, Qingfeng WANG, Hongchao HU   

  1. Information Engineering University, Zhengzhou 450001, China
  • Revised:2023-03-02 Online:2023-04-25 Published:2023-04-01
  • Supported by:
    The National Key R&D Program of China(2021YFB1006200);The National Key R&D Program of China(2021YFB1006201);The National Natural Science Foundation of China(62072467)

Abstract:

Software diversity is an effective defense against code-reuse attacks, but most existing software diversification technologies are based on source code.Obtaining program source code may be difficult, while binary files are challenging to disassemble accurately and distinguish between code pointers and data constants.This makes binary file diversification difficult to generate high levels of randomization entropy, and easily compromised by attackers.To overcome these challenges, a binary file oriented software diversification method was proposed based on static binary rewriting technology, namely instruction offset randomization.This method inserted NOP instructions of varying byte lengths before program instructions with a certain probability, reducing the number of unintended gadgets in the program and randomly offsetting the original instruction address.This disrupts the program’s original memory layout and increases the cost of code-reuse attacks.At the same time, an optimization strategy based on hot code was designed for this method.The execution times of basic blocks in binary files were obtained by dynamic pile insertion, so as to adjust the NOP instruction insertion probability in each basic block.The higher the execution frequency, the fewer NOP instructions were inserted into the basic block, which can ensure lower performance overhead and produce higher randomization entropy.In the experimental part, the SPEC benchmark program was used to test the optimized method from the aspects of performance overhead, gadget survival rate and file size.The results show that a 15% insertion probability achieves the best effect, with an average gadget survival rate of less than 1.49%, increasing attackers’ difficulty in reusing the same gadget attack chain.Furthermore, only a 4.1% operation overhead and 7.7% space overhead are added, maintaining high levels of security.

Key words: software diversity, binary rewriting, NOP insertion, code-reuse attack

CLC Number: 

No Suggested Reading articles found!