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:
- Create a custom adversary.
- 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.
- 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
- 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
- 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
- "OC - TEST Echo Remote Host FQDN" successfully sets
remote.host.fqdn
- "OC - Net Use FQDN" successfully finishes and creates
hasAuth fact
- "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"
- "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.
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 requirementplugins.stockpile.app.parsers.basichasAuththat should be able to work together.To Reproduce
Steps to reproduce the behavior:
echo #{preseed.remote.host.fqdn}, parserplugins.stockpile.app.parsers.basicand output sourceremote.host.fqdn. I'm doing this as a quick and dirty emulation of finding additional hosts without doing a scan.net use \\#{preseed.remote.host.fqdn}\c$ /user:#{preseed.domain.user.name} #{preseed.domain.user.password}parserplugins.stockpile.app.parsers.basicand output sourcehasAuth$drive = \\#{remote.host.fqdn}\C$; Copy-Item -Path .\sandcat.go-windows -Destination $drive"\Windows\IMECache\s4ndc4t.exe" -Verbose;requirement likeplugins.stockpile.app.requirements.basic, sourcehasAuth$drive = \\my.hardcoded.name\C$; Copy-Item -Path .\sandcat.go-windows -Destination $drive"\Windows\IMECache\s4ndc4t.exe" -Verbose;requirement likeplugins.stockpile.app.requirements.basic, sourcehasAuth. This can optionally also have aplugins.stockpile.app.requirements.basic, sourceremote.host.fqdnadded without changing the behavior.Behavior
remote.host.fqdnhasAuthfactExpected behavior
It should be possible to use variable substitution in conjunction with requirement definitions.