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

Agent IDs are inconsistent #3119

Closed
14 of 16 tasks
mssalvatore opened this issue Mar 16, 2023 · 0 comments · Fixed by #3162
Closed
14 of 16 tasks

Agent IDs are inconsistent #3119

mssalvatore opened this issue Mar 16, 2023 · 0 comments · Fixed by #3162
Assignees
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. Complexity: Medium Impact: High Plugins
Milestone

Comments

@mssalvatore
Copy link
Collaborator

mssalvatore commented Mar 16, 2023

Describe the bug

get_agent_id() is declared to be a global singleton. As a result, when plugins (which are running in different processes) call get_agent_id(), they do not receive the "cached" value, but instead receive a new value. This means that all agents which are spawned by a plugin exploiter will have the wrong parent ID.

To Reproduce

Steps to reproduce the behavior:

  1. Configure the Monkey to exploit a hadoop machine
  2. Run the monkye
  3. Examine the agent log on the attacker's machine. Note the AgentID in the log.
  4. Examine the agent log on the victim's machine. Note that what is passed as the parent ID does not match the attacker's agent ID.

Expected behavior

The parent ID sent to child agents should match the ID of parent agents.

Machine version (please complete the following information):

  • OS: Windows or Linux

Recommended Solution

The agent ID should be passed from monkey.py down to any components that need it.

Tasks

  • Pass the ID down to components that require it (0d) @cakekoa
    • Pass the agent ID to Heart.__init__()
    • Pass the agent ID to network scanners
      • Ping scanner
      • TCP scanner
    • Pass the agent ID to credentials collectors
      • SSH
      • Mimikatz
    • Pass the agent ID to ransomware
    • Pass the agent ID to the plugin registry
  • Pass agent ID to exploiters (0d) - @shreyamalviya
    • Construct plugins (PluginLoader) with the agent ID not needed, all of this is handled in the plugin registry
    • Modify exploiters (and exploiter wrapper?) to accept the agent ID in their constructors
    • Modify infection_monkey.utils.commands to receive agent ID as a parameter
      • Pass AgentID as a parameter from all callers
  • Simplify get_agent_id() (the caching is no longer necessary) (0.25d) @cakekoa
@mssalvatore mssalvatore added Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. Impact: High Complexity: Medium Plugins labels Mar 16, 2023
@cakekoa cakekoa self-assigned this Mar 24, 2023
cakekoa added a commit that referenced this issue Mar 24, 2023
cakekoa added a commit that referenced this issue Mar 24, 2023
cakekoa added a commit that referenced this issue Mar 24, 2023
cakekoa added a commit that referenced this issue Mar 24, 2023
cakekoa added a commit that referenced this issue Mar 24, 2023
cakekoa added a commit that referenced this issue Mar 28, 2023
cakekoa added a commit that referenced this issue Mar 28, 2023
mssalvatore pushed a commit that referenced this issue Mar 28, 2023
cakekoa added a commit that referenced this issue Mar 28, 2023
cakekoa added a commit that referenced this issue Mar 28, 2023
cakekoa added a commit that referenced this issue Mar 28, 2023
mssalvatore pushed a commit that referenced this issue Mar 28, 2023
cakekoa added a commit that referenced this issue Mar 28, 2023
mssalvatore pushed a commit that referenced this issue Mar 28, 2023
@cakekoa cakekoa mentioned this issue Mar 28, 2023
10 tasks
mssalvatore pushed a commit that referenced this issue Mar 28, 2023
mssalvatore added a commit that referenced this issue Mar 28, 2023
cakekoa added a commit that referenced this issue Mar 28, 2023
cakekoa added a commit that referenced this issue Mar 28, 2023
mssalvatore pushed a commit that referenced this issue Mar 28, 2023
mssalvatore added a commit that referenced this issue Mar 28, 2023
@mssalvatore mssalvatore added this to the v2.1.0 milestone Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. Complexity: Medium Impact: High Plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants