mitre / caldera

Automated Adversary Emulation Platform
https://caldera.mitre.org
Apache License 2.0
5.63k stars 1.07k forks source link

Multiple issues with Atomic Red Team plugin #2721

Closed PSR009 closed 1 year ago

PSR009 commented 1 year ago

Issue#1 : Though the test case (ability) has passed with given output, the status is shown as failed.

Issue#2 : Prerequisite commands are not executed in the ability, leading to multiple failures.

Issue#3 : Some abilities are not executed during an operation, they are not shown as failed or error.

Screenshots for all 3 issues mentioned above

Desktop

github-actions[bot] commented 1 year ago

Looks like your first issue -- we aim to respond to issues as quickly as possible. In the meantime, check out our documentation here: http://caldera.readthedocs.io/

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 5 days

elegantmoose commented 1 year ago

@PSR009 RE Issue 1 - The error status is coming from this general post-ability parser (https://github.com/mitre/atomic/blob/master/app/parsers/atomic_powershell.py#L6). Currently, Im not sure why the simple error check (for all atomic powershell abilities) is to check for the line 'FullyQualifiedErrorId' in the ability output, and I dont have a test windows box where I can test this ability. Lets ping the former team member who created the parser a few years ago.

@ArtificialErmine - any chance youre active and can remember why we created the parser this way?

@PSR009 - If you want to get hacky, try removing the check for 'FullyQualifiedErrorId' from that parser in the source code and see what happens.

elegantmoose commented 1 year ago

@PSR009 RE Issue 2 - These are Atomic Red Teams abilities (as opposed to Caldera's) so we dont maintain those.

However, if you wanted to fix, you can just create a Caldera ability that does the needed actions before this ability.

ArtificialErmine commented 1 year ago

Yep, @elegantmoose, I'm still around. Let's see what I can pull out here.

For Issue 1 - I believe we were using FullyQualifiedErrorId because a plurality of error cases we tested produced that kind of error code when failing. Originally, we didn't have any reliable way to detect any error, so we implemented this to detect at least some of them. Unfortunately, due to the fact that atomic tests are super wide spread in terms of what they actually do, it's hard to get a constantly valid error code across every test to check for. That being said, I would double check that the command isn't producing some text that isn't being captured somehow, and if it isn't, then I'd have someone on the team double check that the comparison is working as expected (it might be checking for the presence of the characters of the string FullyQualifiedErrorId rather than the string as a whole).

For Issue 2 - As @elegantmoose pointed out, we don't maintain the Atomic Red Team techniques per say, just load them and provide a platform to interact with. As a result, while we make a best effort to load Pre-Requisites (atomic red team style) and handle them, we can't make a guarantee that it works for every case, and it looks like this is one that slips through the current system.

For Issue 3 - My guess is that some Pre-Requisites (caldera style) for the ability aren't being met. I'd need to look into the actual abilities files to be sure of that, but that's my initial guess as to why they wouldn't be executed.

elegantmoose commented 1 year ago

@PSR009 RE issue 3 - yes exactly what @ArtificialErmine said

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 5 days