Simulate attacks in the lab
Generate realistic attack telemetry in your own lab with safe emulation tools.
By Invicly Tech, , in Cyber Security Fundamentals. About 10 minutes to read.
In short
To test detections you need realistic attacker activity. Safe emulation tools like Atomic Red Team run small, documented tests mapped to ATT&CK techniques in your own lab, letting you see which ones your detections catch.
Explained simply
To know whether your detections work, you have to see what an attack looks like in your own logs. Waiting for a real attacker is not a plan. So defenders use adversary emulation: running small, safe, documented copies of attacker actions in a lab, on purpose.
Atomic Red Team, from the security company Red Canary, is a free library of these small tests, called atomics. Each atomic is mapped to one MITRE ATT&CK technique, lists its commands, says what it needs to run, and includes a cleanup command to undo its changes.
Most atomics do not use real malware. They do what attackers do with normal tools: create a scheduled task, add a registry key that runs at startup, list domain admins, or read sensitive memory. That is enough to create realistic telemetry, the logs and events your SIEM sees.
The workflow is simple and repeatable: take a snapshot, run one test, look at what the SIEM saw, write down the result, then restore the snapshot. Doing this carefully, one technique at a time, gives you an honest map of what you catch and what you miss.
Press Play on a diagram to walk through it one step at a time.
- 1Snapshot
Save a clean VM state.
- 2Run test
Execute an atomic test.
- 3Observe
Check alerts and logs.
- 4Reset
Restore the snapshot.
- Back to step 1
- Prevented
- Defender or EDR blocked it
- Record the control that stopped it
- Alerted
- Rule fired with useful detail
- Check alert severity and context
- Telemetry only
- Logs exist, no rule
- Next step: write a detection
- Nothing seen
- Logs missing or not forwarded
- Next step: fix collection
In depth
Safety rules before you run anything
Run tests only in your isolated lab, on machines you own. Confirm isolation again before each session. Some atomics download files from the internet; with the lab offline, download prerequisites during the setup window, then disconnect.
Read each test before you run it. Atomic tests are real commands that change the system: they create accounts, change security settings or stop services. The test YAML shows exactly what will run and what the cleanup does. Some tests are designed to be destructive (for example ones that delete shadow copies or wipe logs), so read the description and pick tests deliberately.
Antivirus and Microsoft Defender will block some tests. That is useful information: record it as prevented. If you want to see the raw telemetry, add a narrow exclusion for the Atomic Red Team folder in the lab only, and write down that you did, since it changes the result.
- Snapshot first, every time
- Read the test definition before running
- Run one technique at a time so results are clear
- Record any security setting you changed
Running atomics with Invoke-AtomicRedTeam
Invoke-AtomicRedTeam is a PowerShell module that runs the tests. It works on Windows PowerShell and on PowerShell 7 (pwsh), so it can run Linux and macOS tests too. Install it, with the atomics folder, during your online setup window.
The main command is Invoke-AtomicTest followed by a technique ID. Useful switches: -ShowDetailsBrief lists the tests for a technique, -ShowDetails prints the full commands, -CheckPrereqs checks whether the test can run, -GetPrereqs installs what it needs, -TestNumbers picks specific tests, and -Cleanup undoes a test.
Each run is written to an execution log, a CSV file in your temp folder by default, with the time, technique, test name and host. Keep it: it is your ground truth when you later check which alerts fired.
- 1Snapshot VM
Clean restore point
- 2ShowDetails
Read exactly what will run
- 3CheckPrereqs
Fix missing items while online
- 4Run test
Note the UTC time
- 5Observe SIEM
Telemetry? Alert?
- 6Cleanup or restore
Return to clean state
Choosing a good first test set
Start with common, low-risk techniques that real attackers use often and that teach you different log sources. A sensible first set covers several tactics.
Discovery: T1082 System Information Discovery and T1087.001 Local Account discovery create process events with simple commands. Execution: T1059.001 PowerShell tests generate script block logs. Persistence: T1053.005 Scheduled Task and T1547.001 Registry Run Keys produce process, registry and task events. Credential Access: T1003.001 LSASS Memory shows process access events (Sysmon event 10) and is a great detection target. Defense Evasion: T1070.001 Clear Windows Event Logs produces event 1102, one of the most important alerts. On Linux, T1053.003 Cron and T1136.001 Create Local Account generate useful auth and audit logs.
Aim for about ten techniques across five or more tactics. Breadth first, then depth: later, run several tests for the same technique to see how detections cope with variations.
Recording results honestly
For every test, record five things: technique ID and test number, UTC start time, whether it was prevented, whether telemetry appeared in the SIEM, and whether an alert fired (and which rule). These are different outcomes. Prevented means a control stopped it. Telemetry only means you could find it by searching, but nobody would be told. Alerted means a rule fired on it.
Telemetry without an alert is the most common result and the most useful. It tells you the logs are there and you only need a rule. No telemetry means you must fix collection first, for example a missing Sysmon config section or an audit policy.
Turn the table into an ATT&CK Navigator layer: green for alerted, yellow for telemetry only, red for nothing. This colour map becomes your to-do list for the next topic, where you write detections for the gaps.
Learn it in 4 short steps
About 1h each. Track them with a timer in your plan.
- 1Snapshot VMs before testing~1h
- 2Run Atomic Red Team tests in lab~1h
- 3Record which ATT&CK techniques ran~1h
- 4Check which ones raised alerts~1h
Key points
- Emulation generates realistic telemetry safely.
- Atomic tests map to specific ATT&CK techniques.
- Snapshot before and reset after each test.
- Record which techniques raised an alert.
Key terms
Tap a card to flip it. 0/4 known
Examples
Emulate scheduled task persistence (T1053.005)
Goal: see whether creating a scheduled task is detected. Step 1: restore the Windows VM baseline snapshot. Step 2: list the tests for T1053.005 and read test 1 in full. Step 3: check prerequisites. Step 4: run only test 1 and note the UTC time. Step 5: in the SIEM, search for schtasks.exe process creation around that time and for event 4698 if task auditing is on. Step 6: record the outcome, then run cleanup and restore the snapshot.
Import-Module invoke-atomicredteam
Invoke-AtomicTest T1053.005 -ShowDetailsBrief
Invoke-AtomicTest T1053.005 -TestNumbers 1 -ShowDetails
Invoke-AtomicTest T1053.005 -TestNumbers 1 -CheckPrereqs
(Get-Date).ToUniversalTime()
Invoke-AtomicTest T1053.005 -TestNumbers 1
Invoke-AtomicTest T1053.005 -TestNumbers 1 -CleanupGenerate SSH password guessing against your own Linux VM
Goal: check that repeated failed SSH logins raise an alert. Step 1: on the Linux VM, create a test user with a known weak password used only in the lab. Step 2: from another lab VM, make a few failed SSH logins in a loop (no special tools needed). Step 3: on the Linux VM, confirm the failures in auth.log or the journal. Step 4: in the SIEM, check whether a brute-force rule fired and how many failures it needed. Step 5: delete the test user and restore the snapshot. This maps to T1110.001 Password Guessing.
# from another lab VM, against your own lab host only
for i in $(seq 1 10); do
sshpass -p "wrong$i" ssh -o StrictHostKeyChecking=no \
-o PreferredAuthentications=password labuser@10.10.10.30 true
done
# on the Linux VM
sudo journalctl -u ssh --since "5 min ago" | grep -c "Failed password"Quick reference
- Invoke-AtomicTest T1053.005 -ShowDetailsBrief lists the tests for a technique
- -ShowDetails prints commands; -CheckPrereqs and -GetPrereqs handle dependencies
- -TestNumbers 1 runs one test; -Cleanup undoes it
- Keep the execution log CSV as ground truth for what ran and when
- Four outcomes: prevented, alerted, telemetry only, nothing seen
- Event 1102 (audit log cleared) is a must-have alert
- Sysmon event 10 (process access) is key for detecting LSASS dumping
- Navigator colours: green alerted, yellow telemetry only, red nothing
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
Run T1082 System Information Discovery test 1 on your Windows VM and find the resulting process creation events in your SIEM.
- Exercise 2medium
Run one test each for T1059.001, T1547.001, T1003.001 and T1070.001, restoring the snapshot between them, and fill in a results table with the four outcomes.
- Exercise 3hard
Turn your results table into an ATT&CK Navigator layer file with scores (2 alerted, 1 telemetry only, 0 nothing), load it into Navigator and export a picture for your report.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- Is Atomic Red Team legal to use?
- Yes, it is a free, open-source tool made for defenders. Using it on systems you own or are explicitly authorised to test is legal; running it against other people's systems without permission is not.
- What is the difference between Atomic Red Team and Caldera?
- Atomic Red Team runs small, single tests that you choose one by one. MITRE Caldera is a platform that chains many techniques automatically through an agent, closer to a full attack scenario.
- Do atomic tests use real malware?
- Mostly no. They usually use built-in commands or well-known security testing tools to imitate attacker behaviour, though some download tools that antivirus flags, which is why they belong in an isolated lab.