In this section

0.10 Acting on an Endpoint at Scale

Module 0

Introduction

Everything in this module so far has read the endpoint. This lesson changes it. The same collection that listed processes can kill one, the same hunt that stacked cron entries can remove them, and the same fleet-wide reach that made lesson 0.7's question cheap makes a mistake expensive.

Velociraptor treats acting as one more thing an artifact can do, which is exactly why acting needs a discipline the tool does not supply.

The lesson returns to the five-host fleet from lesson 0.7, where the cron stack put /etc/cron.d/sys-update on web-02 and db-01 and the process stack found kworkerd running from /tmp/.cache on db-01. It labels the two hosts, runs a remediation artifact on them first as a dry run and then for real, verifies the whole fleet, and reads the server's own record of what was done.

Module 10 covers response, containment and reporting in full; this lesson sets the order the rest of the course follows.

1

Before Anything Changes

Preserve, contain, eradicate, verify, record

Response has an order, and Velociraptor does nothing to enforce it. The artifact below would delete files just as readily before copying them as after, and a hunt aimed at the wrong label would run on the wrong hosts as quickly as on the right ones.

The order is the analyst's to keep. It is worth writing down before the first change: which hosts, which artifacts, which parameters, who approved, and what will show it worked. In an incident the person running the hunts is rarely the only person who needs to know what they are about to do.

ResponseResponding in order
PreserveCopy what will be removed, with hashes, before removing it
ContainStop it spreading or calling out: quarantine, kill
EradicateRemove the persistence and the files
VerifyAsk the whole fleet again, and prove the answer can be yes
RecordWho did what, when, from the server's audit log

Preservation comes first because removal is permanent and the evidence is often the only thing that says what an intruder did.

The binary in /tmp/.cache is the kind of file lesson 0.5 recovered through /proc and the script the kind lesson 0.9 timelined; once removed, neither can be examined again unless a copy was taken. A copy with a hash also lets anyone later confirm that what was analyzed is what was on the host.

Containment before eradication is a judgment, not a rule of order. Killing a process or deleting a file tells an intruder who is still watching that they have been found, and an intruder who knows has every reason to use whatever access is left before it goes.

That argues for acting on every known host at once rather than one at a time, which is what a hunt does, and for containing first wherever there is doubt about how much is known. On this fleet the investigation had already asked every host the same questions in lesson 0.7, which is what makes a single coordinated action defensible.

Label2 hostsDry runplannedActkill, removeVerify5 hostsAuditwho, whenpreserve runs in both

Every step that changes a host sits between a rehearsal and a check, and preservation happens even in the rehearsal.

The last row is the one most often skipped. A response that cannot say who did what, to which hosts, and when, cannot be reviewed, and in a regulated environment it cannot be defended. Section 7 shows that the server keeps this record without being asked.

2

Who May Act

The permissions response requires

Lesson 0.2 showed the investigator role refused when a query tried to run a program on an endpoint, because running programs needs the EXECVE permission. Response artifacts declare the permissions they need in their definitions, and the server checks them against whoever schedules the collection.

PermissionsWhat a response artifact asks of the server
Custom.Linux.Remediation.SysUpdateEXECVE for kill, FILESYSTEM_WRITE for rm()
Linux.Remediation.QuarantineEXECVE and NETWORK: it runs nft
collect_client()COLLECT_CLIENT, COLLECT_SERVER or COLLECT_BASIC
Investigator roleRefused EXECVE in lesson 0.2
Grant response permissions to the few who should act, not to everyone who reads

The remediation artifact in this lesson declares EXECVE because it runs kill, and FILESYSTEM_WRITE because rm() requires it, as the function's reference page states. The quarantine artifact in section 6 declares EXECVE and NETWORK because it runs nft.

An investigator can read everything this module has shown and still be unable to change a host, which is the right default: the people who look are many, and the people who act should be few, named and accountable.

Automation is no exception: a script that launches remediation hunts should run under its own API identity with exactly the permissions it needs, so its actions are distinguishable in the audit log from any analyst's.

