Skip to content

Commit

Permalink
add option to supress printing of atomicsfolder to screen (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
clr2of8 authored Jun 20, 2023
1 parent cb183eb commit d4c8f95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Public/Invoke-AtomicRunner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Invoke-AtomicRunner {
$LoggingModule,

[Parameter(Mandatory = $false)]
$listOfAtomics,
$ListOfAtomics,

[Parameter(Mandatory = $false, ValueFromRemainingArguments = $true)]
$OtherArgs
Expand Down Expand Up @@ -61,10 +61,10 @@ function Invoke-AtomicRunner {
$sc = $tr.AtomicsFolder
#Run the Test based on if scheduleContext is 'private' or 'public'
if (($sc -eq 'public') -or ($null -eq $sc)) {
Invoke-AtomicTest $tr.Technique -TestGuids $tr.auto_generated_guid -InputArgs $tr.InputArgs -TimeoutSeconds $tr.TimeoutSeconds -ExecutionLogPath $artConfig.execLogPath -PathToAtomicsFolder $artConfig.PathToPublicAtomicsFolder @htvars -Cleanup:$Cleanup
Invoke-AtomicTest $tr.Technique -TestGuids $tr.auto_generated_guid -InputArgs $tr.InputArgs -TimeoutSeconds $tr.TimeoutSeconds -ExecutionLogPath $artConfig.execLogPath -PathToAtomicsFolder $artConfig.PathToPublicAtomicsFolder @htvars -Cleanup:$Cleanup -supressPathToAtomicsFolder
}
elseif ($sc -eq 'private') {
Invoke-AtomicTest $tr.Technique -TestGuids $tr.auto_generated_guid -InputArgs $tr.InputArgs -TimeoutSeconds $tr.TimeoutSeconds -ExecutionLogPath $artConfig.execLogPath -PathToAtomicsFolder $artConfig.PathToPrivateAtomicsFolder @htvars -Cleanup:$Cleanup
Invoke-AtomicTest $tr.Technique -TestGuids $tr.auto_generated_guid -InputArgs $tr.InputArgs -TimeoutSeconds $tr.TimeoutSeconds -ExecutionLogPath $artConfig.execLogPath -PathToAtomicsFolder $artConfig.PathToPrivateAtomicsFolder @htvars -Cleanup:$Cleanup -supressPathToAtomicsFolder
}
}

Expand Down
9 changes: 7 additions & 2 deletions Public/Invoke-AtomicTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,20 @@ function Invoke-AtomicTest {
[Parameter(Mandatory = $false,
ParameterSetName = 'technique')]
[String]
$LoggingModule
$LoggingModule,

[Parameter(Mandatory = $false,
ParameterSetName = 'technique')]
[switch]
$SupressPathToAtomicsFolder = $false

)
BEGIN { } # Intentionally left blank and can be removed
PROCESS {
$PathToAtomicsFolder = (Resolve-Path $PathToAtomicsFolder).Path

Write-Verbose -Message 'Attempting to run Atomic Techniques'
Write-Host -ForegroundColor Cyan "PathToAtomicsFolder = $PathToAtomicsFolder`n"
if(-not $supressPathToAtomicsFolder) { Write-Host -ForegroundColor Cyan "PathToAtomicsFolder = $PathToAtomicsFolder`n" }

$executionPlatform, $isElevated, $tmpDir, $executionHostname, $executionUser = Get-TargetInfo $Session
$PathToPayloads = if ($Session) { "$tmpDir`AtomicRedTeam" } else { $PathToAtomicsFolder }
Expand Down

0 comments on commit d4c8f95

Please sign in to comment.