-
Notifications
You must be signed in to change notification settings - Fork 201
Iterate through Atomic Tests Programmatically
Carrie Roberts edited this page Mar 31, 2023
·
4 revisions
$path = "C:\AtomicRedTeam\atomics\*" # set this to point to your atomics folder
$techniques = gci $path -Recurse -Include T*.yaml | Get-AtomicTechnique
$windows = $linux = $macos = $cloud = 0
foreach ($technique in $techniques) {
foreach ($atomic in $technique.atomic_tests) {
if ($atomic.supported_platforms.contains("windows")) {
$windows = $windows + 1
}
if ($atomic.supported_platforms.contains("linux")) {
$linux = $linux + 1
}
if ($atomic.supported_platforms.contains("macos")) {
$macos = $macos + 1
}
if (-not ($atomic.supported_platforms.contains("windows") -or $atomic.supported_platforms.contains("linux") -or $atomic.supported_platforms.contains("macos"))) {
$cloud = $cloud + 1
}
}
}
Write-Host -ForegroundColor Cyan "Windows Tests: $windows"
Write-Host -ForegroundColor Green " Linux Tests: $linux"
Write-Host -ForegroundColor Yellow " macOS Tests: $macos"
Write-Host -ForegroundColor Magenta " Cloud/Container Tests: $cloud"
$path = "C:\AtomicRedTeam\atomics\*" # Set this to point to your atomics folder
$techniques = Get-ChildItem $path -Recurse -Include T*.yaml | Get-AtomicTechnique
foreach ($technique in $techniques) {
foreach ($atomic in $technique.atomic_tests) {
if ($atomic.supported_platforms.contains("macos")) {
Write-Host -Fore Green $atomic.auto_generated_guid + "`n"
foreach ($inputArg in $atomic.input_arguments.keys) {
Write-Host -Fore Yellow "** $inputArg **"
Write-Host -Fore Yellow $($atomic.input_arguments[$inputArg] | Out-String)
}
Write-Host -Fore Cyan $atomic.executor.command
}
}
}
Questions? Get connected to the community on the Atomic Red Team Slack channel.
- Installation
- Import the Module
- List Atomic Tests
- Check/Get Prerequisites for Atomic Tests
- Execute Atomic Tests (Local)
- Execute Atomic Tests (Remote)
- Specify Custom Input Arguments
- Cleanup after Executing Atomic Tests
- Execution Logging
- Adversary Emulation
- Continuous Atomic Testing
- Execution Hooks
- Helper Functions
- The Atomic GUI
- Uninstallation