290 Commits
Author SHA1 Message Date
Abdelghafour BouhdydandMike Cohen fa9a5b4cd1 Feature/carve evtx, (#5063)
Problem: When Windows event logs are cleared or deleted,
Windows.EventLogs.Cleared can show that a log was cleared, but the
events themselves are lost because parse_evtx() only reads intact log
files. The old data usually stays on disk, in unallocated space, the
pagefile or memory, until it is overwritten.

Solution: 
This PR adds a new carve_evtx() VQL plugin. It scans any file or device
for EVTX chunk signatures at any offset and parses each 64KB chunk on
its own.
- Rows have the same structure as parse_evtx(), plus ChunkOffset,
ChunkHeaderValid, ChunkDataValid, ChunkTruncated and ChunkCompressed.
- NTFS-compressed chunks (the Windows default for event logs) are
decompressed.
- Damaged chunks are flagged, not dropped.
- With output=, the recovered events are also written to a new .evtx
file that Event Viewer can open.

Example:
SELECT * FROM carve_evtx(filename='''\\.\C:''', accessor="raw_file")
WHERE System.Channel = "Application"

Known limitation
Old records in chunk slack are not recovered yet. This could be a
follow-up.

---------

Co-authored-by: Mike Cohen <[email protected]>
2026-10-07 21:34:46 +10:00
Mike Cohen dbf3611ded Refactor and clean up code (#5037)
1. Remove NewArtifactPathManager to Require to artifact mode to be
specified by the called. This avoids possible confusion of the artifact
types.
2. SSH Accessor: Added a hostkey parameter and log the host key when not
provided.
3. Refactor FlowStorageManager to split deletion function into a
DeletionManager.
4. AppendJsonlItem now rejects invalid JSONL lines when it is unable to
add the specified item.
2026-09-25 21:28:17 +10:00
Mike Cohen 72ea73f616 Refactor of queues (#5035)
The queue manager is used to pass messages between parts of
Velociraptor. Previously, the queue name corresponded with the artifact
name that defines the queue. However, this allowed messages intended to
client monitoring to be passed to server monitoring artifacts under some
conditions.

This refactor changes the queue name to also contain the artifact type.
This change better keeps track of messages and which queues they are
sent to.

Additionally, the journal manager now records two records in each
monitoring row:
1. The _Source records who authorized the row.
2. The _From records who actually sent the row in the first place.

ACL decisions are now made based on the _Source only making it more
consistent to determine if a row can be sent on a particular queue.
2026-09-24 14:54:41 +10:00
Mike Cohenanddependabot[bot] 08acb33ade Added an ARM64 Windows target (#5017)
This PR changes the build toolchains to use the hermetic mingw clang
toolchains so we do not depend on the OS installed ones.

The build will now automatically download and unpack the toolchain
inside the build directory and use it for reproducible builds.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-16 21:34:18 +10:00
c37e355e65 Add support for custom executing user and group for .deb and .rpm (#4991)
Adds commandline params to create .rpm or .deb setup scripts with custom user/group

``` bash
./velociraptor-v0.77.2-linux-amd64 \
  --config server.config.yaml debian server \
  --binary velociraptor-v0.77.2-linux-amd64 \
  "--server_user" myExistingUser "--server_group" myExistingGroup
```
* defaults unchanged: still executing as velociraptor:velociraptor when
not supplying --server_user
* supplying only --server_user will set the group to be the same as the
user (user:user)
* supplying only --server_group will error out
* supplying both --server_user and --server_group allows to set
different values

# Why
Most companies define their user-naming-scheme and might even have
service users automatically set up. A default
`velociraptor:velociraptor` breaks this contract, and will have to be
adapted after installing the .deb or .rpm

---------

Co-authored-by: Mike Cohen <[email protected]>
Co-authored-by: evilele <[email protected]>
2026-09-05 12:14:52 +10:00
Mike Cohenanddependabot[bot] c3da4bcb3e Refactor of inventory service and add download_transforms option. (#4999)
The download_transforms option specified a transform the server can take
after downloading the file and before storing in the inventory.

Currently we only support "gunzip" the gzip compressed data will be
unzipped before being stored in the inventory.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-04 20:06:51 +10:00
Mike Cohen bf7a99185d Bugfix: Enforce required permissions on client monitoring (#4967)
Client monitoring artifacts with required permissions were not
enforced. This PR ensures the user that calls
SetClientMonitoringState() has all the required permissions for each
artifact in the client monitoring set.

Also:
* Prevent template escapes when restoring notebooks from backups.
* Ensure a TTL is set for any use of ttlcache - due to a bug in
  ttlcache not setting a TTL causes expiry of most recent rather than
  least recently use.
2026-08-10 10:31:32 +10:00
Mike Cohen ed6f5e7c3e Bugfix: Determine impersonate permission for query() based on target … (#4947)
…org.

Also: Ignore empty path components with filestore ACL prefix checks.
2026-07-31 18:41:11 +10:00
Mike Cohenanddependabot[bot] 349833c508 Bugfix: Syslog watcher excessing CPU usage (#4937)
When the context is cancelled, the syslog watcher when given a query
would spin on it instead of exiting the loop. This PR fixes this
condition detecting when the context is cancelled and breaking out of
the loop.

Also fixes:
- Crashes for malformed NTFS images
- Crashes for binary parser with negative index.
- Artifacts with quick_links did not have default notebook built.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-25 02:35:31 +10:00
Mike Cohenanddependabot[bot] d7de958e84 Bugfix: Do not override hunt requests when only summary is available (#4928)
Version 0.77.1 separates the hunt request from the main hunt object.
This helps avoid expensive operations when the hunt parameters are very
large.

For many operations we do not need to load the entire request - for
example start or stop a hunt. In these case the ModifyHuntObject()
method takes an option that specifies the hunt request should not be
loaded fully, instead only a summary is provided.

The bug was that this summary was synced back to the disk overriding the
full request.

Fixes: #4912

Additionally fix various bugs:
* Use html template for logoff screen
* Escape CVS values that look like formulas to prevent excel from
executing them.
* Enforce DELETE_RESULTS permissions for hunt delete
* Fix crash in tool upload handler
* Fix Dead disk artifact when building the remapping file from a
directory.
* Fixed bug in rsyslog() VQL function.
* Fixed divide by zero crash when downloading certain sparse files from
the GUI

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-19 01:42:05 +10:00
Mike Cohenanddependabot[bot] 915acd5c2d Added tests for shell session (#4855)
Some bug fixes for the GUI

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-01 13:36:44 +10:00
predictiple 64e65d9a91 Spelling fixes (#4849)
that Vale didn't catch these last time.
2026-05-27 15:55:50 +10:00
Mike Cohenanddependabot[bot] dfbe87019a Store flow requests in a separate data store file. (#4845)
This allows the request to be very large without affecting performance
of flow processing. A large request might include e.g. large Yara rule
sets of complex VQL queries.

Previously these very large collection requests would break the GUI due
to large RPC connections resulting in RPC errors.

This is especially bad in master/minion setup where the minion much
fetch flow objects from the master while processing client data. Making
the request live outside the flow object should make this processing
much faster.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-24 00:23:53 +10:00
Mike Cohen c97e4b5511 Added gracefull timeout for shell sessions. (#4842)
Also reworked GUI for usability
2026-05-22 12:14:22 +10:00
Mike Cohen 2d4cb24ae7 Rework Shell GUI to utilize sessions. (#4839)
Implemented persistent Bash, Powershell, CMD and VQL shells

Added full screen and transcript download. The transcript allows the
user to download a textual transcript of the
interactive session.
2026-05-21 16:17:08 +10:00
Mike Cohenanddependabot[bot] 5708c27dd6 Refactor code to satisfy static checks (#4826)
Also sync upstream vfilter fixes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-15 13:43:08 +10:00
predictiple 448f02fc22 Spellcheck repo with Vale and fix (#4819) 2026-05-07 19:16:12 +10:00
Mike Cohenanddependabot[bot] 4bfbb894ac Place limits on memory allocations to avoid out of memory errors. (#4806)
Also Update evtx parser to support preferred message language

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-28 02:01:51 +10:00
Mike Cohenanddependabot[bot] 9767c17876 Remove hunt dispatcher housekeeping thread. (#4802)
This can now be used as needed using a VQL query but it should normally
not be needed.

The housekeeping thread generates a lot of IO and takes a long time. It
is only used to tally up the hunt stats in the overview page so it is
not super important. Normally the hunt stats should be accurate but if
the server is hard exited or crashes before it is able to flush data out
to disk, the totals may be out.

Also change the code to ensure that totals are always incremental - this
avoids an issue where the totals can be reset during the hunt recuitment
stage (when a lot of clients are added quickly). This was observed in
#4799 where a race condition was observed - by the time the flows were
calculated from disk, the totals were much higher so then when the stats
were updated they appeared to go backwards.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-25 22:27:55 +10:00
Mike Cohen 3f39051008 Bugfix: Build a default timeline message from the event. (#4758) 2026-03-26 01:54:35 +10:00
Mike Cohen 1e85ae1503 Flush readers to allow USN watcher to get fresh data. (#4757) 2026-03-25 21:49:17 +10:00
Mike Cohen f7d1c2b256 Bugfix: Do not allow directory traversal in Zip files. (#4755)
This can confuse the unzip() plugin. However the unzip() plugin is
usually only used on trusted input.
2026-03-25 03:53:09 +10:00
Mike Cohen 45d4553716 Added filters on users list in the user management screen. (#4747)
Also various bugfixes:
- Support arbitrary format of org id (Fixes #4720)
- Fixed bug in uploader in the main dashboard
- Filtering column in timeline does not produce filter indicators like
in normal tables (Fixes #4743)
2026-03-20 18:10:39 +10:00
Mike Cohen 35dfefc68a Support free form kwargs in a more natural way (#4724)
Fixes: #4713
2026-03-12 19:07:23 +10:00
Mike Cohen 964ba2567a Added dir_permissions parameter to copy() (#4716) 2026-03-10 20:35:54 +10:00
Mike Cohen 0d48ee9974 Bugfix: increase max size of embedded config to 100Mb (#4690)
Also rework error handling for better error reporting when the file is
corrupt.
2026-02-27 01:18:30 +10:00
Mike Cohen f61cd39151 Refactored rsyslog plugin (#4658)
We now use the same code for forwarding logs to syslog:
1. Syslog now uses octet counting transport
2. Syslog log forwarding now works on Windows as well.
2026-02-12 14:50:47 +10:00
Mike Cohen 19ab65a5b9 Refactor process tracker. (#4647)
The new process tracker is more efficient:

1. Process Children are stored in the tracked process entry avoiding the
need to sweep across the entire tracker when constructing the process
tree

2. The tracker now uses links to maintain correspondence between process
ID (which is heavily reused) and internal unique ID (based on the start
time). This avoids the need to sweep through the tracker when we detect
a PID was reused.

3. The tracker can use an on disk sqlite based LRU which is a bit slower
but reduces memory use and allows tracking much larger number of
processes.
2026-02-04 16:53:06 +10:00
Mike Cohen ff653db641 Change org selector to searchable selector. (#4613)
Fixes: #4612
2026-01-07 15:50:49 +10:00
Mike Cohen 0d22ed3dd6 Improve sanitization of paths (#4593) 2025-12-23 10:35:09 +10:00
Mike Cohen 29442ef052 Log audit information on the client. (#4585)
On windows audit events are forwarded to the windows event log.
2025-12-11 16:12:35 +10:00
Mike Cohen 7d8a325d62 Added an alternate CLI calling format (#4567)
Many CLI commands are actually just wrappers around artifact
collections. As we move towards more powerful artifacts it is possible
to convert more and more functionality to simple artifacts.

However currently the `artifact collect` command is a bit clumsy and
more difficult to use.

This PR presents an alternate CLI parser which converts into the
standard `artifact collect` command but it is simpler to use.

The genreral format is:
```
velociraptor[<common flags> ...] -r Windows.Triage.Targets [<artifact params> ...]
```

Where the common flags are standard args to velociraptor (e.g. output,
debug etc).

When the new parser sees the `-r` flag, it interprets the next token as
the name of an artifact to collect. All flags after that are interpreted
as parameter values.

For example:
```
velociraptor.exe -v --config server.config.yaml
--output test.zip -r Windows.Triage.Targets --HighLevelTargets _Live
```

To view the help you may add -h or --help after the -r flag to print a
details help message about the artifact.

```
velociraptor.exe -v --config server.config.yaml
--output test.zip -r Windows.Triage.Targets -h
```

The help output lists all artifact parameters and their defaults and
types.

Note that for custom artifacts and many server artifacts, the config
parameter is required so we can load the artifacts before collecting
them. These flags must be provided before the `-r` flag for common
flags.

Additionally for `multichoice` parameters which normally expect a json
encoded list, we now also support command separated values as these are
easier to type on the Windows shell.
2025-11-29 16:04:12 +10:00
Mike Cohen 8dff80aba6 Bugfix: Update build for windows (#4561) 2025-11-24 12:31:40 +10:00
Mike Cohen f2fbbf9425 Bugfix: Added denied_file_accessor_prefix config option (#4548)
With allowed_file_accessor_prefix and denied_file_accessor_prefix
together it is possible to mask off different areas of the filesystem
with sufficient flexibility.

Previously the interactions were not correct causing more files to be
rejected than needed.
2025-11-13 01:01:18 +10:00
Mike Cohen d24a002a84 Added a backup provider for notebooks (#4536)
This allows automatic backup of global notebooks.

Only the cell queries are backed up not the output. Notebooks will need
to be recalculated when restored.
2025-11-10 15:49:09 +10:00
Mike Cohen 5f406c5a84 Bugfix: Deduplicate uploads by case insensitive name on windows. (#4533)
On Windows the filesystems are case insensitive so the upload() plugin
may encounter various versions of the same filename. This PR takes it
into account and deduplicates based on the canonical lower cased name.
2025-11-08 20:41:08 +10:00
Mike Cohen 5ef9e85391 Secrets can now be inherited from the root org (#4524)
Also some minor bug fixes:
- ACE editor: disable web workers to prevent invalid http request
(#4006)

- Fixed some bugs in artifacts: Windows.Forensics.Prefetch and
Windows.System.TaskScheduler

- Offline collector now uses Hostname in default name rather than FQDN.
2025-11-04 16:01:49 +10:00
Mike Cohen 12a335f3e5 More work on nanny. (#4522)
Added profile tracker for nanny and ring buffers.

Added fault injector to emulate stuck http connections - these seem to
be present sometimes after suspend.

Nanny has a mechanism now to warn clients they are out of compliance and
allow them an opportunity to rectify the issue. This is now used in the
send and receive HTTP connections to abort the current connection and
restart it.
2025-11-01 01:58:11 +10:00
Mike Cohen ceabe8167b Added a new overlay accessor (#4512)
Also improved zip collector file performance by adding buffering.
2025-10-27 15:36:04 +10:00
Mike Cohenanddependabot[bot] e84f6d262f Added a json schema validator to parse_json() and parse_yaml() (#4510)
This allows us to validate offline spec files and reject invalid files.

Also added an upload to the Server.Utils.CreateCollector that contains
the spec file for ease of use. Users now simply can download that spec
file and use it on the CLI builder.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-24 02:51:03 +10:00
Mike Cohen e1b271abf6 Bigfix: Windows.Detection.Yara.PhysicalMemory was broken (#4499)
WinPmem ranged reader was returning an error incorrectly.
2025-10-15 01:27:15 +10:00
Mike Cohenandsnyk-bot 9ed9183689 Added Windows.System.Threads artifact (#4496)
The threads() plugin now attempts to show the name of the start function
of the thread.

---------

Co-authored-by: snyk-bot <[email protected]>
2025-10-14 11:00:55 +10:00
Mike Cohen 92250494da Bugfix: When using https clients would retry too quickly on 503 (#4461)
When the disk fills up, the server switches to read only data store and
returns a 503 error to the clients. This bug caused the clients to retry
too quickly causing a lot of un-necessary network traffic.
2025-09-18 11:51:00 +10:00
Mike Cohenandsnyk-bot 3a8a2417b4 Improved VQL verifier. (#4451)
1. When verifying artifacts, reported error line number now accounts
   for the yaml structure.
2. Verify new case: Defining functions in LET and calling them with
   incorrect parameters.
3. Identify calling undefined plugins or functions (previously this
   was not a warning because it could have been defined by LET
   definitions).
4. Resolving import and export sections when verifying artifacts now
   warn about misuse of imported functions which may have changed
   their definitions.
5. Uploads are now reported as Dicts instead of an upload object.
6. Dict sorting now implemented.
7. Lots of artifact bugs found by previous static analysis
8. Updated to go 1.24.0

---------

Co-authored-by: snyk-bot <[email protected]>
2025-09-16 14:11:14 +10:00
Mike Cohen ea250134b1 Refactor deletion code to improve flow deletion (#4401)
Custom deletion code for result sets, bulk files and better testing
ensure we do not leave files behind when deleting flows.

Also pass standard http client (with proxy support) to azure_upload()
and s3_upload()
2025-08-15 18:15:14 +10:00
Mike Cohen bca906c749 Added secret support for execve. (#4389)
This allows execve to be used with a secret specifying the prefix
command line.

Combined with security.vql_must_use_secrets this mechanism creates a way
to lock down execve() on the server to only be able to run certain
approved programs controlled by a secret.
2025-08-07 22:47:15 +10:00
Mike Cohen 25ed2ddf26 Refactored accessors and improved permissions. (#4386)
The PR refactors the accessor API to add a descriptor for each accessor,
like vql plugins and functions. This allows a more structured approach
to documentation.

Additionally, the descriptor can specify the type of permissions
required to use the accessor, just like plugins. Some accessrs are
configured through scope variables, and this now adds a self documenting
args descriptor just like plugins.

This PR also introduces a new permission NETWORK. This permission
declares that the user is able to access the network and it is enforced
by various plugins/functions and accessors that access the network. This
additional permission provide finer grained control over user activity.
2025-08-07 00:17:17 +10:00
Mike Cohen 32a3e61419 Prevent access to parts of the filesystem (#4371)
On the server, VQL can access the entire filesystem, either with the
"file" accessor or the "fs" accessor. This allows a VQL query in the
notebook to read any internal files in the file store as well as other
sensitive files on the server

This PR restricts the file and fs accessors into a set of allowable,
preconfigured directories. Additionally VQL plugins that are allowed to
write to the filesystem also honor this restriction.

This PR also introduces a Data Encryption Key for secrets. This ensures
that even if the secret files are exposed the secrets themselves can not
be unlocked without access to the DEK.

The DEK can be specified in the config file or in an environment
variable.
2025-07-30 12:56:23 +10:00
Mike Cohen cdb2d03b85 Resumable uploads (#4364)
This PR introduces resumable uploads. These uploads are opt-in set by
setting a VQL variable.

When the variable is set, uploads will complete immediately:

- Schedule an upload transaction and inform the server
- VQL queries return an upload id immediately and the VQL query
continues (ie uploads are asynchronous).
- Begin uploading transactions on the client 

If the client is interrupted or crashes, the transactions can be resumed
on the server.
2025-07-27 17:16:22 +10:00
Mike Cohen e16721ee09 Filestore can now store collections in compressed form. (#4361)
One of the common issues with Velociraptor is managing disk space. Up to
now the server would store all files in uncompressed clear text form.

While this is handy because all data is just a simple file, it is
wasteful of disk space and often causes disk issues.

This PR allows the data to be stored in a compressed form on the disk:

1. Clients are requested to compress they payload (either VQLResponse
which is the json output from a VQL query, or FileBuffer which is bulk
file data).

2. The server simply writes the already compressed data in chunks on the
disk.

This allows the server to offload compression to the clients, and
actually allows the server to go much faster due to reduced IO, by
simply writing already compressed chunks.

When reading the data back out, the server is able to transparently
decompress the data using the "fs" accessor. This allows compression to
be handled transparently.

Some metrics:
- A Windows.NTFS.MFT JSON output is 960Mb uncompressed and 80mb
compressed. JSON is highly compressible and this helps a lot.
2025-07-22 22:33:32 +10:00