agentleFS
Bizaza-devsBizaza-devs/Claude-PurpleTeam/skills/atomic-red-team/SKILL.md

atomic-red-team

Skill0 starsChanged 3 days agoMITView on GitHub

Operator guide for running Atomic Red Team tests with the Invoke-AtomicRedTeam PowerShell module in an authorised lab: installing the module and atomics folder per the project wiki, Invoke-AtomicTest -ShowDetailsBrief / -ShowDetails, -CheckPrereqs / -GetPrereqs, pinning tests by -TestNumbers / -TestNames / -TestGuids, -InputArgs, -Cleanup, -ExecutionLogPath and the CSV execution log, remote runs over PSSession, pwsh on Linux/macOS, benign custom atomics in the project YAML format, AV quarantine as a blocked outcome, and mapping every run to expected Sysmon / Security / Defender telemetry and the hunt skill that should catch it. Use when asked to \"run an atomic\", \"Invoke-AtomicTest\", test T#### with Atomic Red Team, or validate a detection with an atomic test.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Not for: writing new offensive tooling, chaining atomics into a stealthy intrusion, or running against systems outside a written scope.

    line 18
  2. Distinctive:

    Authorisation gate, every time: Before the first command: a lab host, or a production host named in a written authorisation plus change …

    line 26
  3. Very specific:

    No defence evasion: Never disable, pause or exclude EDR/AV, Sysmon, auditing or log forwarding to make a test run.

    line 38
  4. Distinctive:

    Published tests only: Use the project's atomics as shipped, referenced by ATT&CK technique and test name, with the atomics version …

    line 41
  5. Distinctive:

    Write the expectation: before running: telemetry (event IDs, tables), the detection that should fire, and the sibling hunt skill (table …

    line 58
  6. Very specific:

    Test names in this skill are examples as of writing ("Reg Key Run" under T1547.001).

    line 102
  7. Very specific:

    Read the YAML directly when in doubt: atomics\T####\T####.yaml holds atomic_tests[].name, auto_generated_guid, supported_platforms, …

    line 104
  8. Very specific:

    Never copy a GUID from memory or from a blog into a test card.

    line 108
  9. Distinctive:

    Keep host clocks NTP-synced.

    line 164
  10. Distinctive:

    Check the wiki for what must exist on the remote host in your version (atomics folder, payload paths) before relying on remote runs …

    line 209
  11. Distinctive:

    Only for proving a pipeline or a detection on a harmless marker action.

    line 236

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Atomic Red Team operations (Invoke-AtomicRedTeam)

When to use

  • A test card (from adversary-emulation-planning, /emulate or /purple) names an Atomic Red Team test and someone has to run it, capture the evidence and clean up.
  • A new or tuned detection needs a true-positive run before it is called done (detection-engineering).
  • Regression runs after an EDR agent, sensor policy, parser or rule change.
  • Building a small, benign custom atomic so a log source or pipeline can be proven end to end (marker file, marker registry value).

Not for: writing new offensive tooling, chaining atomics into a stealthy intrusion, or running against systems outside a written scope. Exercise design and scoring live in purple-team-validation and purple-exercise-tracking; endpoint test selection per technique in emulate-windows-endpoint. This skill is the executor manual.

Ground rules

  • Authorisation gate, every time. Before the first command: a lab host, or a production host named in a written authorisation plus change ticket that lists the techniques, test names, time window, operator and abort contact. No gate, no run.
  • Inspect before execute. -ShowDetails for the exact test, read executor.command, cleanup_command and dependencies. If you cannot explain what the command does and how it is undone, do not run it.
  • Snapshot first, cleanup always. VM snapshot (lab) or confirmed backup (approved production host); run -Cleanup after every test and verify the host is back to baseline (file, key, task, service, account gone).
  • SOC deconfliction. The SOC lead knows host, account, window and test ID, or the test is a declared no-notice test approved by the SOC lead. Real activity outside the test's footprint stops the exercise and goes to alert-triage.
  • No defence evasion. Never disable, pause or exclude EDR/AV, Sysmon, auditing or log forwarding to make a test run. A quarantined atomic or blocked command is a result (blocked), recorded with the protection event.
  • Published tests only. Use the project's atomics as shipped, referenced by ATT&CK technique and test name, with the atomics version (commit/tag) recorded. Custom atomics are limited to benign marker actions and are peer-reviewed.
  • Evidence or it did not happen. A result needs the execution log row, the raw telemetry record and the alert ID (or the documented absence of one) for the same test ID and time window.

Workflow

  1. Confirm the gate (scope document, change ticket, SOC notified) and record the test ID, e.g. PT-2026-031.
  2. Snapshot the lab VM; note the snapshot name in the test card.
  3. Inspect: -ShowDetailsBrief for the technique, then -ShowDetails for the chosen test. Confirm the local test number, name and GUID, because numbering can change between atomics versions.
  4. Prerequisites: -CheckPrereqs. Run -GetPrereqs only in the lab and only after reading what it downloads or installs.
  5. Write the expectation before running: telemetry (event IDs, tables), the detection that should fire, and the sibling hunt skill (table below).
  6. Execute one test with -ExecutionLogPath pointing at the exercise log.
  7. Observe: pull telemetry and alerts for the host and window; capture record IDs.
  8. Cleanup with -Cleanup, verify the artefacts are gone, revert the snapshot.
  9. Score (blocked / alerted / logged / not seen / inconclusive) and hand gaps to detection-engineering or logging-coverage; record in purple-exercise-tracking.

Install and layout

  • Install the Invoke-AtomicRedTeam module and the atomics folder following the project's wiki (redcanaryco/invoke-atomicredteam, "Installing Invoke-AtomicRedTeam" and "Installing the atomics folder" pages). The wiki offers a PowerShell Gallery install and an install script; pick the one your change process allows. Do not copy a one-line download-and-execute cradle into tickets or runbooks.
  • Install only on lab hosts and approved test hosts. The atomics folder contains test payloads and tool references that AV/EDR will flag; on a monitored host that install itself produces alerts. Tell the SOC before installing.
  • The usual layout is C:\AtomicRedTeam\invoke-atomicredteam\ (module) and C:\AtomicRedTeam\atomics\ (one folder per technique, e.g. atomics\T1547.001\T1547.001.yaml). Confirm paths on your host; they are configurable.
  • Pin the atomics version: record the commit or release tag of the atomics folder in the exercise plan, and update deliberately, not on every run.
# Load the module and point it at the atomics folder (adjust paths to your install)
Import-Module "C:\AtomicRedTeam\invoke-atomicredteam\Invoke-AtomicRedTeam.psd1" -Force
$PSDefaultParameterValues = @{ "Invoke-AtomicTest:PathToAtomicsFolder" = "C:\AtomicRedTeam\atomics" }
Get-Help Invoke-AtomicTest -Full   # authoritative parameter list for your installed version

Listing and inspecting tests

# All tests for one technique on this OS: number, name, (and GUID in recent versions)
Invoke-AtomicTest T1547.001 -ShowDetailsBrief

# Full detail for one test: description, executor, command, input args, prereqs, cleanup
Invoke-AtomicTest T1547.001 -TestNames "Reg Key Run" -ShowDetails

# Tests for other platforms too (e.g. planning Linux tests from a Windows box); verify flag with Get-Help
Invoke-AtomicTest T1053.003 -ShowDetailsBrief -anyOS
  • Test names in this skill are examples as of writing ("Reg Key Run" under T1547.001); confirm the exact local name and number with -ShowDetailsBrief before every run.
  • Read the YAML directly when in doubt: atomics\T####\T####.yaml holds atomic_tests[].name, auto_generated_guid, supported_platforms, input_arguments, dependencies, executor.command, executor.cleanup_command and executor.elevation_required.
  • Never copy a GUID from memory or from a blog into a test card; copy it from the local YAML or -ShowDetails output.

Prerequisites

Invoke-AtomicTest T1003.001 -TestNames "<name from ShowDetailsBrief>" -CheckPrereqs   # read-only check
Invoke-AtomicTest T1003.001 -TestNames "<name from ShowDetailsBrief>" -GetPrereqs     # lab only: may download/install
  • -GetPrereqs runs each dependency's get_prereq_command, which can download third-party tools from the Internet. Read those commands first; on a host that must not reach the Internet, stage the prerequisite through your approved software channel instead.
  • A prerequisite blocked or quarantined by AV is itself a data point (blocked at the tool-staging stage), but the procedure under test is then inconclusive, not detected.

Running tests

$log = "C:\PurpleLogs\PT-2026-031.csv"

# Pin by name (preferred, survives renumbering) or by GUID copied from the local YAML
Invoke-AtomicTest T1547.001 -TestNames "Reg Key Run" -ExecutionLogPath $log
Invoke-AtomicTest T1547.001 -TestGuids "<auto_generated_guid from local YAML>" -ExecutionLogPath $log

# By number only after confirming the number on this atomics version
Invoke-AtomicTest T1053.005 -TestNumbers 1 -ExecutionLogPath $log

# Override inputs with lab values; never point arguments at real user data or shares
Invoke-AtomicTest T1074.001 -TestNumbers 1 -InputArgs @{ "output_file" = "C:\PurpleLab\stage.zip" }   # arg names come from -ShowDetails

# Cleanup with the same selector, then verify by hand
Invoke-AtomicTest T1547.001 -TestNames "Reg Key Run" -Cleanup
  • One test per execution during validation. Running a whole technique (T#### with no selector) or All mixes telemetry and makes scoring guesswork.
  • -InputArgs keys must match the input_arguments names shown by -ShowDetails; -PromptForInputArgs asks interactively (verify with Get-Help).
  • Tests marked elevation_required: true need an elevated session. Record whether the run was admin or standard user: coverage often differs.
  • -TimeoutSeconds bounds a hung test (verify default with Get-Help). A timeout is inconclusive until you know what ran.

Execution logging and SIEM correlation

  • -ExecutionLogPath appends to a CSV via the default execution logger. If omitted, the module writes to a default path in the temp directory (verify with Get-Help for your version). Always pass an explicit per-exercise path.
  • The CSV records execution time (UTC and local), technique, test number, test name, hostname, username and GUID; exact column names vary by version, so check the header.
  • Other logging modules exist (for example an Attire-format JSON logger used for VECTR import, a syslog logger, a Windows event log logger) via -LoggingModule; names and configuration are in the wiki, verify before use.
  • Keep host clocks NTP-synced; record the time zone of every timestamp in the card.
# Pull the last runs from the exercise log to build the SIEM query window
Import-Csv "C:\PurpleLogs\PT-2026-031.csv" | Select-Object -Last 5 | Format-List
// Defender XDR / Sentinel: everything on the test host around one atomic run (adjust host, times)
let host = "lab-win11-03"; let t0 = datetime(2026-11-20T09:58:00Z); let t1 = datetime(2026-11-20T10:15:00Z);
union
 (DeviceProcessEvents  | where Timestamp between (t0 .. t1) and DeviceName startswith host
   | project Timestamp, Src="proc", FileName, ProcessCommandLine, InitiatingProcessFileName, AccountName),
 (DeviceRegistryEvents | where Timestamp between (t0 .. t1) and DeviceName startswith host
   | project Timestamp, Src="reg", ActionType, RegistryKey, RegistryValueName, RegistryValueData),
 (AlertEvidence        | where Timestamp between (t0 .. t1) and DeviceName startswith host
   | project Timestamp, Src="alert", Title, AlertId, Severity)
| order by Timestamp asc
| comment "Splunk: Sysmon + Security events on the test host in the run window (adjust index, host, time)"
index=wineventlog (source="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" OR source="XmlWinEventLog:Security")
  host="LAB-WIN11-03" earliest="11/20/2026:09:58:00" latest="11/20/2026:10:15:00"
| table _time EventCode Image CommandLine ParentImage TargetObject Details
| sort _time
  • Subtract harness noise: powershell.exe loading the module, the -Session remoting (WinRM / wsmprovhost.exe) and prerequisite downloads are not the technique.

Remote execution over PSSession

# Windows target over WinRM (lab domain account with rights only on lab hosts)
$s = New-PSSession -ComputerName LAB-WIN11-03 -Credential (Get-Credential)
Invoke-AtomicTest T1547.001 -TestNames "Reg Key Run" -Session $s -CheckPrereqs
Invoke-AtomicTest T1547.001 -TestNames "Reg Key Run" -Session $s -ExecutionLogPath $log
Invoke-AtomicTest T1547.001 -TestNames "Reg Key Run" -Session $s -Cleanup
Remove-PSSession $s

# Linux target over SSH remoting (PowerShell 7 on both ends)
$l = New-PSSession -HostName lab-ubu-02 -UserName ptlab
  • Check the wiki for what must exist on the remote host in your version (atomics folder, payload paths) before relying on remote runs (verify).
  • Remoting is itself telemetry (4624 type 3, WinRM operational log, wsmprovhost.exe parent). Note it so it is not scored as lateral movement by the technique under test.
  • The execution log records the remote host name; confirm in the CSV.

Linux and macOS (pwsh)

  • Install PowerShell 7 (pwsh) and the module per the wiki; atomics with supported_platforms: linux or macos run through the sh / bash executors.
  • -ShowDetailsBrief lists only tests for the current OS; many Windows-only techniques have no Linux atomic.
  • Tests needing root: run pwsh with sudo only inside the lab VM, and record it.
  • Expected telemetry comes from auditd / auditbeat, Sysmon for Linux, EDR, and /var/log/auth.log or /var/log/secure. Confirm the rules exist before blaming the detection (logging-coverage).
# Linux lab VM: inspect and run one atomic, then clean up (names from -ShowDetailsBrief)
pwsh -Command 'Invoke-AtomicTest T1136.001 -ShowDetailsBrief'
sudo pwsh -Command 'Invoke-AtomicTest T1136.001 -TestNames "<name>" -ExecutionLogPath /var/tmp/PT-2026-032.csv'
sudo pwsh -Command 'Invoke-AtomicTest T1136.001 -TestNames "<name>" -Cleanup'
getent passwd | tail -3   # verify the test account is gone

Writing a benign custom atomic

Only for proving a pipeline or a detection on a harmless marker action. No payloads, no credential access, no download, no persistence that executes anything. Keep custom atomics in a separate folder (for example C:\PurpleLab\custom-atomics\) and point -PathToAtomicsFolder at it; never edit the upstream atomics in place.

# custom-atomics/T1112/T1112.yaml  - benign marker registry value (Modify Registry)
attack_technique: T1112
display_name: Modify Registry
atomic_tests:
- name: Purple marker registry value (benign)
  description: Writes a clearly labelled marker value under HKCU\Software\PurpleTeam to prove registry telemetry and the custom detection. No execution, no persistence.
  supported_platforms:
  - windows
  input_arguments:
    test_id:
      description: Exercise test ID written as the value data
      type: string
      default: PT-2026-033
  executor:
    name: powershell
    elevation_required: false
    command: |
      New-Item -Path "HKCU:\Software\PurpleTeam" -Force | Out-Null
      New-ItemProperty -Path "HKCU:\Software\PurpleTeam" -Name "Marker" -Value "#{test_id}" -PropertyType String -Force | Out-Null
    cleanup_command: |
      Remove-Item -Path "HKCU:\Software\PurpleTeam" -Recurse -Force -ErrorAction Ignore
  • A marker file variant (T1074.001, staging directory) writes a text file named after the test ID under a lab folder and deletes it in cleanup_command.
  • auto_generated_guid is generated by the project's tooling for upstream tests. Do not invent one: leave it out of a local file and select the test with -TestNames (verify your module version accepts that), or let the project tooling generate it.
  • Review: a second person reads command and cleanup, the test runs once in the lab with -ShowDetails, -Cleanup is proven, and the file is versioned with the exercise plan.

Typical breakages

SymptomLikely causeWhat to do
Atomics folder or payload quarantined at installAV/EDR signatures on test payloadsRecord as expected install noise; do not exclude the folder; run tests on a lab host where install was approved
Test errors "access denied" / process killedPrevention controlScore blocked, capture the protection event and alert ID
-CheckPrereqs failsMissing tool, wrong OS build, no InternetStage prereq via approved channel in the lab, or mark inconclusive
Test "succeeds" but no telemetryLogging gap or wrong host/time in queryCheck sensor health and clock, then logging-coverage
Different test ran than plannedRenumbering between atomics versionsUse -TestNames / -TestGuids, pin atomics version
Cleanup leaves artefactsCleanup command incomplete or test partially ranRemove by hand, document, revert snapshot; open an issue upstream if appropriate
Input path not foundDefault input points to a payload not downloadedRead -ShowDetails, run -GetPrereqs in the lab or override with -InputArgs

Expected telemetry and matching skill

Examples for common atomics; confirm test names locally and adjust to your sensors.

Technique (example atomic)Expected telemetryHunt / detect skill
T1547.001 Run key ("Reg Key Run")Sysmon 13 on ...\CurrentVersion\Run, DeviceRegistryEvents RegistryValueSethunt-windows-persistence
T1053.005 Scheduled taskSecurity 4698, TaskScheduler/Operational 106, Sysmon 1 schtasks.exehunt-windows-persistence
T1003.001 LSASS memorySysmon 10 TargetImage lsass.exe, EDR credential-theft alerthunt-credential-access
T1218.x signed binary proxy executionSysmon 1 / Security 4688 with parent-child chain, 4104 script blockhunt-lolbins
T1059.001 PowerShellPowerShell/Operational 4104, DeviceProcessEvents command linehunt-lolbins, detection-engineering
T1070.001 Clear Windows event logsSecurity 1102, System 104detection-engineering (lab only: destroys evidence)
T1021.002 / T1021.006 remote services4624 type 3, 5140/5145, WinRM operationalhunt-lateral-movement
T1558.003 Kerberoasting4769 with RC4 ticket encryption from one account to many SPNshunt-ad-identity-attacks
T1136.001 / T1053.003 on Linuxauditd useradd / crontab writes, auth loghunt-linux-persistence
T1105 ingress tool transferProxy/DNS logs, Zeek http.log, DeviceNetworkEventshunt-c2-beaconing, network-detection-suricata-zeek

Query language for the detection: kql-sentinel-defender, spl-splunk, elastic-eql-esql, portable rule via sigma-rules.

False positives & benign look-alikes

  • Alerts on the module import, the atomics folder or prerequisite downloads are harness noise, not detection of the technique.
  • Remoting artefacts of -Session resemble lateral movement; score only events produced by the test's own command.
  • A generic "suspicious PowerShell" alert firing for every test proves telemetry, not a specific detection; score it as low-fidelity alerted.
  • Software deployment tools and admins create run keys, tasks and services legitimately; the detection under test must still distinguish them (tune in detection-engineering, not by allowlisting the test).
  • Anything on hosts, accounts or times outside the test card is not "the purple team" until proven: stop and triage it.

Pitfalls

  • Running Invoke-AtomicTest T#### without a selector and getting every test for the technique at once.
  • Trusting test numbers from a document written against another atomics version.
  • -GetPrereqs on production or on a host with Internet access you did not approve.
  • Testing only as local admin with EDR in audit mode and reporting it as production coverage.
  • Forgetting -Cleanup, or not verifying it: leftover run keys, tasks or accounts become real persistence and future false incidents.
  • Reverting the snapshot before exporting telemetry and the execution log.
  • Treating a quarantine as a failed test and "fixing" it with an exclusion.

Output

  • Execution log CSV (or Attire JSON) per exercise, stored with the evidence.
  • One completed test card per run: technique, test name, GUID from the local YAML, atomics version, host, account, elevation, UTC time, expected vs observed telemetry, alert ID or "none", outcome, cleanup verified (how).
  • Gaps handed to detection-engineering (logic) or logging-coverage (telemetry), with the atomic as acceptance test; hardening gaps to hardening-windows-ad or hardening-linux.
  • Results recorded in purple-exercise-tracking; scorecard via /scorecard; single test cards via /emulate. The emulation-operator agent runs this skill.

References

  • MITRE ATT&CK techniques referenced, e.g. https://attack.mitre.org/techniques/T1547/001/
  • Red Canary: Atomic Red Team project (atomics YAML format, contribution guide).
  • Red Canary: Invoke-AtomicRedTeam wiki (installation, execution, logging modules, remote execution, cleanup).
  • Microsoft Learn: Sysmon, Defender XDR advanced hunting schema (DeviceProcessEvents, DeviceRegistryEvents, AlertEvidence).
  • purple-team-validation for rules of engagement and scoring definitions.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.