The declaration in the artifact is a promise as much as a check. A reviewer reading Custom.Linux.Remediation.SysUpdate sees at the top that it runs programs and writes to the filesystem before reading a line of its query, and a server can be configured so that only certain users may collect artifacts that make those demands.

An artifact that changes hosts without declaring it is a review failure waiting to happen, which is why the definition here lists both permissions even though the lab's administrator identity would have run it without them.

3

Aiming at the Right Hosts

Labels from the investigation

Lesson 0.7's stack named two hosts. A label turns that finding into a target that every response step can share, so the dry run, the action and any follow-up are aimed at exactly the same set:

VQL2 rows
SELECT client_id, os_info.hostname AS Hostname,
       label(client_id=client_id, labels='compromised', op='set').Labels AS Labels
FROM clients() WHERE os_info.hostname IN ('web-02', 'db-01')
client_idHostnameLabels
C.2a6bda0881395018db-01compromised
C.a4f2ed2993378580web-02compromised

The two hosts lesson 0.7's cron stack named, labeled so every response hunt can be aimed at them.

The hunting documentation notes that labeling a client schedules any active hunt aimed at that label onto it. In response this is a feature with an edge. A third host found later can be brought into the remediation by labeling it, with no new hunt; and a label applied to the wrong host sends a remediation to a host nobody meant to touch.

The label is the scope of the response, and it deserves the same care as the response itself. A clear name helps: compromised says what the hosts are; a name like ir-0042-remediate ties them to a case and makes the audit log easier to read. Removing the label when the case closes keeps a later hunt aimed at it from reaching hosts that have long since been cleaned.

remediation huntverification huntweb-01web-02db-01db-02build-01

Act narrowly, check widely. The verification hunt is aimed at every host, because the question it answers is about the fleet.

The verification in section 5 deliberately ignores the label. Acting narrowly limits the damage of a mistake; checking widely catches the hosts the investigation missed.

4

A Dry Run First

One artifact, two modes

The remediation artifact, Custom.Linux.Remediation.SysUpdate, does three things in a fixed order inside a single query, so that nothing can run ahead of the step before it: it uploads every file it will remove, kills every process running from /tmp/.cache, and removes the files.

A DryRun parameter, on by default, replaces the kill and the removal with the word planned, while the upload still runs. The hunt with DryRun on, and its results:

VQL7 rows
LET h <= hunt(artifacts='Custom.Linux.Remediation.SysUpdate',

spec=dict(Custom.Linux.Remediation.SysUpdate=dict(DryRun='Y')), include_labels='compromised', description='Remediate sys-update: dry run', expires=now() + 86400) SELECT h.HuntId AS HuntId FROM scope()

SELECT Fqdn AS Host, Step, Action, Target, Result FROM hunt_results(hunt_id='H.DC86NL61F7UR8', artifact='Custom.Linux.Remediation.SysUpdate') ORDER BY Host

HostStepActionTargetResult
db-011preserve/etc/cron.d/sys-updated7a4a3624715d530...
db-011preserve/tmp/.cache/kworkerd8ac215ec4c1ce4a9...
db-012killpid 7 /tmp/.cache/kworkerdplanned
db-013remove/etc/cron.d/sys-updateplanned
db-013remove/tmp/.cache/kworkerdplanned
web-021preserve/etc/cron.d/sys-updated7a4a3624715d530...
web-023remove/etc/cron.d/sys-updateplanned

The dry run on the two labeled hosts: everything preserved, every kill and removal listed as planned, nothing changed.

The dry run answers the questions that matter before anything changes. It found the cron file on both hosts and the binary only on db-01, which matches lesson 0.7; it found one process to kill, on db-01; and it already preserved everything, with a SHA256 for each file. The hash of the cron file is the same on both hosts, which says the same file was placed on each.

The dry run's output is also the document to show before acting. A service owner asked to approve "remediation on db-01" has little to judge; shown the exact files, their hashes and the one process to be killed, they can say whether anything on the list is theirs, and occasionally it is.

