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

Migrate the SSH exploiter to a plugin #3170

Closed
20 tasks done
mssalvatore opened this issue Mar 28, 2023 · 2 comments
Closed
20 tasks done

Migrate the SSH exploiter to a plugin #3170

mssalvatore opened this issue Mar 28, 2023 · 2 comments

Comments

@mssalvatore
Copy link
Collaborator

mssalvatore commented Mar 28, 2023

Description

Replace the hard-coded SSH exploiter with a new and improved, fully tested, SSH exploiter plugin with high code quality. Leverage the BruteForceExploiter to minimize code duplication.

Use the SMBExploiter as a template.

Tasks

  • Plugin skeleton (0d) - @shreyamalviya
    • options (pydantic)
      • determine what options SSH should have
      • create a pydantic model for SSH options
    • Create plugin manifest
    • Create config schema
  • Create a Pipfile for dependencies (0d) - @shreyamalviya
  • Update Jenkins (0.25d)
    • Add a jenkins job to build the plugin - @shreyamalviya
    • Update the island build jobs on Jenkins to copy the artifacts from the SSH plugin build job
  • plugin.py (0d) - @shreyamalviya
  • command builder (0d) - @shreyamalviya
  • exploit client (0d) @ilija-lazoroski
    • Don't forget to add MITRE tags
    • Check preconditions in plugin.py
  • Update ETE test configurations (0d) @cakekoa
  • Remove the hard-coded SSH plugin (0d) @cakekoa
    • Remove vulture entries
    • Fix command builder OS check (0d)
  • Extra and ETE testing (0d)
@shreyamalviya
Copy link
Contributor

shreyamalviya commented Jul 6, 2023

Remove cryptography.hazmat.primitives.padding from hidden imports in monkey.spec; test and make sure nothing is broken

Removing cryptography from the Agent dependencies (which we need to do so that PowerShell doesn't use the Agent's cryptography) stops the Agent from running at all, it throws this error

Traceback (most recent call last):
  File “infection_monkey/main.py”, line 25, in <module>
  File “<frozen importlib._bootstrap>“, line 1178, in _find_and_load
  File “<frozen importlib._bootstrap>“, line 1149, in _find_and_load_unlocked
  File “<frozen importlib._bootstrap>“, line 690, in _load_unlocked
  File “PyInstaller/loader/pyimod02_importers.py”, line 385, in exec_module
  File “infection_monkey/dropper.py”, line 15, in <module>
  File “<frozen importlib._bootstrap>“, line 1178, in _find_and_load
  File “<frozen importlib._bootstrap>“, line 1149, in _find_and_load_unlocked
  File “<frozen importlib._bootstrap>“, line 690, in _load_unlocked
  File “PyInstaller/loader/pyimod02_importers.py”, line 385, in exec_module
  File “infection_monkey/utils/commands.py”, line 7, in <module>
  File “<frozen importlib._bootstrap>“, line 1178, in _find_and_load
  File “<frozen importlib._bootstrap>“, line 1149, in _find_and_load_unlocked
  File “<frozen importlib._bootstrap>“, line 690, in _load_unlocked
  File “PyInstaller/loader/pyimod02_importers.py”, line 385, in exec_module
  File “infection_monkey/exploit/__init__.py”, line 2, in <module>
  File “<frozen importlib._bootstrap>“, line 1178, in _find_and_load
  File “<frozen importlib._bootstrap>“, line 1149, in _find_and_load_unlocked
  File “<frozen importlib._bootstrap>“, line 690, in _load_unlocked
  File “PyInstaller/loader/pyimod02_importers.py”, line 385, in exec_module
  File “infection_monkey/exploit/caching_agent_binary_repository.py”, line 7, in <module>
  File “<frozen importlib._bootstrap>“, line 1178, in _find_and_load
  File “<frozen importlib._bootstrap>“, line 1149, in _find_and_load_unlocked
  File “<frozen importlib._bootstrap>“, line 690, in _load_unlocked
  File “PyInstaller/loader/pyimod02_importers.py”, line 385, in exec_module
  File “infection_monkey/island_api_client/__init__.py”, line 12, in <module>
  File “<frozen importlib._bootstrap>“, line 1178, in _find_and_load
  File “<frozen importlib._bootstrap>“, line 1149, in _find_and_load_unlocked
  File “<frozen importlib._bootstrap>“, line 690, in _load_unlocked
  File “PyInstaller/loader/pyimod02_importers.py”, line 385, in exec_module
  File “infection_monkey/island_api_client/configuration_validator_decorator.py”, line 3, in <module>
  File “<frozen importlib._bootstrap>“, line 1178, in _find_and_load
  File “<frozen importlib._bootstrap>“, line 1149, in _find_and_load_unlocked
  File “<frozen importlib._bootstrap>“, line 690, in _load_unlocked
  File “PyInstaller/loader/pyimod02_importers.py”, line 385, in exec_module
  File “jsonschema/__init__.py”, line 17, in <module>
  File “<frozen importlib._bootstrap>“, line 1178, in _find_and_load
  File “<frozen importlib._bootstrap>“, line 1149, in _find_and_load_unlocked
  File “<frozen importlib._bootstrap>“, line 690, in _load_unlocked
  File “PyInstaller/loader/pyimod02_importers.py”, line 385, in exec_module
  File “jsonschema/validators.py”, line 19, in <module>
  File “<frozen importlib._bootstrap>“, line 1178, in _find_and_load
  File “<frozen importlib._bootstrap>“, line 1149, in _find_and_load_unlocked
  File “<frozen importlib._bootstrap>“, line 690, in _load_unlocked
  File “PyInstaller/loader/pyimod02_importers.py”, line 385, in exec_module
  File “jsonschema_specifications/__init__.py”, line 11, in <module>
  File “referencing/_core.py”, line 297, in __rmatmul__
  File “jsonschema_specifications/_core.py”, line 27, in _schemas
  File “pathlib.py”, line 931, in iterdir
FileNotFoundError: [Errno 2] No such file or directory: ‘/tmp/_MEIdptIST/jsonschema_specifications/schemas’

PR to update the comment in monkey.spec

@ilija-lazoroski
Copy link
Contributor

Closed by #3465

mssalvatore added a commit that referenced this issue Nov 15, 2023
mssalvatore added a commit that referenced this issue Nov 16, 2023
mssalvatore added a commit that referenced this issue Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants