Add more mutations

Currently, the tool makes the following mutations to the malware file

  • Add imports received from GAN

  • Add sections received from GAN

  • Append bytes to sections

  • Rename sections

  • UPX pack

  • UPX unpack

  • Add/Remove signature

  • Append a random number of bytes

To add your own mutations, follow the below steps

Step 1: Add the function

Go to gym_malware/envs/controls/manipulate2 and add a function in the MalwareManipulator class

class MalwareManipulator(object):
    
    def add_your_mutation(self, seed=None):
    # self.bytez is the variable that stores the binary 
    # you can make modifications to self.bytez
    # return self.bytez

    def overlay_append(self, seed=None):

Once the function is built, make sure to add the function name in the ACTION_TABLE in gym_malware/envs/controls/manipulate2

Last updated

Was this helpful?