Saving the dry run's hunt ID in the case notes ties the approval to the exact plan that was approved.

The documentation's advice on hunts applies twice over here: test on one or two endpoints before launching widely. A remediation's dry run is that test, run on the exact hosts and with the exact parameters the action will use.

Two design choices in the artifact are worth copying. DryRun defaults to on, so a hunt launched without setting it does nothing harmful; the dangerous mode has to be asked for by name.

And every step is materialized with LET ... <= before the final SELECT, which evaluates it at that point in the query, so the uploads complete before the kill runs and the kill before the removals, rather than leaving the order to however the engine schedules the rows.

The process the dry run found is pid 7. In the lab, each fleet host runs in its own process namespace, so the numbers are small; on a real server the pid would be whatever the kernel assigned, and it can be reused by an unrelated process after this one exits.

The artifact finds processes by their executable path at the moment it runs, never by a pid copied from an earlier collection, for exactly that reason.

5

Acting, and Checking It Worked

The action, the evidence kept and the fleet asked again

With the dry run read and its plan matching the investigation, the action was the same hunt on the same label with one parameter changed, DryRun off:

VQL7 rows
LET h <= hunt(artifacts='Custom.Linux.Remediation.SysUpdate',

spec=dict(Custom.Linux.Remediation.SysUpdate=dict(DryRun='N')), include_labels='compromised', description='Remediate sys-update', expires=now() + 86400) SELECT h.HuntId AS HuntId FROM scope()

SELECT Fqdn AS Host, Step, Action, Target, Result FROM hunt_results(hunt_id='H.DC86NNVU84A7I', artifact='Custom.Linux.Remediation.SysUpdate') ORDER BY Host

HostStepActionTargetResult
db-011preserve/etc/cron.d/sys-updated7a4a3624715d530...
db-011preserve/tmp/.cache/kworkerd8ac215ec4c1ce4a9...
db-012killpid 7 /tmp/.cache/kworkerd0
db-013remove/etc/cron.d/sys-updateTrue
db-013remove/tmp/.cache/kworkerdTrue
web-021preserve/etc/cron.d/sys-updated7a4a3624715d530...
web-023remove/etc/cron.d/sys-updateTrue

The same hunt with DryRun off: one process killed with exit code 0, 3 files removed, every one preserved first.

The kill returned exit code 0 and rm() returned true for each of the 3 files.

The preserve rows are identical to the dry run's, the same files with the same hashes, which shows nothing changed between rehearsal and action. kill -9 sends SIGKILL, which a process cannot catch or ignore, so it ends without running any cleanup of its own; for an intruder's process that is the point. The server kept the copies:

VQL2 rows
SELECT client_info(client_id=ClientId).os_info.hostname AS Host,
       Flow.total_uploaded_files AS Files,
       Flow.total_uploaded_bytes AS Bytes
FROM hunt_flows(hunt_id='H.DC86NNVU84A7I')
HostFilesBytes
db-01235400
web-02164

What the server kept from each host before anything was removed.

The preserved hash of kworkerd is worth one more look. It is the hash of the system's own /bin/sleep, because the lab's intruder copied that binary under a new name.

In a real case, comparing a preserved hash with the hashes of the host's own binaries, and with threat intelligence, is the first step in finding out what was actually running; a renamed system tool and a custom implant call for very different follow-up.

A successful action on two hosts is not yet a result about the fleet. The verification hunt asked all five hosts again for their cron entries and processes, with no label:

VQL0 rows
SELECT Command, count() AS Hosts, enumerate(items=Fqdn) AS OnHosts
FROM hunt_results(hunt_id='H.DC86NRIC8SUCK', artifact='Linux.Sys.Crontab/CronTabs')
WHERE Command =~ '/tmp/'
GROUP BY Command
CommandHostsOnHosts
No rows

A fresh cron hunt across all five hosts, filtered to anything running from /tmp: nothing.

The process list from the same hunt, filtered the same way:

