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

3167 mock credential collector #3247

Merged
merged 35 commits into from
Apr 27, 2023
Merged

Conversation

ilija-lazoroski
Copy link
Contributor

@ilija-lazoroski ilija-lazoroski commented Apr 24, 2023

What does this PR do?

Fixes #3167

Things left to do:

  • Check the last TEMP commit. Figure out how to pass TargetHost.
  • Check the UT. Probably some of them are failing.

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the CHANGELOG.md updated to reflect the changes?
  • Was the documentation framework updated to reflect the changes?
  • Have you checked that you haven't introduced any duplicate code?

Testing Checklist

  • Added relevant unit tests?
  • Do all unit tests pass?
  • Do all end-to-end tests pass?
  • Any other testing performed?

    Tested by {Running the Monkey locally with relevant config/running Island/...}

  • If applicable, add screenshots or log transcripts of the feature working

image
image

@@ -2,7 +2,7 @@


class AgentPluginType(Enum):
CREDENTIAL_COLLECTOR = "CredentialCollector"
CREDENTIAL_COLLECTOR = "Credential_Collector"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Credential Collector

Also, should this be plural?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it shouldn't be plural. According to how plugins are parsed right now, this needs to be the same as what the plugin tar name contains (in lowercase) AND what the plugin manifest has in the plugin_type field (which we've discussed is not good design and needs to be changed).

For example, for Mimikatz, the tar name needs to be mimikatz-credentialcollector.tar and the manifest needs to contain plugin_type: CredentialCollector.

I suggest we leave this as CredentialCollector. Adding a space would require the tar name to have a space (mimikatz-credential collector.tar), and adding an underscore would require the manifest to have plugin_type: Credential_Collector. Unless we decide to change plugin parsing before we get to migrating the credential collectors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything on that is clear, but the issue was that the enum name and value were different and the plugin was not being loaded due to this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So to get a plugin to work, we need 4 things to be written the same way, the enum name, the enum value, the plugin type in the manifest, and the last part of the tar name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to go with Credential_Collector as the value in that case.

Copy link
Collaborator

@mssalvatore mssalvatore Apr 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that's fine. But should we rename the enum name and value to be plural? The plugin collects credentials, not a single credential.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cakekoa you should rebase on develop and drop this commit. It is already done there.

@mssalvatore
Copy link
Collaborator

I think there are some issues with the interface here. We should probably complete the tasks to define the interface before doing any more work on this.

@ilija-lazoroski ilija-lazoroski force-pushed the 3167-mock-credential-collector branch 2 times, most recently from fca73ae to 5a47852 Compare April 25, 2023 07:59
@cakekoa cakekoa force-pushed the 3167-mock-credential-collector branch 3 times, most recently from b7bbaa5 to bfb79d3 Compare April 25, 2023 21:02
@ilija-lazoroski ilija-lazoroski force-pushed the 3167-mock-credential-collector branch 2 times, most recently from 8e83fb8 to fe230be Compare April 27, 2023 08:33
@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.01 🎉

Comparison is base (ea2da23) 73.35% compared to head (2466ffb) 73.36%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3247      +/-   ##
===========================================
+ Coverage    73.35%   73.36%   +0.01%     
===========================================
  Files          481      481              
  Lines        13875    13866       -9     
===========================================
- Hits         10178    10173       -5     
+ Misses        3697     3693       -4     

see 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ilija-lazoroski
Copy link
Contributor Author

Travis is fixed in the #3260

@ilija-lazoroski ilija-lazoroski marked this pull request as ready for review April 27, 2023 11:51
@mssalvatore mssalvatore force-pushed the 3167-mock-credential-collector branch from 5763477 to 2466ffb Compare April 27, 2023 11:55
@mssalvatore mssalvatore merged commit f23437b into develop Apr 27, 2023
@mssalvatore mssalvatore deleted the 3167-mock-credential-collector branch April 27, 2023 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define credentials collectors plugin interface
4 participants