Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agents with unique hashes #3244

Closed
15 tasks done
mssalvatore opened this issue Apr 24, 2023 · 2 comments
Closed
15 tasks done

Agents with unique hashes #3244

mssalvatore opened this issue Apr 24, 2023 · 2 comments
Labels
Complexity: Low Feature Issue that describes a new feature to be implemented. Impact: Medium sp/5
Milestone

Comments

@mssalvatore
Copy link
Collaborator

mssalvatore commented Apr 24, 2023

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

  • Add a new section to AgentConfiguration for polymorphism (0d) - @shreyamalviya
    • New sub-configuration with a single boolean option
  • Update the configuration UI schema to support the new configuration option (0d) - @shreyamalviya
  • Documentation (0d) - @shreyamalviya
  • Fix checkbox description not displaying in Polymorphic tab (0d) @ilija-lazoroski
  • Write a decorator for Agent's AgentBinaryRepository that will append 16 random bytes every time an agent is requested (0d) @mssalvatore
    • Read AgentConfiguration and decide do we need to decorate Agent's AgentBinaryRepository (monkey.py)
  • Modify the Agent to include its own sha256 hash (0d) @cakekoa
    • Modify the Agent model to have a sha256 field
    • Modify AgentRegistrationData to have a sha256 field
    • Modify handle_agent_registration to include sha256
  • Modify the Agent to calculate the sha256 and include it in AgentRegistrationData (0d) @mssalvatore
  • Modify some BB tests to enable polymorphism (0.5d)
    • Create a function that asserts the uniqueness of agent hashes @mssalvatore
    • Update depth_1 and depth_3 to check for unique hashes
@mssalvatore mssalvatore added Feature Issue that describes a new feature to be implemented. Impact: Medium Complexity: Low labels Apr 24, 2023
@mssalvatore mssalvatore added this to the v2.2.0 milestone Apr 24, 2023
@mssalvatore mssalvatore added this to Backlog in Monkey Dev Board Apr 24, 2023
@mssalvatore mssalvatore changed the title Metamorphic/Polymorphic Agent Uniquely Hashable Agent Apr 24, 2023
@mssalvatore mssalvatore changed the title Uniquely Hashable Agent Agents with unique hashes. Apr 24, 2023
@mssalvatore mssalvatore changed the title Agents with unique hashes. Agents with unique hashes Apr 24, 2023
@acepace
Copy link
Contributor

acepace commented Apr 24, 2023

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

@shreyamalviya
Copy link
Contributor

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.

@ilija-lazoroski ilija-lazoroski moved this from Backlog to To Do in Monkey Dev Board May 11, 2023
@shreyamalviya shreyamalviya moved this from To Do to In Progress in Monkey Dev Board May 16, 2023
This was referenced May 16, 2023
mssalvatore added a commit that referenced this issue May 16, 2023
mssalvatore added a commit that referenced this issue May 16, 2023
@ilija-lazoroski ilija-lazoroski moved this from In Progress to Ready For Review in Monkey Dev Board May 16, 2023
@ilija-lazoroski ilija-lazoroski moved this from Ready For Review to In Progress in Monkey Dev Board May 16, 2023
This was referenced May 16, 2023
mssalvatore added a commit that referenced this issue May 16, 2023
mssalvatore added a commit that referenced this issue May 16, 2023
mssalvatore added a commit that referenced this issue May 16, 2023
@ilija-lazoroski ilija-lazoroski moved this from In Progress to Ready For Review in Monkey Dev Board May 17, 2023
mssalvatore added a commit that referenced this issue May 17, 2023
Monkey Dev Board automation moved this from Ready For Review to Done May 17, 2023
@mssalvatore mssalvatore moved this from Done to tmp in Monkey Dev Board Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Low Feature Issue that describes a new feature to be implemented. Impact: Medium sp/5
Projects
None yet
Development

No branches or pull requests

3 participants