VQL0 rows
SELECT Fqdn AS Host, Pid, Exe
FROM hunt_results(hunt_id='H.DC86NRIC8SUCK', artifact='Linux.Sys.Pslist')
WHERE Exe =~ '^/tmp/'
HostPidExe
No rows

The same hunt's process list, filtered to executables in /tmp: nothing.

Two empty results, and on their own they prove nothing. Lesson 0.8 showed a detection that returned nothing because it could not read its source. The test is the same here: show that the query can return rows. The same hunt read plenty of both:

VQL2 rows
SELECT count() AS N FROM hunt_results(hunt_id='H.DC86NRIC8SUCK',

artifact='Linux.Sys.Crontab/CronTabs') GROUP BY 1

SELECT count() AS N FROM hunt_results(hunt_id='H.DC86NRIC8SUCK', artifact='Linux.Sys.Pslist') GROUP BY 1

SourceN
CronTabs rows40
Pslist rows6

The proof the empty results mean something: the same hunt returned rows from both artifacts, and none of them matched.

Every host answered, both artifacts returned rows, and none of them ran from /tmp. That is a verified absence, which is the only kind a response can close on.

It is a verified absence of what was looked for, and no more. The verification asked about cron and processes because those were what the investigation found. Lesson 0.3 listed the other places a Linux host can be told to run something: systemd timers and services, shell profiles, authorized_keys files that let an intruder back in without a password, and more.

An intruder who planted one persistence mechanism may have planted two, and a response that removes the one it found and verifies only that one can close with the other still in place. The verification hunt is the place to widen the question, at little cost, before the incident is declared over.

6

Network Quarantine

Containment when removal has to wait

Sometimes a host cannot be cleaned yet: the investigation is not finished, the owner needs time, or what is running is not understood. Containment buys time by cutting the host off while keeping it reachable for investigation. Velociraptor's Linux quarantine artifact does this with nftables:

$ velociraptor artifacts show Linux.Remediation.Quarantine \
    | grep -E -A1 'required_permissions|- EXECVE|name: (TableName|RemovePolicy|ForbiddenTestURL)'
required_permissions:
  - EXECVE
  - NETWORK
--
  - name: TableName
    default: vrr_quarantine_table
--
  - name: ForbiddenTestURL
    default: https://www.google.com
--
  - name: RemovePolicy
    type: bool

The definition's description fills in what the parameters do:

Linux.Remediation.QuarantineNetwork quarantine on Linux
MechanismAn nftables table with inbound, outbound and forward chains
AllowedDNS lookups and the Velociraptor server, nothing else
TestForbiddenTestURL must fail once the table is in place
UndoRun again with RemovePolicy set
Needsnft on the host; the lab did not run it, as it cuts the network

The design is the one that makes quarantine usable: everything is blocked except DNS and the Velociraptor server, so collections and hunts keep working on a host that can no longer reach anything else.

ForbiddenTestURL is the artifact's own check that the block took effect, and RemovePolicy undoes it. The lab did not run it, because applying it on the build machine would have cut that machine's own network along with the lab's; Module 10 runs it on hosts built for the purpose.

Windows has its own quarantine artifact, and a monitoring artifact that keeps it in place, the one lesson 0.8 found attached to the Quarantine label. Its definition describes an event query that reapplies the IPsec policy every ten minutes by default to follow changes in DNS and connectivity, and undoes the quarantine when the query is stopped: removing the label is what releases the host.

Quarantine has costs of its own. A quarantined web server serves nobody, so the decision involves whoever owns the service, and a quarantine applied without telling them tends to be undone by someone trying to restore the service.

The allow list also matters: a host that can still resolve names can still leak data through DNS to a determined intruder, which is a reason to treat quarantine as a pause for investigation rather than a cure.

Checking a quarantine follows the same rule as checking a removal. The artifact's own test shows one outside address is unreachable; a collection run on the host immediately afterward shows the server can still reach it, which is the other half of what quarantine promises. A quarantine that also cut the server off would leave the host contained and uninvestigable, and only a collection that succeeds proves otherwise.

7

The Record

What the server writes about the responders

