Skip to content

Facts and requirements not aligning #3177

@timbrigham-oc

Description

@timbrigham-oc

Describe the bug

This might be more of the same issue I reported last year, might be something new.

I'm not able to concurrently use variable injection #{fact.source.name} and a requirement plugins.stockpile.app.parsers.basic hasAuth that should be able to work together.

To Reproduce
Steps to reproduce the behavior:

  1. Create a custom adversary.
  2. Create a "OC - TEST Echo Remote Host FQDN" using command echo #{preseed.remote.host.fqdn}, parser plugins.stockpile.app.parsers.basic and output source remote.host.fqdn. I'm doing this as a quick and dirty emulation of finding additional hosts without doing a scan.
  3. Create a "OC - Net use FQDN" ability, command like net use \\#{preseed.remote.host.fqdn}\c$ /user:#{preseed.domain.user.name} #{preseed.domain.user.password} parser plugins.stockpile.app.parsers.basic and output source hasAuth
  4. Create a "OC - Copy Sandcat SMB" ability, command line like $drive = \\#{remote.host.fqdn}\C$; Copy-Item -Path .\sandcat.go-windows -Destination $drive"\Windows\IMECache\s4ndc4t.exe" -Verbose; requirement like plugins.stockpile.app.requirements.basic, source hasAuth
  5. Create a "OC - Copy Sandcat SMB TEST" with a command line like $drive = \\my.hardcoded.name\C$; Copy-Item -Path .\sandcat.go-windows -Destination $drive"\Windows\IMECache\s4ndc4t.exe" -Verbose; requirement like plugins.stockpile.app.requirements.basic, source hasAuth. This can optionally also have a plugins.stockpile.app.requirements.basic, source remote.host.fqdn added without changing the behavior.

Behavior

  1. "OC - TEST Echo Remote Host FQDN" successfully sets remote.host.fqdn
  2. "OC - Net Use FQDN" successfully finishes and creates hasAuth fact
  3. "OC - Copy Sandcat SMB" is not executed, with a "Fact dependency not fulfilled" shown in the audit logs. The only fact in "Copy Sandcat SMB" is remote.host.fqdn, which is for sure created above by "OC - TEST Echo Remote Host FQDN"
  4. "OC - Copy Sandcat SMB TEST" executes without an issue since the same value has been hard coded.

Expected behavior
It should be possible to use variable substitution in conjunction with requirement definitions.

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behavior

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions