Velociraptor can ask the same question of every enrolled endpoint at once, but only if the hunter can write the question in VQL and pick the right artefact without overloading the fleet. This cheat sheet covers VQL syntax, the plugins and functions used most in hunts, the built-in artefacts worth knowing by name, the YAML structure of a custom artefact, and the resource controls that keep hunts safe at scale. Syntax and defaults were checked against the Velociraptor documentation repository on 26 November 2026 (latest release tag v0.77.4); artefact names and parameters change between releases, so check them in your own server's artefact viewer. It is for threat hunters and DFIR analysts who already have a working server. For architecture, deployment and securing the server, see the Velociraptor Guide.
This is an independent guide from NHI Mgmt Group, based on Velociraptor's public documentation as of November 2026. It is not sponsored or reviewed by Velociraptor. Product features change, so confirm settings against Velociraptor's current documentation.
Key takeaways
- VQL looks like SQL but has no JOIN. Rows come from plugins after FROM, every argument is passed by name, and foreach() takes the place of joins.
- LET is lazy unless you use <=. A plain LET stores a query that runs each time it is referenced; LET with <= runs it once and keeps the result.
- Start from built-in artefacts. Windows.System.Pslist, Windows.Network.Netstat, Windows.Search.FileFinder and Windows.EventLogs.EvtxHunter answer most first-round hunt questions with parameters, not new code.
- Hunts are paused at creation and expire, they do not finish. By default a hunt expires after one week and keeps scheduling newly seen matching clients until then.
- Resource limits protect endpoints, not the server. Timeout, CPU, IOPS, row and upload limits are enforced by the client on itself; they are a safety net against runaway collections, not a security boundary.
How to use this template
- Test every query in a notebook first. The documentation recommends notebooks as the place to write and debug VQL; type
?for context-sensitive completions of plugins and arguments. - Run on one client, then a label, then the fleet. Use a label group for a pilot hunt before targeting all clients.
- Fill in the hunt record below for every hunt, so results can be interpreted and repeated.
- Save working queries as custom artefacts rather than pasting VQL into each hunt.
- Re-check artefact names and parameters after each server upgrade, in the artefact viewer of your own server.
| Record | Value |
|---|---|
| Hunt hypothesis | [ ] |
| Artefact name and parameters | [ ] |
| Server version | [ ] |
| Target (label, OS, all clients) | [ ] |
| Resource limits set (timeout, CPU, max rows, max upload) | [ ] |
| Expiry | [default one week] |
| Approved by and date | [ ] |
VQL basics
| Construct | Syntax | What to know |
|---|---|---|
| Query | SELECT Name, Pid FROM pslist() WHERE Name =~ "powershell" | SELECT columns FROM plugin WHERE filter. No semicolon at the end |
| Named arguments | glob(globs="C:/Users/*/Downloads/*.exe") | All plugin and function arguments are keyword arguments |
| Regex match | WHERE Exe =~ "(?i)temp" | =~ is a regular expression match |
| Lazy variable | LET procs = SELECT * FROM pslist() | Stored query, evaluated each time it is referenced |
| Materialised variable | LET procs <= SELECT * FROM pslist() | Evaluated once, result held in memory as an array |
| Local function | LET IsWin(x) = ... | A LET with parameters acts as a reusable function |
| Join replacement | SELECT * FROM foreach(row=procs, query={ ... }) | Runs the inner query once per row; workers runs them in parallel |
| Subquery | { SELECT ... FROM ... } | Braces wrap a query used as an argument or column |
| Dict and unpacking | dict(root="c:/windows", globs="*"), then glob(`**`=args) | Pass arguments as a dict; other arguments are ignored when ** is used |
| No-op row source | SELECT ... FROM scope() | Returns the current scope as one row; use when you need no plugin |
| Identifiers with symbols | `**` | Backticks quote names with non-alphanumeric characters |
| Comments | -- comment | Line comment |
Variable names may contain letters, digits, underscores and dashes, must not start with a digit or dash, and are case-sensitive. Columns produced by a plugin mask variables of the same name from outer scopes, a common cause of confusing results.
Common plugins and functions
| Need | Plugin or function | Key arguments |
|---|---|---|
| Host details | info() | None; returns OS, hostname and platform fields |
| Running processes | pslist() | pid to list one process |
| Network sockets | netstat() | Returns sockets with owning process ID |
| Find files | glob() | globs (required), root, accessor, nosymlink |
| File metadata | stat() | filename, accessor |
| Hash a file | hash() | path, hashselect (MD5, SHA1, SHA256), max_size (default 100 MB) |
| Signature check | authenticode() | filename |
| Registry | read_reg_key() | globs, root, accessor |
| WMI | wmi() | query, namespace (default ROOT/CIMV2) |
| Event logs | parse_evtx() | filename, workers |
| Pattern scan | yara() | rules, files, accessor (e.g. ntfs, file), context |
| Collect a file | upload() | file (required), name, accessor |
| Call another artefact | Artifact.Name.Here(...) | Artefact parameters as named arguments |
| Read hunt results on the server | hunt_results(), source() | hunt_id, artifact, source |
| Run an external program | execve() | argv (required). Use sparingly: CPU and IO limits do not apply to external programs |
The ntfs accessor (Windows only) parses the NTFS filesystem directly, accepts normal Windows paths, and also lists Volume Shadow Copy devices at the top level, so a glob can reach older copies of a file.
Example hunt queries
- Processes running from user-writable paths:
SELECT Pid, Name, Exe, CommandLine FROM pslist() WHERE Exe =~ "(?i)\\\\(temp|appdata|downloads)\\\\" - Sockets with their process name (pattern used by the built-in Windows.Network.Netstat artefact):
LET processes <= SELECT Name, Pid AS ProcPid FROM pslist()thenSELECT Pid, { SELECT Name FROM processes WHERE Pid = ProcPid } AS Name, Status, Laddr.IP, Laddr.Port, Raddr.IP, Raddr.Port FROM netstat() - Executables in Downloads with hashes:
SELECT OSPath, Size, hash(path=OSPath).SHA256 AS SHA256 FROM glob(globs="C:/Users/*/Downloads/*.exe")
Built-in artefacts for hunts
| Hunt question | Artefact | Useful parameters or notes |
|---|---|---|
| What is this client? | Generic.Client.Info | Collected at enrolment; the server builds its client index from it |
| Which processes match an indicator? | Windows.System.Pslist | ProcessRegex, CommandLineRegex, ExePathRegex, UsernameRegex, UntrustedAuthenticode |
| Same on Linux and macOS | Linux.Sys.Pslist | Alias MacOS.Sys.Pslist |
| Which sockets are open and who owns them? | Windows.Network.Netstat, Windows.Network.NetstatEnriched | The enriched version has KillProcess and DumpProcess options: leave them off for hunting |
| Where is this file or pattern? | Windows.Search.FileFinder | Path glob, YARA content match, hash and optional upload |
| Which hosts hold this YARA match? | Windows.Detection.Yara.Glob, Windows.Detection.Yara.Process | Files by glob, or process memory |
| Is this indicator in any event log? | Windows.EventLogs.EvtxHunter | EvtxGlob and regex IOC parameters |
| Sigma rules over event logs | Windows.Sigma.EventLogs | See the Sigma Rule Syntax Cheat Sheet |
| What ran, and when? | Windows.Forensics.Prefetch, Windows.Registry.AppCompatCache | Prefetch gives run counts and last run times |
| What changed on disk? | Windows.Forensics.Usn, Windows.NTFS.MFT | USN journal and MFT records for file activity |
| What persists? | Windows.System.Services, Windows.System.TaskScheduler, Windows.Sysinternals.Autoruns | Autoruns runs an external tool on the client |
| Who logged on locally? | Windows.Sys.Users | Local profiles only; Windows.Sys.AllUsers adds more |
| Collect triage files | Windows.KapeFiles.Extract and related triage artefacts | Check the triage artefact names in your release |
For the Windows artefacts that show lateral movement, see the Lateral Movement Artefacts Cheat Sheet.
Writing custom artefacts
An artefact is a YAML file. Only name is required; field names are case-sensitive and by convention lowercase. Names may contain letters, digits, underscores and dots, and each dot-separated part must start with a letter. The GUI editor adds a Custom. prefix by default.
1 Sample only, based on the public documentation cited. Assess it independently against the current official documentation, test outside production and back up first.
name: Custom.Windows.Hunt.UserPathProcesses
description: |
Processes whose executable is in a user-writable path.
type: CLIENT
author: [Team name]
reference:
- [internal hunt ticket link]
precondition: SELECT OS FROM info() WHERE OS = 'windows'
parameters:
- name: PathRegex
type: regex
default: "(?i)\\\\(temp|appdata|downloads)\\\\"
resources:
timeout: 600
max_rows: 10000
sources:
- query: |
SELECT Pid, Name, Exe, CommandLine
FROM pslist()
WHERE Exe =~ PathRegex
| Field | Purpose |
|---|---|
| type | CLIENT (default), CLIENT_EVENT, SERVER, SERVER_EVENT, INTERNAL or NOTEBOOK |
| parameters | Become VQL variables with the parameter name; types such as regex and bool shape the GUI form |
| precondition | A VQL SELECT (no LET, not a function). True if it returns rows; the source is skipped otherwise. Lets a Windows-only artefact be hunted safely across all clients |
| sources | Each source is one table of results; several sources give several tables |
| resources | Default limits (timeout, cpu_limit, iops_limit, max_rows, max_upload_bytes and others), which the operator can still change at launch |
Without source-level preconditions, sources run in serial mode and share scope; with them, or for event artefacts, they run in parallel with separate scopes. Store custom artefacts in version control and review them like code, because an artefact runs on every client it is hunted against.
Running hunts at scale
- Hunts start paused: review the artefact, parameters and limits, then start. Stopping a hunt stops new clients being scheduled.
- Expiry, not completion: clients that come online before expiry (default one week) are still scheduled. Set a shorter expiry when the question only matters now.
- Target by label: labels scope a hunt to a group, and clients added to the label later join the hunt. This supports a pilot, then wider rollout.
- Time limits: the default collection timeout is 600 seconds. Offline collections have no timeout by default. A progress timeout (max idle time) can stop a query that emits no rows.
- Data limits:
max_rowsandmax_upload_bytescancel the whole collection when reached. Always set an upload limit on hunts that upload files. - CPU and IO:
cpu_limitpauses the query when average CPU exceeds the limit andiops_limitthrottles IO, which suits large YARA scans. The documentation advises against a global CPU limit. - Precedence: built-in defaults, then the artefact's
resources, then per-artefact overrides, then the values set at launch, which win. When several artefacts are collected together, the maximum of each limit applies. - Results: analyse hunt results in a notebook with
hunt_results()orsource()rather than exporting raw rows first.
| Metric | Why it matters |
|---|---|
| Clients scheduled vs completed vs errored | Coverage of the hunt question |
| Collections hitting timeout or row limits | Results may be incomplete on those hosts |
| Median and maximum collection time | Endpoint impact and whether limits need tuning |
| Uploaded bytes per hunt | Server storage and transfer cost |
Common mistakes
- Launching an untested query fleet-wide: a broad glob such as
C:/**with hashing on every client can slow users and fill the server. Pilot on a label first. - Using = instead of <= for a lookup table: a lazy LET inside foreach() re-runs the query for every row.
- Treating resource limits as security: they are enforced by the client and are not validated server-side.
- Leaving response options on in hunts: artefacts such as Windows.Network.NetstatEnriched can kill or dump processes. Keep those parameters off unless response is approved.
- Forgetting the hunt keeps running: laptops that reconnect days later still run it. Shorten expiry or stop the hunt when done.
- Granting broad artefact rights: anyone who can launch artefacts with execve() or upload can act on every endpoint. Restrict who can create and run custom artefacts; the server credentials are high-value non-human identities, as covered in the Velociraptor Guide.
Implementation guidance
- Build a hunt library: keep tested custom artefacts in a repository with an owner and review date.
- Set default resources in each artefact so safe limits apply even when the operator forgets.
- Use a pilot label of representative hosts (servers, laptops, VDI) for every new artefact.
- Record each hunt with the template above and link it to the hypothesis in your backlog. See the Threat Hunting Guide.
- Review after upgrades: re-run the pilot for artefacts that depend on built-in artefact columns.
Velociraptor hunting supports NIST CSF 2.0 DE.AE (adverse event analysis) and RS.AN (incident analysis), and CIS Controls v8.1 Control 17 for incident response.
Practitioner checklist
- Test every query in a notebook on one client first.
- Use <= for lookup tables used inside foreach().
- Prefer built-in artefacts with parameters over ad hoc VQL.
- Add a precondition to every OS-specific custom artefact.
- Set timeout, max rows and max upload bytes on every hunt.
- Pilot on a label before targeting all clients.
- Set an expiry that matches the question.
- Restrict who can create artefacts and launch hunts.
Standards and references
- Velociraptor: VQL Fundamentals
- Velociraptor: VQL Reference
- Velociraptor: Basic Artifact Fields
- Velociraptor: Artifact Preconditions
- Velociraptor: Limiting Resource Usage
- Velociraptor: Hunting
- Velociraptor: Artifact References
- NIST: Cybersecurity Framework 2.0
Related NHI Mgmt Group resources: Velociraptor Guide · Threat Hunting Guide · Lateral Movement Artefacts Cheat Sheet · Memory Forensics Guide