The server keeps an audit log of what users do, as a server event stream called Server.Audit.Logs, stored under the server client ID like the escalation in lesson 0.8. Filtered to the response:

VQL5 rows
SELECT timestamp(epoch=_ts) AS Time, operation, principal, details.hunt_id AS HuntId
FROM monitoring(client_id='server', artifact='Server.Audit.Logs')
WHERE operation =~ 'Hunt|Label|SetArtifact'
TimeoperationprincipalHuntId
2026-12-02T19:04:51.709ZSetClientLabelanalyst
2026-12-02T19:04:51.709ZSetClientLabelanalyst
2026-12-02T19:04:52.023ZCreateHuntanalystH.DC86NL61F7UR8
2026-12-02T19:05:03.378ZCreateHuntanalystH.DC86NNVU84A7I
2026-12-02T19:05:18.085ZCreateHuntanalystH.DC86NRIC8SUCK

The server's own record: two labels and three hunts, each with the identity that made it.

Two labels and three hunts, each with a time and the identity that did it, here the lab's analyst API client. The hunt IDs tie each entry to the hunt's definition, its scope and its results.

That is enough to reconstruct the response later from the server alone, and it is the record an incident report cites for what was done and by whom. It is only as good as the identities behind it: a shared administrator account writes an audit log that says an administrator did everything.

For the incident report, the audit log and the hunts together give a complete account of the response without relying on anyone's memory: the label times say when the scope was set, the hunt IDs lead to the exact artifact and parameters used, the remediation results list every file and process with its outcome, the preserved hashes identify what was removed, and the verification hunt's counts show the check could have failed and did not.

Citing those, rather than describing the response in prose, is what lets a reviewer check it.

The artifact's own description lists what counts as significant: starting a new collection, creating a new hunt, updating an artifact, among other user actions. Because it is a server event stream, it can be forwarded like any other, to a SIEM or to long-term storage outside the Velociraptor server, which matters if the server itself is ever in question.

Lesson 0.2's point that a server bug is a fleet bug applies to its audit log too: a record kept only on the system it describes is weakest exactly when it is needed.

8

Asking an Assistant

Asking for the order, not just the action

Asked how to remove malware with Velociraptor, an assistant offered rm -rf through execve() in a hunt across all Linux clients: no preservation, no dry run, no scope and no verification, and the broadest possible reach.

A remediation that keeps its evidenceCaptured: Claude Opus 5.5, 2 December 2026
  1. You

    How do I remove malware from Linux hosts with Velociraptor?

  2. Assistant

    Create a custom artifact that uses execve() to run commands on the client, for example rm -rf on the malicious files and kill on the process, and run it as a hunt across your Linux clients. Make sure your user has the EXECVE permission.

  3. You

    Two Linux hosts, web-02 and db-01, carry /etc/cron.d/sys-update running /tmp/.cache/update.sh, and db-01 runs /tmp/.cache/kworkerd. Using Velociraptor 0.77.4, write a remediation artifact that keeps a copy of every file with its hash before deleting it, kills the process, removes the cron file and the files, and has a dry-run switch; how to run it only on those two hosts; and how to prove afterward that nothing remains anywhere in the fleet.

  4. Assistant

    Define a CLIENT artifact with a DryRun parameter. Materialize the file list first with LET, upload() each file so the server keeps it with its SHA256, then for each process whose Exe starts with /tmp/.cache/ run kill through execve() unless DryRun is set, and remove each file with rm() unless DryRun is set; return one row per action with its result. Label web-02 and db-01, run the hunt with include_labels and DryRun on, read the rows, then run it again with DryRun off. Afterward hunt the whole fleet for Linux.Sys.Crontab and Linux.Sys.Pslist and filter for /tmp/, and check that each hunt returned rows at all before trusting an empty match.

  5. Velociraptor
    VQL7 rows
    LET h <= hunt(artifacts='Custom.Linux.Remediation.SysUpdate',
    

    spec=dict(Custom.Linux.Remediation.SysUpdate=dict(DryRun='Y')), include_labels='compromised', description='Remediate sys-update: dry run', expires=now() + 86400) SELECT h.HuntId AS HuntId FROM scope()

    SELECT Fqdn AS Host, Step, Action, Target, Result FROM hunt_results(hunt_id='H.DC86NL61F7UR8', artifact='Custom.Linux.Remediation.SysUpdate') ORDER BY Host

    HostStepActionTargetResult
    db-011preserve/etc/cron.d/sys-updated7a4a3624715d530...
    db-011preserve/tmp/.cache/kworkerd8ac215ec4c1ce4a9...
    db-012killpid 7 /tmp/.cache/kworkerdplanned
    db-013remove/etc/cron.d/sys-updateplanned
    db-013remove/tmp/.cache/kworkerdplanned
    web-021preserve/etc/cron.d/sys-updated7a4a3624715d530...
    web-023remove/etc/cron.d/sys-updateplanned

    The dry run on the two labeled hosts: everything preserved, every kill and removal listed as planned, nothing changed.

