Lab 10 — Test your detections: run Atomic Red Team and catch it in Wazuh
0 / 7 steps
The goal
Run one Atomic Red Team test on your Kali VM, find the Linux log it creates, and follow it into a Wazuh alert. Then remove the test account and repeat the experiment. You leave with evidence that one specific detection works on your machine, plus a method you can use again.
Your lab VM only. Use the Kali VM and Wazuh agent from Lab 08. Take a snapshot first. This test creates a real local account; run only the selected Linux test, keep monitoring enabled, and remove the account in step 06 even if no alert appears. Run Kali commands inside the VM, never on your everyday computer or the Wazuh manager.
Where this fits. Lab 08 proved your agent could report. Now you are testing a prediction: creating a local account should produce a log that Wazuh recognises. Atomic Red Team is a library of small tests mapped to MITRE ATT&CK. Choosing a named test, recording its inputs and checking the result makes the experiment repeatable.
Before you start. Keep your existing Wazuh Docker stack running, with kali-lab Active in the dashboard and /var/log/auth.log being collected. Use your actual agent name if you chose a different one. Lab 09 is useful background for reading the source logs, but is optional.
Steps
01Check the signal path
In a Kali terminal, check the two services and the log file:
systemctl is-active wazuh-agent rsyslog sudo test -r /var/log/auth.log && echo 'auth.log is readable' sudo grep -F '/var/log/auth.log' /var/ossec/etc/ossec.conf
Expect two active lines, the readable-file message, and an auth.log entry in the agent configuration. An entry alone does not prove it is enabled: it must be inside an active <localfile> block using syslog. If these checks fail, fix collection using Lab 08 before continuing.
In Wazuh → Threat Hunting, choose Last 15 minutes, refresh, and filter to your VM:
agent.name:"kali-lab"
Confirm the agent is Active and note the most recent event time. Leave this view open. The Linux hostname can differ from the Wazuh agent name.
Why check first. A missed alert is useful evidence only when you know the test ran and the log could reach the manager.
02Read the exact Atomic test
Open the fixed revision of the official test definition. Use its first test, Create a user account on a Linux system, under T1136.001. Its GUID is 40d8eabd-e394-46f6-8785-b9bfa1d011d2. The link fixes the source version so a future repository update cannot silently change this exercise.
Read the executor and cleanup_command sections. The executor is Bash and requires elevated rights. We will supply sg-atomic10 for the username input.
The command uses -M to avoid creating a home directory, -N to avoid a new same-name group, and -r to create a system account. It sets a Bash shell and an account comment. It supplies no password; standard useradd defaults leave password authentication locked. This is still a real account, so cleanup matters.
We use Atomic Red Team's documented manual execution method: run the selected test's command with its input filled in. This test needs no downloaded payload or execution framework. The command in step 03 preserves its flags; sudo supplies the required privilege.
Write the prediction. “Creating sg-atomic10 on my monitored Kali VM will leave a useradd event in auth.log and a new-account alert in Wazuh.” Save the GUID and source link beside it.
03Run the selected test once
In Kali, record the time and hostname, then run this guarded block. It refuses to create the account if that name already exists:
date -Is hostname if getent passwd sg-atomic10 >/dev/null; then echo 'STOP: sg-atomic10 already exists. Do not alter or delete it.' else sudo useradd -M -N -r -s /bin/bash -c evil_account sg-atomic10 && getent passwd sg-atomic10 fi
A successful run prints an account record beginning sg-atomic10:. The numeric IDs depend on your VM. If you see STOP or a useradd error, the test did not create a new account: resolve that before claiming a result. Do not delete an account that predated this lab.
Record the printed timestamp as Run 1. Keep this account unused: do not set a password, add privileges, or log in as it.
What you just tested. Local account creation is ATT&CK sub-technique T1136.001. You already had sudo rights; this command does not demonstrate an initial compromise or privilege escalation.
04Find the event on Kali
Look for the account-creation event in Kali's auth.log:
sudo grep -E 'useradd\[[0-9]+\]: new user: name=sg-atomic10,' /var/log/auth.log | tail -n 5
Find the line containing useradd[ and new user: name=sg-atomic10,, with a timestamp matching Run 1. Save the complete line in your notes. A sudo line that merely mentions the command is not the same evidence.
If nothing appears, check the journal as well:
sudo journalctl -t useradd --since "15 minutes ago" --no-pager
If the journal has the creation event but auth.log does not, investigate rsyslog and the Lab 08 file-collection setup. If neither has it, check the command result and time window. Do not manufacture a log line to make the exercise pass.
Follow the evidence. The account record proves a state change. The useradd line proves a local log was written. The next step tests whether Wazuh received and classified it.
05Find what Wazuh caught
Return to Threat Hunting, refresh, and use this search. Widen the time picker to Last 1 hour if the lab has taken longer:
agent.name:"kali-lab" AND full_log:"sg-atomic10"
Expand a result and inspect full_log. Choose the useradd new-user event from Run 1. A sudo alert mentioning the username proves only that the command was logged. Record these fields from the creation alert:
- timestamp and agent.name — does the event belong to this run and this VM?
- rule.id, rule.level and rule.description — which detection classified it?
- full_log — does it contain the same account and creation event you saved on Kali?
- rule.mitre.id — which ATT&CK identifier did your ruleset attach?
The upstream syslog rules provide a useful reference: rule 5902, level 8, with the description “New user added to the system.” Its mapping is the parent technique T1136; the Atomic test is the more specific T1136.001. Record what your installed ruleset actually shows. Searching only for the sub-technique can hide a valid parent-mapped alert.
Once you have confirmed that your creation alert uses 5902, narrow the search:
agent.name:"kali-lab" AND rule.id:5902 AND full_log:"sg-atomic10"
What a pass means. Wazuh detected this account-creation event through this log source. An alert does not mean the action was blocked, and one passing test does not prove coverage of every way to create an account.
06Remove the test account
After saving the evidence — or before leaving a failed attempt — remove only the account you created in step 03. In Kali, run the test's cleanup command with the same input:
sudo userdel sg-atomic10
Now check that the account is gone:
if getent passwd sg-atomic10; then echo 'STOP: the account still exists; investigate cleanup.' else echo 'Clean: sg-atomic10 is absent.' fi
Expect the Clean message. If userdel reports an error, investigate it; do not force deletion or kill unrelated processes. This test created no home directory or same-name group, so its cleanup does not need recursive file deletion.
Refresh the broader username search from step 05. A deletion event may appear under rule 5903 (level 3 in the upstream rules), depending on your alert threshold. Keep the original creation evidence. Removing the account does not remove its historical alerts.
Cleanup is part of the test. A working detection exercise ends with a checked system state, even if its alert search failed.
07Repeat it and write the result
With the account confirmed absent, repeat steps 03–06 once. Record a fresh timestamp as Run 2 and find its new creation event. Compare timestamps and event details so an old Run 1 alert cannot count as your second success. Finish with the account absent again.
Copy this record into your lab notes and fill it with your own observations:
Test: T1136.001 | GUID 40d8eabd-e394-46f6-8785-b9bfa1d011d2 Method/input: manual Bash executor | username=sg-atomic10 Source revision: e2115e52c0fb1e67c4f23c73eeb83cb022805dc4 Environment: Kali version / Wazuh manager and agent versions Run 1: start time + timezone / hostname / agent name Run 1 evidence: source log / alert timestamp / rule ID / level / ATT&CK ID Run 2: start time + timezone / new source log / new alert timestamp Cleanup: account absent after each run? yes/no Result: detected / local log only / execution failed Interpretation: what this proves, and what remains untested
Take a screenshot of the expanded Wazuh creation alert with its host, time, rule and full_log visible. Pair it with the source log and cleanup check. If the two runs disagree, document the difference and work through the checks below.
Why repeat. Repeatable evidence gives you a baseline you can compare after an agent upgrade, a collection change or a ruleset change.
You have selected an Atomic test, checked its effects, traced a local event into Wazuh, verified cleanup and repeated the experiment. Keep the evidence with the test definition so someone else can check your conclusion.
If it didn’t work
- The account already exists. Stop before changing it. Use your snapshot or establish who created it. Cleanup applies only to this lab's account.
- useradd failed. Read the error. A missing default group, unavailable sudo rights or an existing username is an execution problem, not a missed detection. Inspect sudo useradd -D if the default group is the issue.
- The source event exists only in the journal. Revisit rsyslog in Lab 08. The collection path used here is auth.log; having journal data alone does not establish that path.
- auth.log has the event but the dashboard does not. Confirm the agent name, Active status, time range and clock. Check the agent's auth.log localfile block and connection log. If you fix collection, clean up and generate a new test event; do not assume old lines will be replayed.
- Only a sudo result appears. Inspect full_log and find the actual useradd creation message. Start with the broad username query before filtering by rule ID or ATT&CK.
- The rule differs or no creation alert appears. Use Wazuh's decoder and rule test tool on the manager with the exact source line. A matching logtest result checks classification only; it does not prove the agent-to-dashboard path. Also check local rule overrides and the alert threshold.
Your turn — tune the hunt
Save a Threat Hunting search named Lab 10 — local account creation, scoped to your agent and the creation rule you actually observed. Remove the username filter to see other account creations on that VM. Compare the narrow test search with this broader hunt and explain which question each answers.
Then record the time and run getent passwd root on Kali. It reads an existing account; it should not create a new useradd event or a new 5902 alert. Check only the fresh time window. This comparison helps you separate account creation from a command merely mentioning an account. Keep the default detection active; a saved search changes what you view, not what the manager detects.
Before you leave — prove it
One: show the local log and the corresponding Wazuh alert for the same run. Two: explain why an Atomic T1136.001 test can produce an alert mapped to T1136. Three: show that sg-atomic10 is absent after your final run. If you cannot show the alert, label the result honestly and say where the evidence stops.
What you learned
- Atomic test selection — identify one test by its GUID, source revision and inputs.
- Detection validation — separate execution, local logging, alerting and prevention.
- ATT&CK mapping — recognise a parent technique versus a sub-technique.
- Repeatability — compare fresh evidence and verify cleanup every time.
Put it on your resume. Validated a SIEM detection end to end: ran an Atomic Red Team test, traced its Linux log entry to a Wazuh alert, then cleaned up and re-tested. Change it to match what you actually did.
Tried it? Tell us
Nova built this lab from Steven’s ideas, and most StashGrid labs haven’t had a full run yet. If a step broke, behaved differently for you, or you know a better way, tell us. Ideas for the next lab are welcome too — no promises on timing.
NextLab 11 — Build your analysis VM and triage a file safely→
Go deeper
- Lab 08 — enroll a Wazuh agent — repair or rebuild the collection path.
- Lab 09 — first-response Linux log triage — investigate the evidence on the endpoint.
- Atomic Red Team: getting started — manual testing, inputs and cleanup.
- The exact Atomic test source used here — review the selected Linux test before running it.
- MITRE ATT&CK: Local Account — the behaviour this test represents.
- Wazuh log-file collection and Debian useradd manual — collection configuration and account flags.
Original walkthrough built from the linked Atomic Red Team test and official documentation. Sources reviewed September 24, 2026. Expected rule values are source-based references; this walkthrough has not been independently run end to end on the Lab 08 VM. Use your own evidence to establish the result. If a step or dashboard label has changed, tell me so I can fix it.