guardicore / monkey

Infection Monkey - An open-source adversary emulation platform
https://www.guardicore.com/infectionmonkey/
GNU General Public License v3.0
6.58k stars 767 forks source link

Agents with unique hashes #3244

Closed mssalvatore closed 1 year ago

mssalvatore commented 1 year ago

Description

Metamorphic/Polymorphic malware modifies itself to evade detection. As a result, no two copies of the malware share the same hash. Infection Monkey could emulate this property if each copy of the agent had random bytes appended to it.

On startup, if the agent's configuration includes a boolean to enable/disable this behavior, the agent can apply a decorator to its AgentBinaryRepository that would append a random number of bytes to the end of the agent.

While this won't actually make the agent metamorphic, it would emulate the property that each agent would have a unique hash. More advanced techniques/features should be added in the future. Take this into account when planning tasks.

Tasks

acepace commented 1 year ago

Note if you use PyInstaller, I think it has a random seed and option for encryption which should give you what you want

shreyamalviya commented 1 year ago

Are you thinking of this? We can't use this because we don't want to rebuild the binaries every time the Agent has to propagate. I couldn't find anything else relevant in the documentation.