The second prompt named the hosts, put preservation first, asked for a dry-run switch and asked for proof across the fleet. The reply built the same shape this lesson ran, including the step most often left out, checking that the verification could return rows before trusting it.

PromptThe prompt that sets the order
Two Linux hosts, web-02 and db-01, carry /etc/cron.d/sys-update running /tmp/.cache/update.sh, and db-01 runs /tmp/.cache/kworkerd. Using Velociraptor 0.77.4, write a remediation artifact that keeps a copy of every file with its hash before deleting it, kills the process, removes the cron file and the files, and has a dry-run switch; how to run it only on those two hosts; and how to prove afterward that nothing remains anywhere in the fleet.
  1. web-02 and db-01names the scope, so the answer aims at two hosts, not the fleet
  2. keeps a copy of every file with its hash before deleting itputs preservation first
  3. has a dry-run switchasks for a rehearsal before the change
  4. prove afterward that nothing remains anywhere in the fleetasks for verification wider than the action

The saving was the artifact's shape and the sequence of hunts. The decision about scope, and the judgment that the response is not finished, stayed with the analyst. An assistant given only the first prompt would have produced a command that deleted evidence on every Linux client; the difference between the two answers was entirely in what the prompt said about the situation.

What "remediated" rests on
  1. HoldsEvery file removed was preserved first3 preserve rows with SHA256, before the removals
  2. HoldsEach action succeededkill exit 0; rm() true for all 3 files
  3. HoldsNothing remains in the fleetverify hunt: 5 of 5 hosts, no /tmp matches in 40 cron rows
  4. FailsThe intruder cannot come backdeploy's password still works; nothing here changed the account
DecisionReport the persistence removed and verified, and the account as the open item before closing.

The failing line is the incident's last open item. Everything removed came in through an account whose password was guessed, and nothing in this response changed it.

Do

Practice

Is it safe to close?
your own Velociraptor

The scenario holds the remediation results, the evidence kept, the verification hunt and the audit log for the five-host fleet. Decide what the response achieved and what still stops the incident from closing.

Then rehearse it yourself, on a machine you can afford to change. Create a file in /tmp/.cache, start a copied binary from it, and write a remediation artifact with a DryRun parameter that uploads, kills and removes. Run it as a collection with DryRun on, read the rows, run it with DryRun off, then check that a fresh process list returns rows and that none of them run from /tmp.

Acting with Velociraptor is collecting with consequences: preserve first, aim with labels, rehearse with a dry run, act, verify the whole fleet with a check shown able to return rows, and let the audit log record it.

This module has covered remote live response from its limits to its consequences: what a connected client can reach and what it cannot, how the server and clients trust each other, querying, reading disks and images, volatility, agentless collection, hunting, monitoring, timelines and response.

Each of the ten modules that follow takes one of those and builds it properly, starting with Module 1 and a server deployed the way a production one should be.

Resources

Velociraptor changes quickly; where its documentation and this lesson disagree, the documentation is newer.

Stuck? Spotted an error?