<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Knowledge Base on Velociraptor - Digging deeper!</title>
    <link>https://www.velociraptor-docs.org/knowledge_base/</link>
    <description>Recent content in Knowledge Base on Velociraptor - Digging deeper!</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <atom:link href="https://www.velociraptor-docs.org/knowledge_base/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to create and use an offline collector as a tool</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool/</link>
      <pubDate>Thu, 26 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool/</guid>
      <description>&lt;h1 id=&#34;how-to-create-and-use-an-offline-collector-as-a-tool&#34;&gt;How to create and use an offline collector as a tool&lt;/h1&gt;&#xA;&lt;p&gt;This article demonstrates how to create a generic offline collector&#xA;and then use it as a Velociraptor &lt;a href=&#34;https://www.velociraptor-docs.org/docs/artifacts/tools/&#34;&gt;tool&lt;/a&gt;&#xA;with conventional &amp;ldquo;online&amp;rdquo; clients.&lt;/p&gt;&#xA;&lt;p&gt;Velociraptor&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/&#34;&gt;offline collectors&lt;/a&gt;&#xA;are a popular deployment mode in which one or more&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/artifacts/&#34;&gt;artifacts&lt;/a&gt;&#xA;are collected from endpoints, the results are packaged inside a zip&#xA;container, and then optionally uploaded to a&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/file_collection/#remote-upload-destinations&#34;&gt;remote storage destination&lt;/a&gt;.&#xA;Typically the remote destination is a cloud storage provider such as&#xA;AWS S3, Azure, or Google Cloud Storage, but it can also be a storage&#xA;service set up on the local network.&lt;/p&gt;&#xA;&lt;p&gt;Offline collectors provide the same capabilities as normal&#xA;network-connected clients, but perform a one-off collection of&#xA;predefined artifacts rather than being tasked to collect artifacts as&#xA;needed by the server.&lt;/p&gt;&#xA;&lt;p&gt;However, you might have Velociraptor clients deployed, and you are&#xA;using these network-connected &amp;ldquo;online&amp;rdquo; clients to run smaller more&#xA;focused queries, but you also occasionally want to do an&#xA;offline-collector-style&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/file_collection/bulk/&#34;&gt;bulk file acquisitions&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;With network-connected clients the results are uploaded to the&#xA;Velociraptor server. File uploads are also done separately rather than&#xA;being bundled into a single zip archive. This might not be desirable&#xA;in certain circumstances, for example:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if the server&amp;rsquo;s storage is not spec&amp;rsquo;d to handle the total size of&#xA;these bulk collections, which are typically large if they consist&#xA;mostly of copied files. In that case, you might want the collections&#xA;uploaded to an alternative destination where storage space is less&#xA;constrained.&lt;/li&gt;&#xA;&lt;li&gt;if you want to post-process these collection zips using other tools,&#xA;then you might already have a process that includes retrieving them&#xA;from the remote storage location. In that case, having the collected&#xA;data in per-endpoint collection zips might also help with the&#xA;retrieval and post-processing.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Offline collectors are created by the &lt;code&gt;Server.Utils.CreateCollector&lt;/code&gt;&#xA;server artifact, which creates a special embeddable configuration with&#xA;the selected client artifacts, tools, and remote upload configuration&#xA;included. Since it&amp;rsquo;s all just VQL you could, in theory, create a&#xA;client artifact that replicates the actions of any offline collector.&#xA;However, in practice the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/artifact_references/pages/server.utils.createcollector/&#34;&gt;&lt;code&gt;Server.Utils.CreateCollector&lt;/code&gt;&lt;/a&gt;&#xA;artifact is significantly complex. Creating a custom version of it&#xA;that can be run by clients would be a daunting task. It&amp;rsquo;s much easier&#xA;to create the offline collector in the normal way, and then run it via&#xA;a client as a tool. This is the approach taken in this article.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34; Do you really need to use an offline collector? &#34;&gt;&lt;p&gt;Offline collectors are sometimes used in situations when they aren&amp;rsquo;t&#xA;really needed, or aren&amp;rsquo;t actually the best option.&lt;/p&gt;&#xA;&lt;p&gt;Before deciding to use an offline collector, you should consider the&#xA;following points.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;You can collect exactly the same artifacts with online clients that&#xA;you can collect with offline collectors.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Offline collectors are not the only available option when you can&amp;rsquo;t&#xA;install clients. If you can&amp;rsquo;t (or don&amp;rsquo;t want to) install clients,&#xA;you still have the option of using clients without installing them,&#xA;as explained in the KB article&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/online_collector/&#34;&gt;How to create an “online collector” binary&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;&#xA;&lt;p&gt;The overall goal here is to have the client download an offline&#xA;collector as a tool from the server and run it. The offline collector&#xA;will in turn create a collection container zip and upload it to a&#xA;remote S3 server.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/overview_.svg&#34; alt=&#34;Process overview&#34;&#xA;         class=&#34;inline&#34;&#xA;         height=&#34;1080&#34;&#xA;         width=&#34;2000&#34;  /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;overview.svg&#34;&gt;&lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Process overview&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;In this case I&amp;rsquo;ll use &lt;a href=&#34;https://garagehq.deuxfleurs.fr/&#34; target=&#34;_blank&#34; &gt;Garage&lt;/a&gt; which&#xA;is an open source S3-compatible server written in Rust, but you could&#xA;use AWS S3, or &lt;a href=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/dropbox_server/&#34;&gt;MinIO&lt;/a&gt;,&#xA;or any other S3-compatible server, or even&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/file_collection/#remote-upload-destinations&#34;&gt;one the other remote destination options&lt;/a&gt;&#xA;that are supported by Velociraptor offline collectors.&lt;/p&gt;&#xA;&lt;p&gt;The high-level steps to achieve this goal are:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Set up an S3-compatible storage server (Garage).&lt;/li&gt;&#xA;&lt;li&gt;Create a generic offline collector and store it in the Velociraptor&#xA;tools repository.&lt;/li&gt;&#xA;&lt;li&gt;Create a client artifact to run the offline collector on a live&#xA;client, using the collector as a tool.&lt;/li&gt;&#xA;&lt;li&gt;Run the collection on a single endpoint or multiple endpoints.&lt;/li&gt;&#xA;&lt;li&gt;Download the collection zip files from the S3 bucket and work with&#xA;the results.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The Velociraptor server and clients are assumed to be set up and&#xA;working correctly. As mentioned previously, the clients don&amp;rsquo;t&#xA;necessarily need to be installed - they could be&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/clients/#agentless-deployment&#34;&gt;running without installation&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-set-up-the-garage-s3-server&#34;&gt;1. Set up the Garage S3 server&lt;/h2&gt;&#xA;&lt;p&gt;To keep things as simple as possible, I&amp;rsquo;ll use a single-node Garage&#xA;server as the remote destination for the offline collector uploads.&#xA;This is similar to using an SFTP or SMB server running on the local&#xA;network.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Generate a basic configuration file as explained in the&#xA;&lt;a href=&#34;https://garagehq.deuxfleurs.fr/documentation/quick-start/&#34; target=&#34;_blank&#34; &gt;Garage Quickstart guide&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Configure the Garage server&amp;rsquo;s storage and access keys, also as per&#xA;their quickstart guide.&lt;/p&gt;&#xA;&lt;p&gt;Here are the commands I used (for brevity, the corresponding output&#xA;is not shown):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;# start the server&#xA;garage -c ./garage.toml server&#xA;&#xA;# check the server status and get the node ID&#xA;garage -c ./garage.toml status&#xA;&#xA;# create a cluster layout&#xA;garage -c ./garage.toml layout assign -z dc1 -c 1G d7d19e6f32edec53&#xA;&#xA;# apply the layout&#xA;garage -c ./garage.toml layout apply --version 1&#xA;&#xA;# create a bucket&#xA;garage -c ./garage.toml bucket create offline-collections&#xA;&#xA;# check that the bucket has been created&#xA;garage -c ./garage.toml bucket list&#xA;&#xA;# view the bucket configuration&#xA;garage -c ./garage.toml bucket info offline-collections&#xA;&#xA;# create an identity for the collector to use&#xA;garage -c ./garage.toml key create offline-collections-key&#xA;&#xA;# assign write-only access to the bucket for this user&#xA;garage -c ./garage.toml bucket allow --write offline-collections --key offline-collections-key&#xA;&#xA;# create a bucket admin user&#xA;garage -c ./garage.toml key create offline-collections-owner&#xA;&#xA;# assign full access to the bucket for this user&#xA;garage -c ./garage.toml bucket allow --write --read --owner offline-collections --key offline-collections-owner&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve created one bucket to receive the collection zips, named&#xA;&lt;code&gt;offline-collections&lt;/code&gt;, and I&amp;rsquo;ve created 2 keys with access to it.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;offline-collections-key&lt;/code&gt;: with only write access, that will be&#xA;used by the clients to upload their collection zips&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;offline-collections-owner&lt;/code&gt;: with full access for browsing and&#xA;downloading the collection zips.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The reason for creating 2 keys is that the write-only key will be&#xA;included in the offline collector for the purpose of uploading the&#xA;collection zips. Because it&amp;rsquo;s possible to extract the key from the&#xA;offline collector I want it to have no greater permissions than are&#xA;necessary. It only needs to be able to upload files to the bucket,&#xA;and cannot list/download/modify/delete other files in the bucket.&lt;/p&gt;&#xA;&lt;p&gt;The final bucket and access configuration can be inspected with the&#xA;command: &lt;code&gt;garage -c ./garage.toml bucket info offline-collections&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-shell&#34;&gt;==== BUCKET INFORMATION ====&#xA;Bucket:          d5f9982666e004de45114bcfc1e9428755c15d12f55a2dac7bc77dc495343e97&#xA;Created:         2026-03-16 16:28:13.689 +02:00&#xA;&#xA;Size:            0 B (0 B)&#xA;Objects:         0&#xA;&#xA;Website access:  false&#xA;&#xA;Global alias:    offline-collections&#xA;&#xA;==== KEYS FOR THIS BUCKET ====&#xA;Permissions  Access key                                             Local aliases&#xA;W           GKaa23dd92075b4dc6fc9fe54f  offline-collections-key&#xA;RWO          GK08c8137adf22d3b08c6ea088  offline-collections-owner&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;I&amp;rsquo;ll access the bucket using the &lt;code&gt;offline-collections-owner&lt;/code&gt;&#xA;credentials on the command line using the &lt;code&gt;mc&lt;/code&gt; (MinIO client)&#xA;utility available from &lt;a href=&#34;https://dl.min.io/client/mc/release/&#34; target=&#34;_blank&#34; &gt;https://dl.min.io/client/mc/release/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-shell&#34;&gt;# download the tool and make it executable&#xA;wget https://dl.min.io/client/mc/release/linux-amd64/mc&#xA;chmod +x ./mc&#xA;&#xA;# Save credentials and connection info for the mc tool&#xA;mc alias set \&#xA;garage \&#xA;http://192.168.56.1:3900 \&#xA;GK08c8137adf22d3b08c6ea088 \&#xA;389adafacb2e3b1c96f9216b9a77c89b74b4d64949d1a0e90f3ca88378f2ca4e \&#xA;--api S3v4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;With the credentials configured, I&amp;rsquo;ll test access by uploading a&#xA;file to the bucket, then listing the bucket&amp;rsquo;s contents, and finally&#xA;clearing everything from the bucket (command output is omitted).&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-shell&#34;&gt;# copy a file to the bucket&#xA;mc cp /proc/cpuinfo garage/offline-collections/cpuinfo.txt&#xA;&#xA;# list bucket contents&#xA;mc ls garage/offline-collections&#xA;&#xA;# remove everything from the bucket&#xA;mc rm --force --recursive garage/offline-collections&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Looks good. The S3 server is ready, so now we can create the&#xA;offline collector.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;2-create-a-generic-collector-and-store-it-in-the-velociraptor-tools-repository&#34;&gt;2. Create a generic collector and store it in the Velociraptor tools repository.&lt;/h2&gt;&#xA;&lt;p&gt;In this step I am going to create a&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/#the-generic-collector&#34;&gt;generic collector&lt;/a&gt;&#xA;and add it to the server&amp;rsquo;s tools inventory.&lt;/p&gt;&#xA;&lt;p&gt;There are several ways that this could be done, but I want to:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;automate the creation of the offline collector via a server&#xA;artifact, and also&lt;/li&gt;&#xA;&lt;li&gt;have it also add the tool to the tools inventory.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;To achieve this I&amp;rsquo;ll create a server artifact that runs&#xA;&lt;code&gt;Server.Utils.CreateCollector&lt;/code&gt; and stores the resulting offline&#xA;collector file as a tool that other client artifacts can use.&lt;/p&gt;&#xA;&lt;p&gt;By having an artifact that performs this step, I&amp;rsquo;ll be able to easily&#xA;create additional collectors with different sets of artifact&#xA;selections as tools. These other collectors could have artifact&#xA;selections for alternative Windows use cases, or they might be&#xA;selections of artifacts chosen to target non-Windows platforms. All I&#xA;need to do is select appropriate artifacts when creating additional&#xA;collectors and give each collector a unique tool name.&lt;/p&gt;&#xA;&lt;p&gt;For my first collector I intend to target Windows and have it run the&#xA;following artifacts:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;Windows.Triage.Targets&lt;/code&gt; (with HighLevelTargets = &lt;code&gt;_Live&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Generic.Forensic.SQLiteHunter&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Generic.Client.Info&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;21-create-a-collector-test-build&#34;&gt;2.1 Create a collector test build&lt;/h3&gt;&#xA;&lt;p&gt;As a test, and to ensure that I get the collector configuration right,&#xA;I&amp;rsquo;ll first create it manually. Then I&amp;rsquo;ll test it on a Windows endpoint&#xA;to ensure that the S3 upload aspect works correctly. To do this I run&#xA;the &amp;ldquo;Build offline collector&amp;rdquo; wizard which is launched from the&#xA;&lt;strong&gt;Server Artifacts&lt;/strong&gt; screen.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Choose the artifacts I want to collect, as listed above.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/collector_artifacts.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Artifact selections&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;collector_artifacts.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Artifact selections&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Configure the artifact parameters.&lt;/p&gt;&#xA;&lt;p&gt;In this case all I did was configure &lt;code&gt;Windows.Triage.Targets&lt;/code&gt; with&#xA;the &lt;code&gt;_Live&lt;/code&gt; High Level Target.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/collector_parameters.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Artifact parameters&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;collector_parameters.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Artifact parameters&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Configure the collector itself.&lt;/p&gt;&#xA;&lt;p&gt;The reason I want to create and use a &lt;em&gt;generic collector&lt;/em&gt; is because&#xA;the client already has the correct Velociraptor binary - the one from&#xA;which the client itself is running. There&amp;rsquo;s no reason to repack and&#xA;distribute another full binary. The generic collector will be&#xA;significantly smaller and provide exactly the same result.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/collector_configure.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Collector configuration&#34;&#xA;         width=&#34;2298&#34; height=&#34;1780&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;collector_configure.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Collector configuration&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Here I used the following settings, which correspond to my specific&#xA;environment, including the configuration of my Garage S3 server.&#xA;Settings not listed here were left as default.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Target Operating System: &lt;code&gt;Generic Collector&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Encryption Scheme: &lt;code&gt;X509 Certificate/Frontend Certificate&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Collection Type: &lt;code&gt;AWS Bucket&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;S3 Bucket: &lt;code&gt;offline-collections&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Credentials Key: [ &lt;em&gt;my Key ID for offline-collections-key&lt;/em&gt; ]&lt;/li&gt;&#xA;&lt;li&gt;Credentials Secret: [ &lt;em&gt;my Secret Key for offline-collections-key&lt;/em&gt; ]&lt;/li&gt;&#xA;&lt;li&gt;Region &lt;code&gt;garage&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Endpoint: &lt;code&gt;http://192.168.56.1:3900&lt;/code&gt; (my garage server IP and &lt;code&gt;S3_api&lt;/code&gt; port)&lt;/li&gt;&#xA;&lt;li&gt;Skip Cert Verification: &lt;code&gt;Y&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Pause For Prompt: &lt;code&gt;Y&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Collector Name: &lt;code&gt;collector-windows-triage&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Delete Collection at Exit: &lt;code&gt;Y&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Launch the artifact and let it create the collector.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Now I can go download the collector from the artifact&amp;rsquo;s &lt;strong&gt;Uploaded&#xA;Files&lt;/strong&gt; tab.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/collector_download.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Download the collector&#34;&#xA;         width=&#34;1200&#34; height=&#34;610&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;collector_download.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Download the collector&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;I copy it over to a Windows machine that already has a Velociraptor&#xA;client installed, and that therefore has the binary with which I can&#xA;run the generic collector (as administrator).&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-console&#34;&gt;C:\Program Files\Velociraptor&amp;gt;velociraptor -- --embedded_config collector-windows-triage&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/collector_manual_run.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Manually running the generic collector&#34;&#xA;         width=&#34;1280&#34; height=&#34;802&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;collector_manual_run.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Manually running the generic collector&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;At the end of the collection it pauses, and I can see the that it&#xA;reports successfully uploading the results to the Garage S3 server.&lt;/p&gt;&#xA;&lt;p&gt;The &amp;ldquo;Delete Collection at Exit&amp;rdquo; setting removed the collection zip&#xA;from the local disk after uploading it to the S3 bucket.&lt;/p&gt;&#xA;&lt;p&gt;From my workstation I can connect to the Garage server and confirm&#xA;that the collection zip and the collection log were uploaded:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-shell&#34;&gt;$ mc ls garage/offline-collections&#xA;[2026-03-25 11:19:48 SAST] 107KiB STANDARD Collection-WIN-KMODJ1W0CYG-2026-03-25T09_19_03Z.log&#xA;[2026-03-25 11:19:44 SAST] 611MiB STANDARD Collection-WIN-KMODJ1W0CYG-2026-03-25T09_19_03Z.zip&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So the manual collection works as expected, which means the collector&#xA;settings are correct. However this was just a test step. The next step&#xA;it to automate the creation of the collector and add it to&#xA;Velociraptor&amp;rsquo;s tools inventory.&lt;/p&gt;&#xA;&lt;h3 id=&#34;22-create-a-collector-generating-server-artifact&#34;&gt;2.2 Create a collector-generating server artifact&lt;/h3&gt;&#xA;&lt;p&gt;Now that I&amp;rsquo;m satisfied that my collector configuration works as&#xA;expected, I&amp;rsquo;ll create a server artifact that reproduces the creation&#xA;of that collector.&lt;/p&gt;&#xA;&lt;p&gt;I want to make a few of the options configurable so I&amp;rsquo;ll add those as&#xA;artifact parameters.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: Custom.CreateCollectorTool&#xA;description: |&#xA;  Creates a generic offline collector and adds it to the tool inventory.&#xA;&#xA;type: SERVER&#xA;&#xA;parameters:&#xA;  - name: artifacts&#xA;    type: json_array&#xA;    default: &#39;[&amp;quot;Windows.Triage.Targets&amp;quot;, &amp;quot;Generic.Client.Info&amp;quot;, &amp;quot;Generic.Forensic.SQLiteHunter&amp;quot;]&#39;&#xA;&#xA;  - name: artifact_parameters&#xA;    type: json&#xA;    default: |&#xA;      {&#xA;        &amp;quot;Generic.Forensic.SQLiteHunter&amp;quot;: {&#xA;          &amp;quot;DateAfter&amp;quot;: &amp;quot;1970-01-01T00:00:00Z&amp;quot;,&#xA;          &amp;quot;DateBefore&amp;quot;: &amp;quot;2100-01-01T00:00:00Z&amp;quot;&#xA;        },&#xA;        &amp;quot;Windows.Triage.Targets&amp;quot;: {&#xA;          &amp;quot;HighLevelTargets&amp;quot;: &amp;quot;[\&amp;quot;_Live\&amp;quot;]&amp;quot;&#xA;        }&#xA;      }&#xA;&#xA;  - name: collector_target_args&#xA;    type: json&#xA;    default: |&#xA;      {&#xA;       &amp;quot;bucket&amp;quot;: &amp;quot;offline-collections&amp;quot;,&#xA;       &amp;quot;credentialsKey&amp;quot;: &amp;quot;GKaa23dd92075b4dc6fc9fe54f&amp;quot;,&#xA;       &amp;quot;credentialsSecret&amp;quot;: &amp;quot;0bdfb02186ded9c01e0f755661c62e087ea2a280443d138ccaa05948e68faa78&amp;quot;,&#xA;       &amp;quot;region&amp;quot;: &amp;quot;garage&amp;quot;,&#xA;       &amp;quot;endpoint&amp;quot;: &amp;quot;http://192.168.56.1:3900&amp;quot;,&#xA;       &amp;quot;noverifycert&amp;quot;: &amp;quot;Y&amp;quot;&#xA;      }&#xA;&#xA;  - name: collector_tool_name&#xA;    default: &#39;collector-windows-triage&#39;&#xA;&#xA;  - name: collector_tool_version&#xA;    default: &#39;1&#39;&#xA;&#xA;  - name: collector_target&#xA;    default: &#39;S3&#39;&#xA;&#xA;sources:&#xA;  - query: |&#xA;      LET collector_spec &amp;lt;= dict(&#xA;          OS=&amp;quot;Generic&amp;quot;,&#xA;          artifacts=artifacts,&#xA;          parameters=artifact_parameters,&#xA;          target=collector_target,&#xA;          target_args=collector_target_args,&#xA;          encryption_scheme=&amp;quot;X509&amp;quot;,&#xA;          opt_verbose=&amp;quot;Y&amp;quot;,&#xA;          opt_banner=&amp;quot;Y&amp;quot;,&#xA;          opt_prompt=&amp;quot;Y&amp;quot;,&#xA;          opt_admin=&amp;quot;Y&amp;quot;,&#xA;          opt_level=5,&#xA;          opt_concurrency=2,&#xA;          opt_format=&amp;quot;jsonl&amp;quot;,&#xA;          opt_filename_template=&amp;quot;Collection-%Hostname%-%TIMESTAMP%&amp;quot;,&#xA;          opt_collector_filename=collector_tool_name,&#xA;          opt_cpu_limit=0,&#xA;          opt_progress_timeout=1800,&#xA;          opt_timeout=1800,&#xA;          opt_delete_at_exit=&amp;quot;Y&amp;quot;)&#xA;&#xA;      SELECT inventory_add(tool=collector_tool_name,&#xA;                                accessor=&amp;quot;fs&amp;quot;,&#xA;                                file=Repacked.Components,&#xA;                                version=collector_tool_version,&#xA;                                serve_locally=true) AS CollectorTool&#xA;      FROM Artifact.Server.Utils.CreateCollector(`**`=collector_spec)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Some things to notice about this artifact:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The &lt;code&gt;Server.Utils.CreateCollector&lt;/code&gt; artifact accepts many parameters.&#xA;I&amp;rsquo;ve constructed a dict with key names matching the ones that can be&#xA;seen in the &lt;strong&gt;Requests&lt;/strong&gt; tab after running&#xA;&lt;code&gt;Server.Utils.CreateCollector&lt;/code&gt; in the previous test build.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/createcollector_requests.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;The Server.Utils.CreateCollector Requests tab&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;createcollector_requests.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    The Server.Utils.CreateCollector Requests tab&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The &lt;code&gt;Server.Utils.CreateCollector&lt;/code&gt; has some parameters that I want&#xA;to be able to easily change, so I&amp;rsquo;ve added those as parameters to my&#xA;artifact. Dealing with some of their values is a bit tricky because&#xA;the JSON that you see in the Requests tab is heavily&#xA;backslash-escaped. In my artifact:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the &lt;code&gt;artifacts&lt;/code&gt; parameter needs to be a valid JSON array&lt;/li&gt;&#xA;&lt;li&gt;the &lt;code&gt;artifact_parameters&lt;/code&gt;and &lt;code&gt;collector_target_args&lt;/code&gt; parameters&#xA;need to be a valid JSON objects&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;To validate your JSON for these parameters, you can use an online&#xA;tool such as &lt;a href=&#34;https://jsonlint.com/&#34; target=&#34;_blank&#34; &gt;https://jsonlint.com/&lt;/a&gt;, which also allows you to&#xA;prettify it once it&amp;rsquo;s validated.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Tool versioning is quite important and useful, so I&amp;rsquo;ve added the&#xA;tool &lt;code&gt;version&lt;/code&gt; as an artifact parameter. This allows me to store&#xA;multiple versions of the same tool in the tools inventory, and&#xA;potentially choose a particular version when I run my client&#xA;artifact.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;In the &lt;code&gt;collector_target_args&lt;/code&gt; parameter there are a few child&#xA;fields that are left empty by &lt;code&gt;Server.Utils.CreateCollector&lt;/code&gt;, so&#xA;I&amp;rsquo;ve omitted those from the JSON to simplify it. I could have done&#xA;the same with the date filter parameters in&#xA;&lt;code&gt;Generic.Forensic.SQLiteHunter&lt;/code&gt;, and it would just use the defaults&#xA;for those parameters, but I deliberately kept those fields to&#xA;highlight the nested JSON structure.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;When passing the &lt;code&gt;collector_spec&lt;/code&gt; dict to&#xA;&lt;code&gt;Server.Utils.CreateCollector&lt;/code&gt; I&amp;rsquo;ve used&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/vql/fundamentals/#argument-unpacking&#34;&gt;argument unpacking&lt;/a&gt;&#xA;(&lt;code&gt;**=&lt;/code&gt; syntax) to make the SELECT clause more succinct.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;23-run-the-server-artifact&#34;&gt;2.3 Run the server artifact&lt;/h3&gt;&#xA;&lt;p&gt;I can now run this artifact on my server to generate the offline&#xA;collector and store it in the tools repository.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/createcollectortool_uploads.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Custom.CreateCollectorTool Uploaded Files&#34;&#xA;         width=&#34;1200&#34; height=&#34;565&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;createcollectortool_uploads.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Custom.CreateCollectorTool Uploaded Files&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The &lt;strong&gt;Uploaded Files&lt;/strong&gt; tab of the collection makes the offline collector&#xA;and associated spec file available for download, but I don&amp;rsquo;t need to&#xA;do that because the tool is already stored in the tools inventory.&lt;/p&gt;&#xA;&lt;p&gt;On the &lt;strong&gt;Results&lt;/strong&gt; tab I can see that the tool has been added to the&#xA;inventory.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/createcollectortool_results.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Custom.CreateCollectorTool Uploaded Files&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;createcollectortool_results.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Custom.CreateCollectorTool Uploaded Files&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;I can also verify that the tool is in the inventory by running the&#xA;following query in a notebook:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT name, hash, version, serve_locally FROM inventory()&#xA;WHERE name =~ &amp;quot;collector-windows-triage&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/inventory_check.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Querying the inventory in a notebook&#34;&#xA;         width=&#34;1111&#34; height=&#34;345&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;inventory_check.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Querying the inventory in a notebook&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;3-create-a-client-artifact-to-run-the-offline-collector&#34;&gt;3. Create a client artifact to run the offline collector&lt;/h2&gt;&#xA;&lt;p&gt;With the tool added to the inventory, I can now create my client&#xA;artifact that will use it.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s a very simple artifact that leverages the&#xA;&lt;code&gt;Generic.Utils.FetchBinary&lt;/code&gt; utility artifact to fetch the generic&#xA;collector file from the tools repository.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: Custom.RunOfflineCollectorTool&#xA;description: |&#xA;  Runs a generic offline collector retrieved from the server&#39;s tools repository.&#xA;&#xA;required_permissions:&#xA;  - EXECVE&#xA;&#xA;implied_permissions:&#xA;  - FILESYSTEM_WRITE&#xA;&#xA;tools:&#xA;# All we need here is the tool name and version because it already exists in&#xA;# the tools repository&#xA;  - name: collector-windows-triage&#xA;    version: &amp;quot;1&amp;quot;&#xA;&#xA;parameters:&#xA;# You can have multiple collectors to choose from but they all need to be&#xA;# included under the `tools` top-level key.&#xA;  - name: collector_name&#xA;    type: choices&#xA;    default: collector-windows-triage&#xA;    choices:&#xA;      - collector-windows-triage&#xA;&#xA;sources:&#xA;  - query: |&#xA;      LET collector &amp;lt;= SELECT *&#xA;        FROM Artifact.Generic.Utils.FetchBinary(&#xA;                                          ToolName=collector_name,&#xA;                                          IsExecutable=FALSE,&#xA;                                          SleepDuration=&amp;quot;0&amp;quot;,&#xA;                                          TemporaryOnly=TRUE)&#xA;&#xA;      LET host_info &amp;lt;= SELECT * FROM info()&#xA;&#xA;      LET cmd_args &amp;lt;= (host_info[0].Exe, &amp;quot;--&amp;quot;, &amp;quot;--embedded_config&amp;quot;,&#xA;            collector[0].OSPath)&#xA;&#xA;      SELECT *&#xA;      FROM execve(argv=cmd_args, sep=&amp;quot;\n&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Some things to notice about this artifact:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;It uses the &lt;code&gt;info()&lt;/code&gt; plugin to get the full path to the Velociraptor&#xA;client&amp;rsquo;s own binary. It then uses that to run the generic collector.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;For the &lt;code&gt;Generic.Utils.FetchBinary&lt;/code&gt; artifact I&amp;rsquo;ve specified the&#xA;parameter &lt;code&gt;TemporaryOnly=TRUE&lt;/code&gt; because it&amp;rsquo;s easy for an adversary to&#xA;print out the collector config and see what I&amp;rsquo;m collecting &lt;em&gt;if&lt;/em&gt; the&#xA;file is left lying around on the filesystem. So by avoiding caching&#xA;the file in the local tools cache, there&amp;rsquo;s less chance of some else&#xA;finding it abusing it. It&amp;rsquo;s also very unlikely that I&amp;rsquo;d want to run&#xA;the same offline collector twice, so caching it isn&amp;rsquo;t really useful.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The artifact makes provision for adding more offline collectors, but&#xA;I only have one at this stage.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;in the &lt;code&gt;tools&lt;/code&gt; section I have specified a version number. If I&#xA;create subsequent versions of the same tool, then I can switch to a&#xA;specific version if needed by changing this value. If I want it to&#xA;always use the highest version of the tool, I could not specify a&#xA;version and it will automatically choose the highest number (taking&#xA;into account Semantic Versioning if I had chosen to use that&#xA;scheme).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;4-run-the-client-artifact&#34;&gt;4. Run the client artifact&lt;/h2&gt;&#xA;&lt;p&gt;I now collect the &lt;code&gt;Custom.RunOfflineCollectorTool&lt;/code&gt; on a client. I&amp;rsquo;m&#xA;doing this for a single client but it could just as easily be run via&#xA;a hunt to target many clients.&lt;/p&gt;&#xA;&lt;p&gt;The collection proceeds on the client and I can view the results,&#xA;which will come though in near-realtime as the offline collector is&#xA;running. The collection results are just a line-parsed view the output&#xA;from Stdout and Stderr.&lt;/p&gt;&#xA;&lt;p&gt;Near the end of the results I can see that it uploaded the collection&#xA;container zip to the S3 bucket.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/runcollectortool_results.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Collection results&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;runcollectortool_results.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Collection results&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;On the collections &lt;strong&gt;Log&lt;/strong&gt; tab, I can view the steps taken on the&#xA;client to run the collector, including things like the command that&#xA;was used and post-execution cleanup steps.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/runcollectortool_log.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Collection log&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;runcollectortool_log.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Collection log&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The offline collector doesn&amp;rsquo;t know it&amp;rsquo;s being run by a Velociraptor&#xA;client and, as I mentioned in the overview, the collection data is&#xA;therefore independent of the Velociraptor server. The client was just&#xA;being used to run the collector. The collection results and collection&#xA;log only provide information about running the collector.&lt;/p&gt;&#xA;&lt;h2 id=&#34;5-download-collection-zips-from-the-s3-server&#34;&gt;5. Download collection zips from the S3 server.&lt;/h2&gt;&#xA;&lt;p&gt;With the collection zips stored in the S3 bucket, any external process&#xA;can take over from there. You may have an automated process that&#xA;monitors the bucket for new arrivals, downloads them, and feeds them&#xA;into a processing pipeline.&lt;/p&gt;&#xA;&lt;p&gt;In my case, I&amp;rsquo;m just going to download them manually using the MinIO&#xA;&lt;code&gt;mc&lt;/code&gt; utility that I set up previously.&lt;/p&gt;&#xA;&lt;p&gt;First I list what&amp;rsquo;s in the bucket:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-shell&#34;&gt;mc ls garage/offline-collections&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/offline_collector_tool//knowledge_base/tips/offline_collector_tool/mc_ls.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Bucket listing&#34;&#xA;         width=&#34;775&#34; height=&#34;276&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;mc_ls.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Bucket listing&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;I then download the files to my desktop using &lt;code&gt;mc&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-shell&#34;&gt;mc cp --recursive garage/offline-collections /tmp/collections/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;At this point I have many options regarding how I might want to work&#xA;with the collection container zips.&lt;/p&gt;&#xA;&lt;p&gt;For example I could:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/collection_data/#extracting-or-listing-with-the-velociraptor-unzip-command&#34;&gt;extract the collection zips&lt;/a&gt;&#xA;and work with their contents using other tools, perhaps also using&#xA;Velociraptor&amp;rsquo;s&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/#command-line-investigation-tool&#34;&gt;command line analysis&lt;/a&gt;&#xA;capabilities alongside the other tools.&lt;/p&gt;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;run an&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/#instant-velociraptor&#34;&gt;Instant Velociraptor&lt;/a&gt;&#xA;instance on my local workstation, or a set up separate Velociraptor&#xA;server dedicated to analysis, and then either:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/collection_data/#importing-collections-into-the-velociraptor-server&#34;&gt;import the collection container zips&lt;/a&gt;&#xA;before working with their contents, or&lt;/li&gt;&#xA;&lt;li&gt;work with the collection container contents&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/collection_data/#accessing-collection-containers-without-importing&#34;&gt;without importing them&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;As always, Velociraptor give you many options and you&amp;rsquo;ll need to&#xA;decide which options work best for your situation. Hopefully the steps&#xA;demonstrated here are generic enough that they can be easily adapted&#xA;for similar scenarios.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Encrypt and decrypt an offline collector using PGP public and private keys</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/encrypt_offline_collector_pgp/</link>
      <pubDate>Sat, 07 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/encrypt_offline_collector_pgp/</guid>
      <description>&lt;h1 id=&#34;encrypt-and-decrypt-an-offline-collector-using-pgp-public-and-private-keys&#34;&gt;Encrypt and decrypt an offline collector using PGP public and private keys&lt;/h1&gt;&#xA;&lt;p&gt;Velociraptor supports three modes for encrypting Offline Collectors: Password, X.509 Secured, and PGP-secured (as &lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/&#34;&gt;described here&lt;/a&gt;).&#xA;While X.509 is the standard for automatic server imports, using PGP is a great alternative when you need to decrypt collections independently of the Velociraptor Server.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The PGP Encryption Workflow:&lt;/strong&gt;&#xA;When using PGP, Velociraptor follows a &amp;ldquo;hybrid&amp;rdquo; encryption approach:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Generation&lt;/strong&gt;: Velociraptor generates a high-entropy random password.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Encryption&lt;/strong&gt;: The collected data is encrypted with this password.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Envelope&lt;/strong&gt;: The password itself is encrypted using your PGP Public Key and stored in the metadata.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Decryption&lt;/strong&gt;: To access the data, you must first decrypt the password using your &lt;strong&gt;PGP Private Key&lt;/strong&gt;, then decompress the protected zip using the password.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;step-1-generate-a-pgp-key-pair&#34;&gt;Step 1: Generate a PGP key-pair&lt;/h3&gt;&#xA;&lt;p&gt;First, generate an RSA key-pair. We will use a batch file for automation, but you can also do this interactively.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;gpg --batch --generate-key &amp;lt;&amp;lt;EOF&#xA;    Key-Type: RSA&#xA;    Key-Length: 3072&#xA;    Subkey-Type: RSA&#xA;    Subkey-Length: 3072&#xA;    Name-Real: Ilo&#xA;    Name-Email: ilo@test.com&#xA;    Expire-Date: 1y&#xA;    %no-protection&#xA;    %commit&#xA;EOF&#xA;&#xA;# Export the public key for use in the collector&#xA;gpg --armor --export ilo@test.com &amp;gt; key.pub&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;step-2-configure-the-collector-spec&#34;&gt;Step 2: Configure the Collector Spec&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The easiest way to build the Offline Collector is in the GUI. This approach will generate a Velociraptor Offline Collector and a spec.yaml.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The following will show how to build the offline collector using CLI:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Setup a datastore location&lt;/li&gt;&#xA;&lt;li&gt;Setup a artifact location (only needed if external artifacts will be used)&lt;/li&gt;&#xA;&lt;li&gt;Create a template-spec.yaml&lt;/li&gt;&#xA;&lt;li&gt;Create the Velociraptor Offline Collector&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;strong&gt;Prepare the CLI environment&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;mkdir datastore artifacts&#xA;&#xA;# Download reference artifacts and the Velociraptor binary&#xA;wget https://triage.velocidex.com/artifacts/Velociraptor_Triage_v0.1.zip -P artifacts&#xA;7z x artifacts/Velociraptor_Triage_v0.1.zip -oartifacts&#xA;wget https://github.com/Velocidex/velociraptor/releases/download/v0.75/velociraptor-v0.75.6-linux-amd64&#xA;chmod +x velociraptor-v0.75.6-linux-amd64&#xA;&#xA;# Generate a base template&#xA;./velociraptor-v0.75.6-linux-amd64 collector &amp;gt; template-spec.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; &lt;code&gt;template-spec.yaml&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Edit your YAML file to include your public key in the field &lt;code&gt;public_key&lt;/code&gt;. Ensure the &lt;code&gt;EncryptionScheme&lt;/code&gt; is set to &lt;code&gt;PGP&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;OS: Windows&#xA;Artifacts:&#xA; Windows.Triage.Targets:&#xA;   HighLevelTargets: &#39;[&amp;quot;_SANS_Triage&amp;quot;, &amp;quot;_KapeTriage&amp;quot;]&#39;&#xA;   Devices: &#39;[&amp;quot;C:&amp;quot;,&amp;quot;D:&amp;quot;,&amp;quot;E:&amp;quot;]&#39;&#xA;Target: ZIP&#xA;EncryptionScheme: PGP&#xA;EncryptionArgs:&#xA;  public_key: |-&#xA;    -----BEGIN PGP PUBLIC KEY BLOCK-----&#xA;&#xA;    REDACTED...&#xA;    -----END PGP PUBLIC KEY BLOCK-----&#xA;  password: &amp;quot;&amp;quot;&#xA;OptVerbose: Y&#xA;OptBanner: Y&#xA;OptPrompt: N&#xA;OptAdmin: Y&#xA;OptTempdir: &amp;quot;&amp;quot;&#xA;OptLevel: 9&#xA;OptConcurrency: 2&#xA;OptFilenameTemplate: &amp;quot;Collection-%Hostname%-%TIMESTAMP%&amp;quot;&#xA;OptCollectorTemplate: &amp;quot;&amp;quot;&#xA;OptFormat: jsonl&#xA;OptOutputDirectory: &amp;quot;&amp;quot;&#xA;OptCpuLimit: 0&#xA;OptProgressTimeout: 1800&#xA;OptTimeout: 0&#xA;OptVersion: &amp;quot;&amp;quot;&#xA;OptDeleteAtExit: N&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;Step 3: Build the Offline Collector&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Run the following command to &amp;ldquo;repack&amp;rdquo; the Velociraptor binary into a standalone collector based on your spec.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;./velociraptor-v0.75.6-linux-amd64 collector --datastore datastore --definitions artifacts template-spec.yaml&#xA;&#xA;[&#xA; {&#xA;  &amp;quot;Repacked&amp;quot;: {&#xA;   &amp;quot;Path&amp;quot;: &amp;quot;/REDACTED/datastore/Collector_velociraptor-v0.75.6-windows-amd64.exe&amp;quot;,&#xA;   &amp;quot;Size&amp;quot;: 87421951,&#xA;   &amp;quot;UploadId&amp;quot;: 0,&#xA;   &amp;quot;sha256&amp;quot;: &amp;quot;f1487b5686c9616def5c55cd32266b4726162758456d7f5149ebfde51bc3a582&amp;quot;,&#xA;   &amp;quot;md5&amp;quot;: &amp;quot;d46f704b4014dd7a76fa2847b21f813e&amp;quot;,&#xA;   &amp;quot;Components&amp;quot;: [&#xA;    &amp;quot;Collector_velociraptor-v0.75.6-windows-amd64.exe&amp;quot;&#xA;   ]&#xA;  },&#xA;  &amp;quot;_Source&amp;quot;: &amp;quot;Server.Utils.CreateCollector&amp;quot;&#xA; }&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;step-4-decrypt-the-results&#34;&gt;Step 4: Decrypt the Results&lt;/h3&gt;&#xA;&lt;p&gt;The Velociraptor Offline Collector will generate a Collector.zip&#xA;file. The file structure within the container is documented as&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/collection_data/&#34;&gt;described&#xA;here&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;data.zip&lt;/li&gt;&#xA;&lt;li&gt;metadata.json&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Within the metadata.json file you fill find the encrypted password in the &lt;code&gt;EncryptedPass&lt;/code&gt; entry:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;[&#xA; {&#xA;  &amp;quot;EncryptedPass&amp;quot;: &amp;quot;REDACTED&amp;quot;,&#xA;  &amp;quot;Scheme&amp;quot;: &amp;quot;PGP&amp;quot;,&#xA;  &amp;quot;PublicKey&amp;quot;: &amp;quot;-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nREDACTED\n-----END PGP PUBLIC KEY BLOCK-----&amp;quot;&#xA; }&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can decrypt the password and the data using the following commands:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;# 1. Extract the encrypted pass from metadata&#xA;# 2. Base64 decode it&#xA;# 3. Decrypt with GPG&#xA;# 4. Use the result as the password for the data zip&#xA;PASS=$(7z e -so Collection.zip metadata.json | jq -r &#39;.[].EncryptedPass&#39; | base64 -d | gpg --decrypt)&#xA;7z x Collection.zip &amp;quot;-p$PASS&amp;quot; -y&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This assumes that the private key is in your gpg vault.&lt;/p&gt;&#xA;&lt;h3 id=&#34;working-with-the-data&#34;&gt;Working with the data&lt;/h3&gt;&#xA;&lt;p&gt;Working with the Offline Collection data is &lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/collection_data/&#34;&gt;described here&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to set up OIDC authentication using ADFS</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs/</link>
      <pubDate>Mon, 26 Jan 2026 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs/</guid>
      <description>&lt;h1 id=&#34;how-to-set-up-oidc-authentication-using-adfs&#34;&gt;How to set up OIDC authentication using ADFS&lt;/h1&gt;&#xA;&lt;p&gt;This guide walks you through the configuration of Microsoft ADFS as an OIDC&#xA;authentication provider for Velociraptor.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices warning&#34;&gt;&#xA;  &lt;div heading=&#34; Environment &#34;&gt;&lt;p&gt;This procedure has been tested with Windows Server 2022 and ADFS 4.0&#xA;Velociraptor has been deployed using self signed certificate&lt;/p&gt;&#xA;&lt;p&gt;ADFS OpenID Configuration can be read with &lt;a href=&#34;https://auth.domain.local/adfs/.well-known/openid-configuration&#34; target=&#34;_blank&#34; &gt;https://auth.domain.local/adfs/.well-known/openid-configuration&lt;/a&gt;&#xA;SSL certificate on ADFS is provided by Let&amp;rsquo;s Encrypt.&#xA;Velociraptor Server is on velociraptor.local&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/network_overview.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;setup_adfs&#34;&#xA;         width=&#34;1536&#34; height=&#34;1024&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;network_overview.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    setup_adfs&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The high-level steps of this setup process are:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Deploy Velociraptor using Self Signed Certificates.&lt;/li&gt;&#xA;&lt;li&gt;Create a new Application Group in ADFS.&lt;/li&gt;&#xA;&lt;li&gt;Add the authenticator settings to your Velociraptor config.&lt;/li&gt;&#xA;&lt;li&gt;Start Velociraptor&lt;/li&gt;&#xA;&lt;li&gt;Add test users to Velociraptor.&lt;/li&gt;&#xA;&lt;li&gt;Test the authentication process.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;1-deploy-velociraptor-using-self-signed-certificates&#34;&gt;1. Deploy Velociraptor using Self Signed Certificates&lt;/h2&gt;&#xA;&lt;p&gt;Velociraptor quickstart &amp;gt; &lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/quickstart/&#34;&gt;https://docs.velociraptor.app/docs/deployment/quickstart/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;2-create-a-new-application-group-in-adfs&#34;&gt;2. Create a new Application Group in ADFS&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;1. Open ADFS Management&lt;/strong&gt;&#xA;Open Server Manager &amp;gt; Tool &amp;gt; AD FS Management&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/adfs1.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;946&#34; height=&#34;310&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;adfs1.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;2. Create a New Application Group&lt;/strong&gt;&#xA;Select Application Groups and create a new one&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/adfs2.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;370&#34; height=&#34;205&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;adfs2.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;3. Welcome&lt;/strong&gt;&#xA;Enter a name and select Server Application accessing a web API&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/adfs3.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;715&#34; height=&#34;580&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;adfs3.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;4. Server application&lt;/strong&gt;&#xA;Enter your Redirect URI : &lt;a href=&#34;https://velociraptor.local:8889/auth/oidc/callback&#34; target=&#34;_blank&#34; &gt;https://velociraptor.local:8889/auth/oidc/callback&lt;/a&gt; and add it&#xA;Save your client identifier, we will use it on velociraptor config file&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/adfs4.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;714&#34; height=&#34;579&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;adfs4.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;5. Configure Application Credentials&lt;/strong&gt;&#xA;Generate a shared secret and save it&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/adfs5.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;716&#34; height=&#34;581&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;adfs5.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;6. Configure WEB API&lt;/strong&gt;&#xA;Enter your application identifier and add it&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/adfs6.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;715&#34; height=&#34;578&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;adfs6.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;7. Access Control Policy&lt;/strong&gt;&#xA;On next window, Choose Access Control Policy and filter as needed&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/adfs7.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;716&#34; height=&#34;581&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;adfs7.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;8. Configure Application Permissions&lt;/strong&gt;&#xA;Select email, openid, profile&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/adfs8.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;712&#34; height=&#34;581&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;adfs8.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;9. Summary&lt;/strong&gt;&#xA;Validate your summary and click Next, then complete.&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/adfs9.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;711&#34; height=&#34;578&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;adfs9.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;3-add-the-authenticator-settings-to-your-velociraptor-config&#34;&gt;3. Add the authenticator settings to your Velociraptor config&lt;/h2&gt;&#xA;&lt;p&gt;In the &lt;code&gt;GUI&lt;/code&gt; section of your Velociraptor config you should have the following&#xA;authenticator settings by default:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;  authenticator:&#xA;    type: Basic&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;We no longer want Basic auth and instead want SSO, so replace that with these&#xA;new settings to match our Keycloak configuration:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;    type: oidc&#xA;    oidc_issuer: https://domain.local/adfs&#xA;    oidc_name: adfs&#xA;    oauth_client_id: e49d074b-c157-40cd-a1b4-0a863bac99aa&#xA;    oauth_client_secret: scwp-348TOdnNJ7hzP3pKGXcYS4Ohu2q0JMCyDT0&#xA;    # uncommment below if you want a full debug&#xA;    # oidc_debug: true&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The &lt;code&gt;oauth_client_secret&lt;/code&gt; is the value we obtained at the end of step 5. The&#xA;&lt;code&gt;oauth_client_id&lt;/code&gt; is the name we used for the OIDC Client ID in that same&#xA;section in step 4.&lt;/p&gt;&#xA;&lt;h2 id=&#34;4-start-velociraptor&#34;&gt;4. Start Velociraptor&lt;/h2&gt;&#xA;&lt;p&gt;The server should now start cleanly and continue running. In the log messages&#xA;you should see &lt;code&gt;GUI will use the oidc authenticator&lt;/code&gt;. That means everything is&#xA;OK with the authenticator config.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34;tip&#34;&gt;&lt;p&gt;While configuring, testing and potentially troubleshooting problems, it&amp;rsquo;s&#xA;easier if you can see Velociraptor&amp;rsquo;s log messages. You can stop the server&#xA;service and then run the server manually on the command line by using the&#xA;following commands:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;sudo systemctl stop velociraptor_server&#xA;sudo -u velociraptor bash&#xA;velociraptor -c /etc/velociraptor/server.config.yaml frontend -v&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This will display the log messages in the terminal.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;5-add-users&#34;&gt;5. Add Users&lt;/h2&gt;&#xA;&lt;p&gt;Even if you have added groups/users through Access Control Policy in step 7, you have&#xA;to create users in Velociraptor. Users can be created using VQL in Velociraptor&#xA;notebooks but since we have now switched authentication providers we no longer&#xA;have access to the GUI. Of course we could have added the users before we&#xA;switched but let&amp;rsquo;s pretend we didn&amp;rsquo;t and instead do it from the command line.&lt;/p&gt;&#xA;&lt;p&gt;We will make &lt;code&gt;bob@domain.local&lt;/code&gt; a server admin and grant &lt;code&gt;fred@domain.local&lt;/code&gt; the &amp;ldquo;reader&amp;rdquo;&#xA;role, which provides minimal access to Velociraptor&amp;rsquo;s GUI. Note that you have to use the user&#xA;email field in Active Directory. The following two commands will create these users:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;velociraptor --config server.config.yaml user add --role administrator bob@domain.local&#xA;velociraptor --config server.config.yaml user add --role reader fred@domain.local&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;NOTE: We provide the &lt;code&gt;--config&lt;/code&gt; flag so that this invocation of the velociraptor&#xA;binary knows which datastore to add the new users to. This can be done while the&#xA;server service is running or not running, but either way the service will need&#xA;to be restarted to update itself with the datastore changes.&lt;/p&gt;&#xA;&lt;p&gt;Because of our OIDC authenticator config, when adding each user we will receive&#xA;an acknowledgement message saying&#xA;&lt;code&gt;&amp;quot;Authentication will occur via oidc - therefore no password needs to be set.&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;6-test-authentication-process&#34;&gt;6. Test authentication process&lt;/h2&gt;&#xA;&lt;p&gt;Test the authentication process by going to &lt;code&gt;https://velociraptor.local:8889/&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;You will be presented with the choice to log in with Keycloak (multiple&#xA;authentication providers are supported but we only have one configured).&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_adfs//knowledge_base/tips/setup_adfs/adfs10.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1227&#34; height=&#34;350&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;adfs10.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Enter initial credentials using DOMAIN\bob or &lt;a href=&#34;mailto:bob@domain.local&#34; target=&#34;_blank&#34; &gt;bob@domain.local&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to create an &#34;online collector&#34; binary</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/online_collector/</link>
      <pubDate>Fri, 14 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/online_collector/</guid>
      <description>&lt;h1 id=&#34;how-to-create-an-online-collector-binary&#34;&gt;How to create an &amp;ldquo;online collector&amp;rdquo; binary&lt;/h1&gt;&#xA;&lt;p&gt;Velociraptor &lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/&#34;&gt;offline collectors&lt;/a&gt;&#xA;are immensely popular with our users. They are an appealing option because of&#xA;the simplicity and convenience of having a single executable file that any&#xA;desktop-support-level person in a remote environment can run. The collector can&#xA;then exfiltrate&amp;hellip; oops, I mean &amp;ldquo;upload&amp;rdquo;&amp;hellip; the collected data from the&#xA;environment to a cloud storage service such as S3, GCS, Azure, etc.&lt;/p&gt;&#xA;&lt;p&gt;Another reason why they are so popular is that many DFIR practitioners need to&#xA;investigate systems in environments where there is strong resistance to&#xA;installing any new software. Offline collectors do their work without&#xA;installation, which overcomes that obstacle to a large degree.&lt;/p&gt;&#xA;&lt;p&gt;So offline collectors are a great option because &lt;em&gt;&amp;ldquo;it&amp;rsquo;s just an exe&amp;rdquo;&lt;/em&gt; and it&#xA;doesn&amp;rsquo;t require any user interaction besides clicking it. It&amp;rsquo;s hard not to love&#xA;that level of simplicity!&lt;/p&gt;&#xA;&lt;p&gt;However there are downsides to offline collectors:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;You really need to plan ahead about what you want to collect. An offline&#xA;collection is often a one-shot opportunity to collect what you need. Iteration&#xA;would require creating a new collector each time. By contrast a&#xA;network-connected &amp;ldquo;online&amp;rdquo; client makes it easy to quickly pivot and dig&#xA;deeper in response to findings.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Offline collectors need to be packaged with the artifacts and tools that they&#xA;need. This means that you can&amp;rsquo;t quickly create a new artifact and add it to&#xA;your offline collector without rebuilding and redistributing a new binary. If&#xA;your artifacts need tools then bundling them into a collector binary can&#xA;significantly increase the file size.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Because offline collectors do not provide progress updates and resource&#xA;telemetry to the server, we cannot get feedback on how the collection is going&#xA;or on the resource utilization.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;collections-vs-file-acquisitions&#34;&gt;Collections vs. File acquisitions&lt;/h4&gt;&#xA;&lt;p&gt;Many users see the word &amp;ldquo;collector&amp;rdquo; in the term offline collector and take that&#xA;to mean that it&amp;rsquo;s intended to be a bulk file collector (like KAPE and many other&#xA;file acquisition / triage tools). This is not the case: in Velociraptor a&#xA;&amp;ldquo;collection&amp;rdquo; is the execution of any VQL on the endpoint. Velociraptor&#xA;collections typically return JSON-structured &lt;strong&gt;data&lt;/strong&gt;, and can &lt;em&gt;optionally&lt;/em&gt;&#xA;include file copies. But most often Velociraptor collections don&amp;rsquo;t copy files&#xA;unless there&amp;rsquo;s a good reason to do so, like for preservation purposes &lt;em&gt;after&lt;/em&gt;&#xA;detecting potential evidence in the file.&lt;/p&gt;&#xA;&lt;h4 id=&#34;cloud-storage-in-the-middle-architecture&#34;&gt;Cloud-storage-in-the-middle architecture&lt;/h4&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve also observed that some users will use offline collectors to upload&#xA;collection data to a cloud storage service and then have their server import the&#xA;collections from that storage service. If the offline collector on the endpoint&#xA;can access the internet (to upload files to a cloud storage provider, for&#xA;example) and your Velociraptor server is likely also accessible  - or can be&#xA;made accessible - from the internet then a Velociraptor client on the endpoint&#xA;can probably connect the server. I suspect that sometimes this &amp;ldquo;cloud dropbox&amp;rdquo;&#xA;approach might be driven more by the alluring convenience of offline collectors&#xA;rather than being a sensible system architecture choice. Even if it&amp;rsquo;s somehow&#xA;technically justifiable, it&amp;rsquo;s still an awfully inefficient way to do things.&lt;/p&gt;&#xA;&lt;p&gt;Of course there may be some unusual technical constraints that force one to use&#xA;cloud storage as an intermediary, but there&amp;rsquo;s also a good chance that this is&#xA;being done purely because of the simplicity that the offline collector offers.&#xA;And in that case the investigation is incurring delays and wasting resources by&#xA;routing the data via cloud storage - even if you manage to automate the&#xA;transfers.&lt;/p&gt;&#xA;&lt;p&gt;So the question to ask yourself is: &lt;em&gt;Should I really be using an offline&#xA;collector?&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;If your offline collector can connect to a storage service on the internet then&#xA;it might be worth having it just connect to your Velociraptor server via the&#xA;internet. In terms of the data collected, the exact same data can be collected&#xA;by a client (including files).&lt;/p&gt;&#xA;&lt;p&gt;The Velociraptor client can be repacked to replicate the offline collector&amp;rsquo;s&#xA;single-file, no-installation, &amp;ldquo;just run it&amp;rdquo; simplicity. Here&amp;rsquo;s how:&lt;/p&gt;&#xA;&lt;h4 id=&#34;creating-an-online-client-collector&#34;&gt;Creating an online (client) collector&lt;/h4&gt;&#xA;&lt;p&gt;Assuming that client-server connectivity &lt;em&gt;is&lt;/em&gt; possible, you can repack a client&#xA;using the same config embedding and autoexec mechanisms that offline collectors&#xA;use. You can create a binary that starts in client mode and that doesn&amp;rsquo;t require&#xA;installation. It can do all the same collections that an offline collector would&#xA;do, with none of the disadvantages mentioned above. And all it needs is to be&#xA;run locally by some suitably privileged person such as a desktop admin.&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s how to create and run such a client binary:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Download the latest Velociraptor binary for the target platform. In this case&#xA;I am going to use the Windows binary for the target platform and I am going&#xA;to repack it on Linux (where my binary is aliased as &lt;code&gt;velociraptor&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Download the client config from the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/gui/#the-server-dashboard&#34;&gt;server Dashboard&lt;/a&gt; page.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Edit the client config and add an autoexec section above the existing config:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;autoexec:&#xA;  argv: [&amp;quot;client&amp;quot;, &amp;quot;-v&amp;quot;, &amp;quot;--require_admin&amp;quot;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The &lt;code&gt;-v&lt;/code&gt; is added so that the terminal gives some visual&#xA;feedback to let the local helper who started it know that &amp;ldquo;it&amp;rsquo;s busy&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;--require_admin&lt;/code&gt; is added since an installed client normally runs with&#xA;elevated privileges. Offline collectors usually also enforce this&#xA;requirement.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Also add a label section to the Client section of the config - i.e.&#xA;&lt;code&gt;Client.labels&lt;/code&gt;. This label will be used to kick off an initial hunt when the&#xA;client enrolls.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;  labels:&#xA;  - autocollect&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/online_collector//knowledge_base/tips/online_collector/autoconfig.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;The config file should look something like this&#34;&#xA;         width=&#34;496&#34; height=&#34;344&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;autoconfig.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    The config file should look something like this&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Now we do the repacking step:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;velociraptor config repack --exe=velociraptor-v0.75.4-windows-amd64.exe client.root.config.yaml autocollector.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and the results should look something like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;...&#xA;[&#xA; {&#xA;  &amp;quot;RepackInfo&amp;quot;: {&#xA;   &amp;quot;Path&amp;quot;: &amp;quot;/tmp/autoclient/autocollector.exe&amp;quot;,&#xA;   &amp;quot;Size&amp;quot;: 69291504,&#xA;   &amp;quot;UploadId&amp;quot;: 0,&#xA;   &amp;quot;sha256&amp;quot;: &amp;quot;398e0b37bd279f46c03508edd50649b2655516409d682fd1cd4be866b7b03bc1&amp;quot;,&#xA;   &amp;quot;md5&amp;quot;: &amp;quot;24a4cd934d91a95c72853985d2766db0&amp;quot;,&#xA;   &amp;quot;Components&amp;quot;: [&#xA;    &amp;quot;autocollector.exe&amp;quot;&#xA;   ]&#xA;  }&#xA; }&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;On your Velociraptor server set up a new hunt targeting the &lt;code&gt;autocollect&lt;/code&gt;&#xA;label.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;The hunt should include the same artifacts that you would have chosen for&#xA;an offline collector&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Don&amp;rsquo;t forget to start the hunt!&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/online_collector//knowledge_base/tips/online_collector/hunt.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;target the hunt by label (and yes, I know you still want to KAPE everything!)&#34;&#xA;         width=&#34;730&#34; height=&#34;601&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;hunt.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    target the hunt by label (and yes, I know you still want to KAPE everything!)&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Send the &lt;code&gt;autocollector.exe&lt;/code&gt; file to a helpful administrator or other support&#xA;staff who will run it on the machines in their environment. Tell them to &amp;lsquo;Run&#xA;As Administrator&amp;rsquo; and to consider the machines &amp;ldquo;busy&amp;rdquo; as long as the terminal&#xA;window stays open.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;When the exe is run (as administrator) it will open a terminal window and&#xA;show activity as it connects to the server, enrolls, joins the hunt, and&#xA;collects the data.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/online_collector//knowledge_base/tips/online_collector/busy_collecting.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;busy collecting…&#34;&#xA;         width=&#34;1056&#34; height=&#34;642&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;busy_collecting.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    busy collecting…&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;On the server the client is a normal client. You will be able to see it join&#xA;the hunt and be able to view the collection results when it&amp;rsquo;s completed the&#xA;hunt.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/online_collector//knowledge_base/tips/online_collector/client_connected.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;collection completed successfully&#34;&#xA;         width=&#34;946&#34; height=&#34;287&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;client_connected.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    collection completed successfully&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Now the same collection as an offline collector is completed, except that&#xA;the results having been sent back directly to the server. The terminal&#xA;window is still be open on the endpoint, so you are now free to do more&#xA;collections as you would do with any live client, but which would not be&#xA;possible with an offline collector.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Finally, you&amp;rsquo;ve instructed the local admins to leave the machines alone as&#xA;long as the terminal windows are open. But now you&amp;rsquo;re done with a specific&#xA;computer. So now you want to close the terminal on that machine to signal to&#xA;the admins that it&amp;rsquo;s done.&lt;/p&gt;&#xA;&lt;p&gt;Copy the client_id for that machine and in a global notebook and run this VQL,&#xA;substituting your target client&amp;rsquo;s ID:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT killkillkill(client_id=&amp;quot;C.c6ec9a50598f590b&amp;quot;) FROM scope()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;em&gt;The client will be sent the kill signal and the terminal will close.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h4 id=&#34;so-online-collector-vs-offline-collector&#34;&gt;So&amp;hellip; Online collector vs. Offline collector?&lt;/h4&gt;&#xA;&lt;p&gt;By using a non-persistent client we are able to do exactly the same collections&#xA;as could be done with an offline collector, but with all the benefits of an&#xA;online client and none of the disadvantages of an offline collector!&lt;/p&gt;&#xA;&lt;p&gt;From the perspective of the helpful person running the client locally on the&#xA;endpoints, there is no difference between running this or running an offline&#xA;collector (with an offline collector you also should advise them to leave it&#xA;alone until the terminal closes).&lt;/p&gt;&#xA;&lt;p&gt;If your goal is to do bulk file acquisition then with this method you have all&#xA;the files in your server&amp;rsquo;s datastore without the cost, hassles and delays of&#xA;sending the data via a cloud storage service and then importing collection&#xA;archives into the server.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to set up a GCS Bucket for file uploads</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/setup_gcs_storage/</link>
      <pubDate>Fri, 14 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/setup_gcs_storage/</guid>
      <description>&lt;h1 id=&#34;how-to-set-up-a-gcs-bucket-for-file-uploads&#34;&gt;How to set up a GCS Bucket for file uploads&lt;/h1&gt;&#xA;&lt;p&gt;Google Cloud Storage buckets can be a useful upload destination for receiving&#xA;files from Velociraptor clients or collection containers from&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/&#34;&gt;offline collectors&lt;/a&gt;&#xA;in scenarios where the source system is internet connected and you do not want&#xA;to stand up storage services on the local network.&lt;/p&gt;&#xA;&lt;p&gt;This is made possible by the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/other/upload_s3/&#34;&gt;upload_s3&lt;/a&gt; VQL function.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices note&#34;&gt;&#xA;  &lt;div heading=&#34; Deprecation of the upload_gcs() plugin &#34;&gt;&lt;p&gt;Prior to release 0.76, Velociraptor had a dedicated &lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/other/upload_gcs/&#34;&gt;upload_gcs&lt;/a&gt; plugin, however after this&#xA;release that plugin was removed since it increased the binary size&#xA;significantly. Google provides an AWS compatibility mode which allows&#xA;us to use the &lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/other/upload_s3/&#34;&gt;upload_s3&lt;/a&gt; function instead.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;p&gt;This article explains how to set up a GCS bucket with appropriate security for&#xA;file uploads.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;setup-steps&#34;&gt;Setup steps&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Before we can upload files to a bucket we need to have a project in place.&#xA;For this example I will created a new project called &lt;code&gt;velociraptor-demo&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_gcs_storage//knowledge_base/tips/setup_gcs_storage/1__1DXiwQ4__gqzaYMZKSMxAfg.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Create a new project&#34;&#xA;         width=&#34;585&#34; height=&#34;555&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;1__1DXiwQ4__gqzaYMZKSMxAfg.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Create a new project&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Our plan is to distribute to our accomplices the packed binary as before, but&#xA;this time we want Velociraptor to automatically upload results for us into our&#xA;bucket.&lt;/p&gt;&#xA;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;In order to do this we need a service account with credentials allowing it to&#xA;upload to our bucket. Go to &lt;strong&gt;IAM &amp;amp; Admin&lt;/strong&gt; / &lt;strong&gt;Service Accounts&lt;/strong&gt; / &lt;strong&gt;Create&#xA;Service Account:&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_gcs_storage//knowledge_base/tips/setup_gcs_storage/1__ZG9riz0ViCT8PgILXHuU7Q.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;800&#34; height=&#34;477&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;1__ZG9riz0ViCT8PgILXHuU7Q.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;Since the service account will be able to upload by itself (i.e. the user&#xA;does not authenticate on its behalf), we need to identify it with a JSON key.&#xA;The key allows Velociraptor to act as the service account on this cloud&#xA;project. Clicking the Create button will download a JSON file to your system&#xA;with the private key in it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_gcs_storage//knowledge_base/tips/setup_gcs_storage/1__rsKWeCDPrO9AffAuG2k__rA.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;800&#34; height=&#34;370&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;1__rsKWeCDPrO9AffAuG2k__rA.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_gcs_storage//knowledge_base/tips/setup_gcs_storage/1__qGr13ir9qftvzxJUoM5D6A.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;800&#34; height=&#34;291&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;1__qGr13ir9qftvzxJUoM5D6A.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Note the service account’s email address. Currently this account has no&#xA;permissions at all, but we will allow it to write objects into our upload bucket&#xA;later.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_gcs_storage//knowledge_base/tips/setup_gcs_storage/1__EhghHAfmjbZFU2vhiPvhYA.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;800&#34; height=&#34;723&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;1__EhghHAfmjbZFU2vhiPvhYA.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;4&#34;&gt;&#xA;&lt;li&gt;Next we create a bucket to store our collected zip files I will call it&#xA;&lt;code&gt;velociraptor-uploads-121&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_gcs_storage//knowledge_base/tips/setup_gcs_storage/1__ehJ3qfAiaUMNPXoy4mUhEg.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;800&#34; height=&#34;341&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;1__ehJ3qfAiaUMNPXoy4mUhEg.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;5&#34;&gt;&#xA;&lt;li&gt;Selecting the &lt;strong&gt;Permissions&lt;/strong&gt; tab, we are able to add the service account as&#xA;a member — we will only give it the ability to write on a bucket and create&#xA;new objects. This is important since is means that the service account is&#xA;unable to read or list objects in this bucket. Since we will embed the&#xA;service account key in our config file we need to make sure it can not be&#xA;misused to compromise collections from other machines.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_gcs_storage//knowledge_base/tips/setup_gcs_storage/1__vzszs0OjRzdqMRlXbesuNw.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;682&#34; height=&#34;846&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;1__vzszs0OjRzdqMRlXbesuNw.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;6&#34;&gt;&#xA;&lt;li&gt;Setting up service account HMAC keys. This provides the GCP S3&#xA;compatibility layer. These keys allow the caller to log into the&#xA;service account. Note that the keys only provide the same&#xA;permissions that the service account has above - they are simply an&#xA;alternative way of logging in.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_gcs_storage//knowledge_base/tips/setup_gcs_storage/hmac_keys.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Setting up HMAC keys&#34;&#xA;         width=&#34;989&#34; height=&#34;789&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;hmac_keys.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Setting up HMAC keys&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Select &lt;code&gt;Settings -&amp;gt; Interoperability -&amp;gt; Access keys for service accounts&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Use these keys as parameters for the &lt;code&gt;upload_s3()&lt;/code&gt; plugin:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;endpoint=&amp;ldquo;&lt;a href=&#34;https://storage.googleapis.com&#34; target=&#34;_blank&#34; &gt;https://storage.googleapis.com&lt;/a&gt;&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;credentials_key=&amp;ldquo;HMAC KEY&amp;rdquo;,&lt;/li&gt;&#xA;&lt;li&gt;credentials_secret=&amp;ldquo;HMAC KEY SECRET&amp;rdquo;,&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
    </item>
    <item>
      <title>How to set up a SMB share for file uploads</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/setup_smb_share/</link>
      <pubDate>Fri, 14 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/setup_smb_share/</guid>
      <description>&lt;h1 id=&#34;how-to-set-up-a-smb-share-for-file-uploads&#34;&gt;How to set up a SMB share for file uploads&lt;/h1&gt;&#xA;&lt;p&gt;SMB is the Microsoft file-sharing protocol which is a convenient option for&#xA;Windows systems. A SMB share can be a useful upload destination for receiving&#xA;files from Velociraptor clients or collection containers from&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/&#34;&gt;offline collectors&lt;/a&gt;&#xA;in scenarios where you want the files to be sent to a central storage location&#xA;on the local network rather than to the Velociraptor server or to a cloud&#xA;storage service.&lt;/p&gt;&#xA;&lt;p&gt;This is made possible by the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/other/upload_smb/&#34;&gt;upload_smb&lt;/a&gt; VQL function.&lt;/p&gt;&#xA;&lt;p&gt;This article explains how to set up a SMB share with appropriate security for&#xA;file uploads.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;setup-steps&#34;&gt;Setup steps&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a new local uploader user on one of the windows systems&#xA;accessible to the host the collection is running on.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_smb_share//knowledge_base/tips/setup_smb_share/local_user.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Creating a local user for uploads&#34;&#xA;         width=&#34;696&#34; height=&#34;421&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;local_user.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Creating a local user for uploads&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;Create a directory to receive the files.&lt;/li&gt;&#xA;&lt;li&gt;Share the directory out to the local uploader user.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_smb_share//knowledge_base/tips/setup_smb_share/sharing_directory.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Right click on directory and select properties/sharing tab then click the share button&#34;&#xA;         width=&#34;592&#34; height=&#34;458&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;sharing_directory.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Right click on directory and select properties/sharing tab then click the share button&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;4&#34;&gt;&#xA;&lt;li&gt;Adjust directory ACLs to only permit the user to write files&#xA;without being able to list the directory or read the files. This is&#xA;required because the uploader user credentials must be embedded in&#xA;the offline collector so we do not want these misused to alter any&#xA;of the other uploads.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_smb_share//knowledge_base/tips/setup_smb_share/directory_permissions.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Adjusting directory permissions to only provide write access&#34;&#xA;         width=&#34;603&#34; height=&#34;596&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;directory_permissions.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Adjusting directory permissions to only provide write access&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;It is best to test the SMB configuration works as desired using the&#xA;simple VQL query in a notebook.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET SMB_CREDENTIALS &amp;lt;= dict(`192.168.1.112`=&amp;quot;uploader:test!password&amp;quot;)&#xA;&#xA;SELECT upload_smb(accessor=&amp;quot;data&amp;quot;,&#xA;    file=&amp;quot;Hello world&amp;quot;,&#xA;    name=&amp;quot;hello.txt&amp;quot;,&#xA;    server_address=&amp;quot;//192.168.1.112/uploads&amp;quot;)&#xA;FROM scope()&#xA;&#xA;SELECT *&#xA;FROM glob(globs=&amp;quot;*&amp;quot;,&#xA;    root=&amp;quot;//192.168.1.112/uploads&amp;quot;,&#xA;    accessor=&amp;quot;smb&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The above query:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Sets the global credential cache for use of SMB&lt;/li&gt;&#xA;&lt;li&gt;Uploads a test file called &amp;ldquo;hello.txt&amp;rdquo; to the uploader directory&lt;/li&gt;&#xA;&lt;li&gt;Attempts to list the uploads directory using the &lt;code&gt;glob&lt;/code&gt; plugin.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The upload file should succeed but the &lt;code&gt;uploader&lt;/code&gt; user should not be&#xA;able to list the directory.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_smb_share//knowledge_base/tips/setup_smb_share/testing_smb.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Testing the SMB permissions with a VQL query&#34;&#xA;         width=&#34;1344&#34; height=&#34;520&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;testing_smb.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Testing the SMB permissions with a VQL query&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;We are now ready to specify the details to the offline collection&#xA;GUI. NOTE: Usually it is better to use the IP of the server rather&#xA;than the name for improved reliability.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_smb_share//knowledge_base/tips/setup_smb_share/creating_smb_collector.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Creating the SMB offline collector&#34;&#xA;         width=&#34;1139&#34; height=&#34;588&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;creating_smb_collector.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Creating the SMB offline collector&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to set up Azure Blob Storage for file uploads</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/setup_azure_storage/</link>
      <pubDate>Fri, 14 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/setup_azure_storage/</guid>
      <description>&lt;h1 id=&#34;how-to-set-up-azure-blob-storage-for-file-uploads&#34;&gt;How to set up Azure Blob Storage for file uploads&lt;/h1&gt;&#xA;&lt;p&gt;Microsoft Azure&amp;rsquo;s Blob Storage service can be a useful upload destination for&#xA;receiving files from Velociraptor clients or collection containers from&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/&#34;&gt;offline collectors&lt;/a&gt;&#xA;in scenarios where the source system is internet connected and you do not want&#xA;to stand up storage services on the local network.&lt;/p&gt;&#xA;&lt;p&gt;This is made possible by the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/other/upload_azure/&#34;&gt;upload_azure&lt;/a&gt; VQL function.&lt;/p&gt;&#xA;&lt;p&gt;Azure supports an authentication policy called&#xA;&lt;a href=&#34;https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview&#34; target=&#34;_blank&#34; &gt;Shared Access Signature (SAS)&lt;/a&gt;&#xA;making it convenient and secure to provide limited access to the a storage&#xA;container. Using this method, we can embed a simple SAS URL that provides access&#xA;to upload data to the storage container without granting the ability to download&#xA;or remove any data.&lt;/p&gt;&#xA;&lt;p&gt;This article explains how to set up an Azure storage container with appropriate&#xA;security for file uploads.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;setup-steps&#34;&gt;Setup steps&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Create a storage account.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Create a new data storage container to receive the uploads&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_azure_storage//knowledge_base/tips/setup_azure_storage/creating_azure_container.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Creating a new Azure Blob storage container&#34;&#xA;         width=&#34;1354&#34; height=&#34;496&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;creating_azure_container.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Creating a new Azure Blob storage container&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;Add a role assignment to allow the storage account to manage the storage&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_azure_storage//knowledge_base/tips/setup_azure_storage/azure_role_assignment.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Adding a role assignment to the storage account&#34;&#xA;         width=&#34;1226&#34; height=&#34;453&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;azure_role_assignment.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Adding a role assignment to the storage account&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;4&#34;&gt;&#xA;&lt;li&gt;Generate a SAS Policy URL.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_azure_storage//knowledge_base/tips/setup_azure_storage/generating_sas_policy.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Right click on the container to generate a SAS policy&#34;&#xA;         width=&#34;562&#34; height=&#34;375&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;generating_sas_policy.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Right click on the container to generate a SAS policy&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;5&#34;&gt;&#xA;&lt;li&gt;Create a SAS policy with only write and create access. You can&#xA;specify an appropriate expiry time for the SAS URL. After this time&#xA;the uploader will no longer work.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_azure_storage//knowledge_base/tips/setup_azure_storage/sas_policy_details.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;SAS Policy should have only Write and Create Access&#34;&#xA;         width=&#34;550&#34; height=&#34;622&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;sas_policy_details.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    SAS Policy should have only Write and Create Access&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;6&#34;&gt;&#xA;&lt;li&gt;Test the SAS URL works properly&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_azure_storage//knowledge_base/tips/setup_azure_storage/testing_sas_url.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Test the SAS Policy by uploading a small file in the notebook&#34;&#xA;         width=&#34;1328&#34; height=&#34;574&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;testing_sas_url.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Test the SAS Policy by uploading a small file in the notebook&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;ol start=&#34;7&#34;&gt;&#xA;&lt;li&gt;Embed the SAS URL in the offline collector.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_azure_storage//knowledge_base/tips/setup_azure_storage/sas_collector.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Simply paste the SAS URL in the collector GUI&#34;&#xA;         width=&#34;1211&#34; height=&#34;499&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;sas_collector.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Simply paste the SAS URL in the collector GUI&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Backing up and restoring a server.</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/backing_up/</link>
      <pubDate>Thu, 13 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/backing_up/</guid>
      <description>&lt;h1 id=&#34;backing-up-and-restoring-a-server&#34;&gt;Backing up and restoring a server.&lt;/h1&gt;&#xA;&lt;p&gt;Many users ask us about how to back up Velociraptor or achieve a High&#xA;Availability (HA) configuration. The answer to that is nuanced and&#xA;depends on exactly what data is backed up and what the end goal is.&lt;/p&gt;&#xA;&lt;p&gt;In this article I discuss the different mechanisms and approaches used&#xA;for backup and disaster recovery.&lt;/p&gt;&#xA;&lt;h2 id=&#34;simplest-option-re-deploy-server&#34;&gt;Simplest option: Re-deploy server&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s consider the deployment process. What if the Velociraptor server&#xA;is suddenly completely gone! How can we recover?&lt;/p&gt;&#xA;&lt;p&gt;The most difficult part of a Velociraptor deployment is the client&#xA;deployment. This usually involves pushing packages to endpoints, such&#xA;as an MSI or Debian/RPM packages. The process usually involves change&#xA;management, approvals etc. These processes take time and so we&#xA;definitely do not want to have to re-deploy clients!&lt;/p&gt;&#xA;&lt;p&gt;Luckily the client ID is actually a property of the clients&#xA;themselves. The Velociraptor Client ID is derived from the client&amp;rsquo;s&#xA;cryptographic key and so it is not managed by the server at all -&#xA;instead it is stored on the client&amp;rsquo;s in their writeback&#xA;file. Additionally, client registration (or &lt;code&gt;enrollment&lt;/code&gt; in&#xA;Velociraptor terminology), is done automatically the first time the&#xA;client is seen by the server.&lt;/p&gt;&#xA;&lt;p&gt;So if the Velociraptor server is suddenly gone, we can simply redeploy&#xA;the server package onto a new server and everything should work again:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Provision a new server VM or physical machine&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Install the same server Debian package (which contains the same key&#xA;material and configuration files).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Update DNS records to point to the new server IP. The clients will&#xA;use these DNS records to find the new server.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;After a short time, all clients will re-enrol and the system will&#xA;become functional again.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34; Requirements &#34;&gt;&lt;p&gt;For a successful recovery we need:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A backup of the server debian packages last used to upgrade the&#xA;server (this will contain the server configuration file).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A backup of the server configuration file if it was updated since&#xA;the last package upgrade.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A DNS record for the public interface of the server - this allows&#xA;us to redeploy the server to a new IP address easily.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;restoring-from-daily-backups&#34;&gt;Restoring from daily backups&lt;/h2&gt;&#xA;&lt;p&gt;While deploying a new server gets the system operational again, it is&#xA;not enough:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Custom artifacts are not restored&lt;/li&gt;&#xA;&lt;li&gt;Existing hunts are not recovered&lt;/li&gt;&#xA;&lt;li&gt;All collected data from clients are lost&lt;/li&gt;&#xA;&lt;li&gt;Labels on existing clients are lost&lt;/li&gt;&#xA;&lt;li&gt;User accounts and ACLs are lost&lt;/li&gt;&#xA;&lt;li&gt;Multi-tenanted orgs are lost&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;To address some of these issues, Velociraptor creates a backup package&#xA;daily by default. If you need more frequent backups, you can configure the&#xA;backup interval in your server config using the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/references/#defaults.backup_period_seconds&#34;&gt;defaults.backup_period_seconds&lt;/a&gt; setting.&lt;/p&gt;&#xA;&lt;p&gt;You can also force Velociraptor to create a backup package using the VQL&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/server/backup/&#34;&gt;backup()&lt;/a&gt; function, but if you do&#xA;not you can still find the scheduled (daily by default) packages in the backup&#xA;directory &lt;code&gt;&amp;lt;filestore&amp;gt;/backups/&lt;/code&gt;. Note that the backup package in the root org&#xA;will contain all other orgs&amp;rsquo; backups as well.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT * FROM backup(name=&amp;quot;MyBackup&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/backing_up//knowledge_base/tips/backing_up/creating_backup.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Creating a backup package&#34;&#xA;         width=&#34;1504&#34; height=&#34;504&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;creating_backup.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Creating a backup package&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;As you can see above, the backup package contains data from various&#xA;&lt;code&gt;Providers&lt;/code&gt;. Each provider is responsible for saving some aspect of&#xA;the server&amp;rsquo;s configuration. To keep the size down, providers do not&#xA;save bulky items like collected data, rather only metadata is stored&#xA;about the server.&lt;/p&gt;&#xA;&lt;p&gt;For example, the hunts are saved, but not the list of clients that&#xA;have already provided results to the hunt (since the associated collection data&#xA;is not backed up). This means that when restoring the backup on a new&#xA;server, clients will participate in existing hunts again.&lt;/p&gt;&#xA;&lt;p&gt;To restore the backup, you must copy the backup file into the backups&#xA;directory on the new server.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT * FROM backup_restore(name=&amp;quot;MyBackup&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/backing_up//knowledge_base/tips/backing_up/restoring_backup.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Restoring a backup package&#34;&#xA;         width=&#34;1533&#34; height=&#34;456&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;restoring_backup.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Restoring a backup package&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Backups always include the data from all Providers, but when restoring you can&#xA;choose a subset that you want to restore the using the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/server/backup_restore/&#34;&gt;backup_restore()&lt;/a&gt;&#xA;&lt;code&gt;providers&lt;/code&gt; parameter.&lt;/p&gt;&#xA;&lt;p&gt;The current backup providers are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;ACLBackupProvider&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ClientInfoBackupProvider&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;HuntBackupProvider&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;NotebookBackupProvider&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;RepositoryBackupProvider&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Note that ACL records are not automatically restored for security reasons.&#xA;However you can restore them from the backup data in a Velociraptor notebook,&#xA;after carefully reviewing the data. For example, this VQL would restore the&#xA;users and ACLs for a specific org:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT *&#xA;FROM foreach(&#xA;  row={&#xA;    SELECT *&#xA;    FROM parse_jsonl(&#xA;      filename=&amp;quot;/tmp/extracted_backups/orgs/O123/acls.json&amp;quot;)&#xA;  },&#xA;  query={&#xA;    SELECT&#xA;    user_create(&#xA;      user=Principal.name,&#xA;      orgs=Principal.orgs[0].id,&#xA;      roles=Policy.roles),&#xA;    user_grant(&#xA;      user=Principal.name,&#xA;      orgs=Principal.orgs[0].id,&#xA;      policy=Policy)&#xA;    FROM scope()&#xA;  })&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;backing-up-collected-data&#34;&gt;Backing up collected data&lt;/h2&gt;&#xA;&lt;p&gt;The data collected from endpoints is typically much larger and can&#xA;take a while to back up. Deciding if you need that data backed up&#xA;really depends on how you use Velociraptor.&lt;/p&gt;&#xA;&lt;p&gt;Since Velociraptor is typically used to respond to incidents, the data&#xA;collected is typically only useful for a short time. Velociraptor can&#xA;capture a snapshot of the state of endpoints, but this data may not be&#xA;relevant months or weeks later since the state of the endpoints evolve&#xA;over time.&lt;/p&gt;&#xA;&lt;p&gt;In some situations we do want to preserve the data collected from the&#xA;endpoint:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;In order to preserve evidence of compromise. This is needed to&#xA;support further actions, such as disclosure or legal procedures.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;As provenance or audit of the actions taken, what was found and&#xA;justifications of further actions.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;In the above use cases it is important to ensure that the data is&#xA;readable outside of Velociraptor itself. For example sharing&#xA;collections as generic Zip files containing CSV or JSON files is&#xA;preferable to files that can only be viewed in Velociraptor.&lt;/p&gt;&#xA;&lt;p&gt;Therefore, we really need &lt;code&gt;Data Export&lt;/code&gt; capability from&#xA;Velociraptor. This is generated using the &lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/server/create_flow_download/&#34;&gt;create_flow_download()&lt;/a&gt; and&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/server/create_hunt_download/&#34;&gt;create_hunt_download()&lt;/a&gt; plugins. Those&#xA;plugins are the equivalent of the &lt;code&gt;Download Results&lt;/code&gt; option in the&#xA;Velociraptor GUI.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;An export ZIP of a hunt contains all the data collected for that&#xA;hunt by each client that participated.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;An export ZIP of a collection contains all the files collected by&#xA;the specific client.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;For example, to archive all hunts you could use a query like:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT create_hunt_download(hunt_id=hunt_id, wait=TRUE)&#xA;FROM hunts()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The VQL function &lt;code&gt;create_hunt_download()&lt;/code&gt; will return the filestore&#xA;path you can use to read the file (with the &lt;code&gt;fs&lt;/code&gt; accessor).&lt;/p&gt;&#xA;&lt;p&gt;You can also upload those files to, e.g. an S3 bucket:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT upload_s3(secret=&amp;quot;S3Token&amp;quot;,&#xA;                 accessor=&amp;quot;fs&amp;quot;,&#xA;                 file=create_hunt_download(&#xA;                     hunt_id=hunt_id, wait=TRUE))&#xA;FROM hunts()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This approach is fairly selective as you can add and remove&#xA;interesting collections from certain hunts using the GUI - so in a&#xA;real investigation the hunts can serve as a staging container for&#xA;interesting collections.&lt;/p&gt;&#xA;&lt;p&gt;To export specific collections, simply use the&#xA;&lt;code&gt;create_flow_download()&lt;/code&gt; function. For example to export all&#xA;collections on the server completed in the past week:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET OneWeek &amp;lt;= 7 * 24 * 60 * 60&#xA;LET DestDir &amp;lt;= &amp;quot;/tmp/exports/&amp;quot;&#xA;&#xA;SELECT client_id,&#xA;       session_id,&#xA;       LastActiveTime,&#xA;       copy(filename=Export,&#xA;            accessor=&amp;quot;fs&amp;quot;,&#xA;            dest=DestDir + Export.Base) AS Export&#xA;FROM foreach(row={&#xA;  SELECT * FROM clients()&#xA;}, query={&#xA;  SELECT *, timestamp(epoch=active_time) AS LastActiveTime,&#xA;         create_flow_download(client_id=client_id,&#xA;                            flow_id=session_id,&#xA;                            wait=TRUE) AS Export&#xA;  FROM flows(client_id=client_id)&#xA;  WHERE LastActiveTime &amp;gt; now() - OneWeek&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The above query:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Iterates over all clients&lt;/li&gt;&#xA;&lt;li&gt;For each client, iterate over all flows&lt;/li&gt;&#xA;&lt;li&gt;If the flow is more recent than 1 week, generate a flow download.&lt;/li&gt;&#xA;&lt;li&gt;Copy the flow download into a destination directory, preserving the&#xA;base name generated by the system (which contains the client id and&#xA;flow id). Note that we need the &amp;ldquo;fs&amp;rdquo; accessor to read the download&#xA;file generated.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;importing-the-collections-into-the-new-server&#34;&gt;Importing the collections into the new server&lt;/h3&gt;&#xA;&lt;p&gt;To import the collections into the new server we need to read them&#xA;from the shared directory.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET DestDir &amp;lt;= &amp;quot;/tmp/imports/&amp;quot;&#xA;&#xA;SELECT OSPath, import_collection(filename=OSPath)&#xA;FROM glob(globs=&amp;quot;*.zip&amp;quot;, root=DestDir)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/backing_up//knowledge_base/tips/backing_up/importing_flows_.svg&#34; alt=&#34;Importing new collections recreates the clients&#34;&#xA;         class=&#34;inline&#34;&#xA;         height=&#34;551.6666666666666&#34;&#xA;         width=&#34;2412.5&#34;  /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;importing_flows.svg&#34;&gt;&lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Importing new collections recreates the clients&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;complete-backup-of-the-datastore&#34;&gt;Complete backup of the datastore&lt;/h2&gt;&#xA;&lt;p&gt;One of the reasons Velociraptor is very easy to deploy and manage, is&#xA;because everything in Velociraptor is simply a file. There is no need&#xA;for complicated backend dependencies like databases - all you need to&#xA;provide is a directory to store files on.&lt;/p&gt;&#xA;&lt;p&gt;This makes it very easy to back the files up using regular backup&#xA;solutions. It is perfectly safe to run incremental backups on the&#xA;datastore and restore it at any time. Velociraptor does not use file&#xA;locking so there is no problem with a backup software reading all&#xA;files inside the data store directory.&lt;/p&gt;&#xA;&lt;p&gt;It is possible to back up the datastore directory using &lt;code&gt;rsync&lt;/code&gt;, a&#xA;network filesystem, or other solutions to keep a hot spare server on&#xA;standby. Then fail over is simply a matter of switching the DNS or&#xA;load balancer to the other server.&lt;/p&gt;&#xA;&lt;p&gt;This is a more complete backup/high availability solution, but it has&#xA;some caveats:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The internal Velociraptor files are now compressed so you would&#xA;typically need Velociraptor to be able to read the data.&lt;/li&gt;&#xA;&lt;li&gt;This type of backup solution is indiscriminate - all data is backed&#xA;up regardless of how relevant it is. Storage costs can accumulate&#xA;rapidly.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;conclusions&#34;&gt;Conclusions&lt;/h2&gt;&#xA;&lt;p&gt;Backups, Disaster Recovery and High Availability are important aspect to&#xA;consider when deploying Velociraptor. However, due to the nature of&#xA;Velociraptor&amp;rsquo;s use cases, there are several nuances in how to achieve&#xA;this.&lt;/p&gt;&#xA;&lt;p&gt;By thinking carefully about what exactly we want to get out of a&#xA;backup solution, what data we want to protect and how quickly we want&#xA;for it to be restored we can make more informed decision about which&#xA;strategy works best.&lt;/p&gt;&#xA;&lt;p&gt;For ephemeral installations, where Velociraptor collected data is&#xA;immediately exported on to other systems (for example using the&#xA;Elastic or Splunk connectors), it may not be worth worrying about&#xA;backups at all! A new deployment can be setup in minutes and the&#xA;system can be quickly recovered.&lt;/p&gt;&#xA;&lt;p&gt;However for most elaborate deployments, more thought can be given to&#xA;backups, collection exports for preservation and maybe even a&#xA;complete backup/hot standby architecture.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Pre-populating a server with clients, hunts and flows</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/prepopulate_server/</link>
      <pubDate>Tue, 14 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/prepopulate_server/</guid>
      <description>&lt;h1 id=&#34;pre-populating-a-server-with-clients-hunts-and-flows&#34;&gt;Pre-populating a server with clients, hunts and flows&lt;/h1&gt;&#xA;&lt;p&gt;When setting up a Velociraptor server for training or demonstration,&#xA;it is sometimes desirable to have some data already populated.&lt;/p&gt;&#xA;&lt;p&gt;For a realistic training exercise, some people use a &lt;a href=&#34;https://github.com/iknowjason/BlueCloud&#34; target=&#34;_blank&#34; &gt;Cyber&#xA;Range&lt;/a&gt; to fully emulate a&#xA;real environment. However, managing a large Cyber Range is complex and&#xA;expensive.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes, we just want a simple Velociraptor server with&#xA;pre-populated data, so users can learn how to analyze hunt results,&#xA;and improve their VQL skills!&lt;/p&gt;&#xA;&lt;h2 id=&#34;in-velociraptor---everything-is-a-file&#34;&gt;In Velociraptor - Everything is a file!&lt;/h2&gt;&#xA;&lt;p&gt;The Velociraptor server simply keeps all the data as simple files on&#xA;disk.  These files are organized into higher level concepts like&#xA;Clients, Flows, Hunts and notebooks.&lt;/p&gt;&#xA;&lt;p&gt;Conceptually you can think of these as just storage hierarchies which&#xA;can be easily recreated:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;code&gt;Flow&lt;/code&gt; is a single collection that occurred as a particular&#xA;time. Flows &lt;strong&gt;Contain&lt;/strong&gt; artifact results, and uploaded files.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;code&gt;Client&lt;/code&gt; represents an endpoint. The Velociraptor server stores&#xA;all flows under the client&amp;rsquo;s directory in the file store. Clients&#xA;have a unique client id which is how we can identify them.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;code&gt;Hunt&lt;/code&gt; is a logical set of clients and flows which can be&#xA;processed together using plugins like &lt;code&gt;hunt_results()&lt;/code&gt; or&#xA;&lt;code&gt;source()&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;creating-clients&#34;&gt;Creating clients.&lt;/h2&gt;&#xA;&lt;p&gt;Normally a client will be created on the server when a physical client&#xA;first connects to it. However, it is possible to create new &amp;ldquo;client&amp;rdquo;&#xA;objects using the VQL &lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/server/client_create/&#34;&gt;client_create()&lt;/a&gt; function.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s create 100 clients:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT client_create(os=&amp;quot;windows&amp;quot;,&#xA;   hostname=format(format=&amp;quot;Host%d&amp;quot;, args=_value)) AS ClientId&#xA;FROM range(end=100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;adding-flows-to-the-clients&#34;&gt;Adding flows to the clients.&lt;/h2&gt;&#xA;&lt;p&gt;Normally, we would schedule a collection on clients to gather real&#xA;data from the endpoint. But this is not essential, we can also&#xA;&lt;code&gt;import&lt;/code&gt; an existing collection into the client&amp;rsquo;s storage space.&lt;/p&gt;&#xA;&lt;p&gt;The existing collection can be taken on any Velociraptor instance - it&#xA;is just a zip file export of a collection.&lt;/p&gt;&#xA;&lt;p&gt;For this article, I will collect the &lt;code&gt;Generic.Client.Info&lt;/code&gt; artifact&#xA;and export the collection into a ZIP file in the collection overview&#xA;page.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/prepopulate_server//knowledge_base/tips/prepopulate_server/exporting_collections.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Exporting a collection&#34;&#xA;         width=&#34;1594&#34; height=&#34;709&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;exporting_collections.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Exporting a collection&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Next we import the collection into each client on the server:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT import_collection(client_id=client_id,&#xA;    filename=&amp;quot;/tmp/Generic.Info.zip&amp;quot;)&#xA;FROM clients()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;assign-collections-to-a-hunt&#34;&gt;Assign collections to a hunt&lt;/h2&gt;&#xA;&lt;p&gt;A Hunt is a managed container of collections. Normally we schedule a&#xA;hunt so the Velociraptor server can automatically schedule flows on&#xA;clients that match the hunt criteria, and keep track of these in a&#xA;central location.&lt;/p&gt;&#xA;&lt;p&gt;However, we can also just add arbitrary flows to a hunt using VQL. In&#xA;this example I will add all the &lt;code&gt;Generic.Client.Info&lt;/code&gt; collections we&#xA;imported previously into a new hunt so I can analyze them together.&lt;/p&gt;&#xA;&lt;p&gt;First I create a hunt using the GUI to collect the&#xA;&lt;code&gt;Generic.Client.Info&lt;/code&gt; artifact, but I will leave the hunt in the&#xA;&lt;code&gt;STOPPED&lt;/code&gt; state.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/prepopulate_server//knowledge_base/tips/prepopulate_server/example_hunt.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Creating an empty hunt&#34;&#xA;         width=&#34;1852&#34; height=&#34;592&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;example_hunt.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Creating an empty hunt&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The hunt currently has no clients or flows associated with it.&lt;/p&gt;&#xA;&lt;p&gt;I can now assign the latest &lt;code&gt;Generic.Client.Info&lt;/code&gt; collection from each&#xA;client:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;LET HuntId &amp;lt;= &amp;quot;H.D35CUR4S00IHC&amp;quot;&#xA;&#xA;SELECT client_id,&#xA;       session_id,&#xA;       HuntId,&#xA;       hunt_add(client_id=client_id, hunt_id=HuntId, flow_id=session_id)&#xA;FROM foreach(row={&#xA;    SELECT * FROM clients()&#xA;}, query={&#xA;    SELECT *&#xA;    FROM flows(client_id=client_id)&#xA;    WHERE artifacts_with_results =~ &amp;quot;Generic.Client.Info&amp;quot;&#xA;    LIMIT 1&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The above query:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Iterates over all clients&lt;/li&gt;&#xA;&lt;li&gt;For each client, iterates over all flows in that client&lt;/li&gt;&#xA;&lt;li&gt;Select the first flow with artifact results of &lt;code&gt;Generic.Client.Info&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;After one flow matches for each client, go to the next client (this is the &lt;code&gt;LIMIT&lt;/code&gt; clause).&lt;/li&gt;&#xA;&lt;li&gt;Add the flow to the hunt we created earlier.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;post-process-the-collections&#34;&gt;Post process the collections&lt;/h2&gt;&#xA;&lt;p&gt;Depending on the scenarios you want to demonstrate, you can create&#xA;different clients (perhaps a &amp;ldquo;Compromised&amp;rdquo; set) and import different&#xA;collections into them.&lt;/p&gt;&#xA;&lt;p&gt;This method allows running any post processing steps in notebooks as&#xA;if these client are real endpoints.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Manipulating VQL columns and rows</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/operating_on_columns/</link>
      <pubDate>Fri, 26 Sep 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/operating_on_columns/</guid>
      <description>&lt;h1 id=&#34;manipulating-vql-columns-and-rows&#34;&gt;Manipulating VQL columns and rows&lt;/h1&gt;&#xA;&lt;p&gt;VQL has a very simple syntax inspired by SQL. At the heart of the&#xA;language is a &lt;code&gt;SELECT&lt;/code&gt; query which returns a set of &lt;strong&gt;Rows&lt;/strong&gt;. A VQL Row&#xA;consists of &lt;strong&gt;Columns&lt;/strong&gt; and &lt;strong&gt;Cell Values&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can think of the result of a query is simply a list of Dicts,&#xA;where a dict contains key/value pairs. This is easiest to see in the&#xA;GUI&amp;rsquo;s &lt;strong&gt;Raw JSON&lt;/strong&gt; view:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT * FROM info()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This returns a JSON result containing a list of JSON objects, each&#xA;representing a single row (in this case only one row is returned):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;[&#xA;  {&#xA;    &amp;quot;Hostname&amp;quot;: &amp;quot;WIN-SJE0CKQO83P&amp;quot;,&#xA;    &amp;quot;Uptime&amp;quot;: 776266,&#xA;    &amp;quot;BootTime&amp;quot;: 1758078331,&#xA;    &amp;quot;OS&amp;quot;: &amp;quot;windows&amp;quot;,&#xA;    &amp;quot;Platform&amp;quot;: &amp;quot;Microsoft Windows Server 2022 Standard Evaluation&amp;quot;,&#xA;    &amp;quot;PlatformFamily&amp;quot;: &amp;quot;Server&amp;quot;,&#xA;    &amp;quot;PlatformVersion&amp;quot;: &amp;quot;21H2&amp;quot;,&#xA;    &amp;quot;KernelVersion&amp;quot;: &amp;quot;10.0.20348.4052 Build 20348.4052&amp;quot;,&#xA;    &amp;quot;VirtualizationSystem&amp;quot;: &amp;quot;&amp;quot;,&#xA;    &amp;quot;VirtualizationRole&amp;quot;: &amp;quot;&amp;quot;,&#xA;    &amp;quot;CompilerVersion&amp;quot;: &amp;quot;go1.24.7&amp;quot;,&#xA;    &amp;quot;HostID&amp;quot;: &amp;quot;6b65a0af-a752-429a-a65c-83367f882ebe&amp;quot;,&#xA;    &amp;quot;Exe&amp;quot;: &amp;quot;c:\\velociraptor.exe&amp;quot;,&#xA;    &amp;quot;CWD&amp;quot;: &amp;quot;C:\\Users\\Administrator&amp;quot;,&#xA;    &amp;quot;IsAdmin&amp;quot;: true,&#xA;    &amp;quot;ClientStart&amp;quot;: &amp;quot;2025-09-23T04:12:06.2778472Z&amp;quot;,&#xA;    &amp;quot;LocalTZ&amp;quot;: &amp;quot;PDT&amp;quot;,&#xA;    &amp;quot;LocalTZOffset&amp;quot;: -25200,&#xA;    &amp;quot;Fqdn&amp;quot;: &amp;quot;WIN-SJE0CKQO83P&amp;quot;,&#xA;    &amp;quot;Architecture&amp;quot;: &amp;quot;amd64&amp;quot;&#xA;  }&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;We can select specific columns in this using the &lt;strong&gt;Column Specifiers&lt;/strong&gt;&#xA;following the &lt;code&gt;SELECT&lt;/code&gt; clause:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sql&#34;&gt;SELECT Hostname FROM info()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;However, what if we wanted to automatically manipulate the columns in&#xA;a more sophisticated way? This is often needed when we don&amp;rsquo;t know the&#xA;names of all the columns in advance.&lt;/p&gt;&#xA;&lt;p&gt;Some use cases are:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;If we do not know the names of the columns in advance but want&#xA;to select only some columns by e.g. a Regular Expression.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;We want to generate a hash based on a selection of columns.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;This post shows how to convert any VQL query into a list of dicts,&#xA;thereby providing access to the Columns in a more convenient way. We&#xA;then show how to &lt;strong&gt;deconstruct the dict&lt;/strong&gt; back into a row.&lt;/p&gt;&#xA;&lt;p&gt;For the following examples, we use the query &lt;code&gt;SELECT * FROM info()&lt;/code&gt; as a simple&#xA;example of a query, but any query could be used. Typically these techniques are&#xA;more useful for generic queries for which we don&amp;rsquo;t know the types of columns&#xA;returned. For example &lt;code&gt;SELECT * FROM source()&lt;/code&gt;, &lt;code&gt;SELECT * FROM parse_csv()&lt;/code&gt; etc.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-convert-rows-into-dicts&#34;&gt;Step 1: Convert rows into dicts&lt;/h2&gt;&#xA;&lt;p&gt;In order to deal with a row as a dict we need to use the &lt;code&gt;items()&lt;/code&gt;&#xA;plugin:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT * FROM items(item={ SELECT * FROM info() })&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;[&#xA;  {&#xA;      &amp;quot;_key&amp;quot;: 0,&#xA;      &amp;quot;_value&amp;quot;: {&#xA;          &amp;quot;Hostname&amp;quot;: &amp;quot;WIN-SJE0CKQO83P&amp;quot;,&#xA;              ...&#xA;          &amp;quot;Architecture&amp;quot;: &amp;quot;amd64&amp;quot;&#xA;      }&#xA;  }&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When the &lt;code&gt;items()&lt;/code&gt; plugin operates on another query, it emits two columns:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;_key&lt;/code&gt; is a counter of row number&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;_value&lt;/code&gt; is the entire row given as a dict.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Once we have the row as a dict, we can manipulate it easily using a&#xA;number of dict manipulation tools.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-2-perform-operations-on-the-row-dict&#34;&gt;Step 2: Perform operations on the row dict.&lt;/h2&gt;&#xA;&lt;p&gt;Now that we have the row as a dict we can perform any operations on&#xA;it. In the following we see two methods for manipulating dicts:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Set operations&lt;/strong&gt;: allow us to add, remove or merge dicts based on&#xA;their keys. See &lt;a href=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/set_operations/&#34;&gt;Set operations&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Dict reconstruction&lt;/strong&gt;: is a more powerful technique for tearing the&#xA;dict apart and reconstructing it again.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;example-select-only-columns-that-match-a-regular-expression&#34;&gt;Example: Select only columns that match a regular expression.&lt;/h3&gt;&#xA;&lt;p&gt;For this example, let&amp;rsquo;s assume we don&amp;rsquo;t know all the exact columns in advance&#xA;but want to match certain columns based on some regular expression.&lt;/p&gt;&#xA;&lt;p&gt;The key for this technique is to transform a dict&amp;rsquo;s columns based on a regular&#xA;expression: We need to iterate over all the keys in the dict , only including&#xA;some keys based on their name, and then put it back together into a dict:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET FilterKeys(Dict) = to_dict(item={&#xA;  SELECT * FROM items(item=Dict)&#xA;    WHERE _key =~ &amp;quot;Host|Arch&amp;quot;&#xA;})&#xA;&#xA;SELECT _key, FilterKeys(Dict=_value) AS _value&#xA;FROM items(item={ SELECT * FROM info() })&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To make the filtering operation simpler to understand and reuse, I&#xA;extracted it into a VQL function. The &lt;code&gt;FilterKeys&lt;/code&gt; function builds a&#xA;new dict using the &lt;code&gt;to_dict()&lt;/code&gt; function based on a query. The query we&#xA;use uses the &lt;code&gt;items()&lt;/code&gt; plugin again. But this time, since it is&#xA;operating on a dict, the plugin iterates over the dict&amp;rsquo;s keys and&#xA;values as the &lt;code&gt;_key&lt;/code&gt; and &lt;code&gt;_value&lt;/code&gt; columns.&lt;/p&gt;&#xA;&lt;p&gt;For this example, we just remove the keys that do not match the&#xA;regular expression &lt;code&gt;Host|Arch&lt;/code&gt;. This results in a smaller dict with&#xA;only keys matching the regular expression:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;[&#xA;  {&#xA;    &amp;quot;_key&amp;quot;: 0,&#xA;    &amp;quot;_value&amp;quot;: {&#xA;        &amp;quot;Hostname&amp;quot;: &amp;quot;WIN-SJE0CKQO83P&amp;quot;,&#xA;        &amp;quot;HostID&amp;quot;: &amp;quot;6b65a0af-a752-429a-a65c-83367f882ebe&amp;quot;,&#xA;        &amp;quot;Architecture&amp;quot;: &amp;quot;amd64&amp;quot;&#xA;    }&#xA;  }&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;example-hash-a-subset-of-columns&#34;&gt;Example: Hash a subset of columns&lt;/h3&gt;&#xA;&lt;p&gt;For this example, suppose we have a set of columns that we consider to&#xA;be a representative of the row and we want to generate a hash based on&#xA;those. This technique allows us to tag similar rows with a unique&#xA;representative ID.&lt;/p&gt;&#xA;&lt;p&gt;For our example we want to create another dict with the columns&#xA;&lt;code&gt;Hostname&lt;/code&gt;, &lt;code&gt;Exe&lt;/code&gt; and &lt;code&gt;Architecture&lt;/code&gt;. We consider those columns to be&#xA;fully representative of the row, that is we accept that other columns may&#xA;vary but as long as those fields are the same, we consider the rows to&#xA;be duplicates.&lt;/p&gt;&#xA;&lt;p&gt;We can quickly extract only those fields by using&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/set_operations/&#34;&gt;Set intersection&lt;/a&gt;&#xA;(In VQL this is implemented by dict multiplication):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET FingerPrint &amp;lt;= dict(Hostname=TRUE, Exe=TRUE, Architecture=TRUE)&#xA;&#xA;SELECT _key, _value * FingerPrint AS _value&#xA;FROM items(item={&#xA;    SELECT * FROM info()&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;[&#xA;  {&#xA;    &amp;quot;_key&amp;quot;: 0,&#xA;    &amp;quot;_value&amp;quot;: {&#xA;        &amp;quot;Hostname&amp;quot;: &amp;quot;WIN-SJE0CKQO83P&amp;quot;,&#xA;        &amp;quot;Exe&amp;quot;: &amp;quot;c:\\velociraptor.exe&amp;quot;,&#xA;        &amp;quot;Architecture&amp;quot;: &amp;quot;amd64&amp;quot;&#xA;    }&#xA;  }&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now we produce a hash of these fields by serializing the dict into a JSON&#xA;object. This hash will be the same for every row with the same set of&#xA;values for these specific fields:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT _key,&#xA;    hash(accessor=&amp;quot;data&amp;quot;, path=serialize(item=_value * FingerPrint) ).MD5 AS _value&#xA;FROM items(item={&#xA;    SELECT * FROM info()&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Similarly we can use dict subtraction to remove fields from the dict&#xA;(e.g. a timestamp field may change all the time so we may want to&#xA;remove it).&lt;/p&gt;&#xA;&lt;p&gt;Now in this example, I will add the new hash into the row dict as an&#xA;additional field:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT _key,&#xA;       _value + dict(&#xA;         _HashID=hash(accessor=&amp;quot;data&amp;quot;,&#xA;                      path=serialize(item=_value * FingerPrint)).MD5) AS _value&#xA;FROM items(item={&#xA;    SELECT * FROM info()&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This works using &lt;strong&gt;dict addition&lt;/strong&gt;. I create a new dict with a single&#xA;key of &lt;code&gt;_HashID&lt;/code&gt; containing the hash that I got earlier. By adding this new&#xA;dict to the original row dict, I get a new dict with an additional key.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;[&#xA;  {&#xA;    &amp;quot;_key&amp;quot;: 0,&#xA;    &amp;quot;_value&amp;quot;: {&#xA;        &amp;quot;Hostname&amp;quot;: &amp;quot;WIN-SJE0CKQO83P&amp;quot;,&#xA;        &amp;quot;Architecture&amp;quot;: &amp;quot;amd64&amp;quot;,&#xA;            ....&#xA;        &amp;quot;_HashID&amp;quot;: &amp;quot;ae7b6e78e5fce4b5e18d371be5916472&amp;quot;&#xA;    }&#xA;  }&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;step-3-turn-a-dict-back-into-a-row&#34;&gt;Step 3: Turn a dict back into a row&lt;/h2&gt;&#xA;&lt;p&gt;The final step is to turn our dict back into a regular VQL &lt;strong&gt;Row&lt;/strong&gt;. This&#xA;will allow it to be viewed nicely in the GUI as a regular table. The&#xA;dict keys will turn back into column headers, and the values will be&#xA;table cells.&lt;/p&gt;&#xA;&lt;p&gt;This operation is done using the &lt;code&gt;foreach()&lt;/code&gt; plugin using it &lt;code&gt;column&lt;/code&gt; argument:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET MyFilteredRow = SELECT&#xA;    _key, FilterKeys(Dict=_value) AS _value&#xA;FROM items(item={ SELECT * FROM info() })&#xA;&#xA;SELECT * FROM foreach(row=MyFilteredRow, column=&amp;quot;_value&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To enhance readability, I converted the previous query into a stored&#xA;query by naming it &lt;code&gt;MyFilteredRow&lt;/code&gt;, then I can just use it as an&#xA;argument to the &lt;code&gt;foreach()&lt;/code&gt; plugin. The &lt;code&gt;column&lt;/code&gt; parameter tells the&#xA;&lt;code&gt;foreach()&lt;/code&gt; plugin to extract the dict found in the column &lt;code&gt;_value&lt;/code&gt;&#xA;into the row itself (with other columns ignored).&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/operating_on_columns//knowledge_base/tips/operating_on_columns/manipulating_columns.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Manipulating VQL Columns and Rows&#34;&#xA;         width=&#34;1519&#34; height=&#34;341&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;manipulating_columns.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Manipulating VQL Columns and Rows&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Detecting Velociraptor misuse</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/velocirator_misuse/</link>
      <pubDate>Thu, 28 Aug 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/velocirator_misuse/</guid>
      <description>&lt;h1 id=&#34;detecting-velociraptor-misuse&#34;&gt;Detecting Velociraptor misuse&lt;/h1&gt;&#xA;&lt;p&gt;Velociraptor is widely used by defenders for legitimate forensic and&#xA;response workflows, and, just like many other security and&#xA;administrative tools, it can also be abused when in the wrong hands.&lt;/p&gt;&#xA;&lt;p&gt;Threat actors use legitimate software to their advantage at various&#xA;stages of the attack lifecycle. In the past, we have seen many&#xA;legitimate tools that were abused by threat actors (&lt;code&gt;PsExec&lt;/code&gt;,&#xA;&lt;code&gt;AnyDesk&lt;/code&gt;, &lt;code&gt;ScreenConnect&lt;/code&gt;, etc.). Threat actors will continue to&#xA;abuse legitimate tools to facilitate their attacks.&lt;/p&gt;&#xA;&lt;p&gt;Recently, we observed that &lt;a href=&#34;https://news.sophos.com/en-us/2025/08/26/velociraptor-incident-response-tool-abused-for-remote-access/&#34; target=&#34;_blank&#34; &gt;the Velociraptor tool was one of&#xA;them&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In this instance, the threat actor downloaded the Velociraptor binary&#xA;and, in its configuration file, specified the command-and-control&#xA;server. After Velociraptor was executed on the compromised asset, it&#xA;established a communication with the C2 server. Once the communication&#xA;was established, the threat actor used Velociraptor to perform further&#xA;actions, such as downloading additional files or executing commands on&#xA;the compromised asset. While this is not a vulnerability in the tool&#xA;itself, it can be used for malicious purposes.&lt;/p&gt;&#xA;&lt;p&gt;On October 8th 2025, &lt;code&gt;Cisco Talos&lt;/code&gt; reported observations from a&#xA;threat actor abusing Velociraptor version (version 0.73.4) to&#xA;distribute ransomware.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-can-i-detect-velociraptor-misuse-in-my-environment&#34;&gt;How can I detect Velociraptor misuse in my environment?&lt;/h2&gt;&#xA;&lt;p&gt;In order to help organizations detect Velociraptor misuse,&#xA;Velociraptor deliberately creates some IOCs which are easy to detect:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;When Velociraptor starts, the binary registers a new event log&#xA;source with the name &lt;code&gt;Velociraptor&lt;/code&gt;. This will create a new key at&#xA;the location&#xA;&lt;code&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\Velociraptor&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Typically the modification time for this key is a good indicator of&#xA;the first time the Velociraptor binary was launched on the system.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Each time the binary is launched, the binary logs the command line&#xA;arguments used into the &lt;code&gt;Application&lt;/code&gt; event log with an event id of&#xA;&lt;code&gt;1000&lt;/code&gt;. For example, when run as a service, the message looks&#xA;similar to:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code&gt;Velociraptor startup ARGV: [&amp;quot;C:\\Program Files\\Velociraptor\\Velociraptor.exe&amp;quot;,&amp;quot;--config&amp;quot;,&amp;quot;C:\\Program Files\\Velociraptor\\/client.config.yaml&amp;quot;,&amp;quot;service&amp;quot;,&amp;quot;run&amp;quot;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Of course, since Velociraptor is an open source tool it is possible&#xA;for attackers to remove these indicators and rebuild the&#xA;program. However, the resulting binary will not be signed by Rapid7&#xA;and so will most likely remain an unsigned binary, thereby raising&#xA;a further indicator that may be used: Detecting any execution of&#xA;unsigned binaries in the environment. The official Rapid7 signed&#xA;binary will always leave detectable traces of execution.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Another more robust detection for a potentially malicious rebuilt&#xA;Velociraptor binary may use the following Yara rule:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code&gt;rule velociraptor_strings {&#xA;  meta:&#xA;    description = &amp;quot;Detects unique strings in Velociraptor binaries&amp;quot;&#xA;&#xA;  strings:&#xA;    $s1 = &amp;quot;www.velocidex.com/golang/velociraptor/&amp;quot; wide ascii&#xA;    $s2 = &amp;quot;proto.VelociraptorUser, error&amp;quot; wide ascii&#xA;    $s3 = &amp;quot;Welcome to the Velociraptor multi-frontend configuration generator&amp;quot; wide ascii&#xA;    $s4 = &amp;quot;Go build ID:&amp;quot; wide ascii&#xA;&#xA;  condition:&#xA;    3 of them&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;5&#34;&gt;&#xA;&lt;li&gt;The following experimental Sigma rule will detect the installation&#xA;or running of the Velociraptor binary. This could lead to false&#xA;positive alerts when you have installed Velociraptor by default or&#xA;running it for an investigation. However it will trigger an alert&#xA;when Velociraptor is not supposed to be installed into the network&#xA;and can be seen as a potential abuse of the tool.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code&gt;itle: Suspicious Velociraptor Execution or Misuse&#xA;id: 12345678-ABCD-1234-ABCD-1234567890AB&#xA;description: |&#xA;    Detect execution of Velociraptor binary with suspicious arguments or as unsigned binary,&#xA;    potentially indicating misuse or attacker-controlled instance.&#xA;status: experimental&#xA;author: Rapid7 Labs&#xA;references:&#xA;  - https://docs.velociraptor.app/knowledge_base/tips/velocirator_misuse/&#xA;tags:&#xA;  - attack.execution&#xA;  - attack.persistence&#xA;  - tool.abuse&#xA;logsource:&#xA;  product: windows&#xA;  category: process_creation&#xA;detection:&#xA;  selection_velociraptor:&#xA;    Image|endswith: &#39;\Velociraptor.exe&#39;&#xA;  selection_suspicious_args:&#xA;    CommandLine|contains:&#xA;      - &amp;quot;--config&amp;quot;&#xA;      - &amp;quot;client.config.yaml&amp;quot;&#xA;      - &amp;quot;service run&amp;quot;&#xA;  selection_unsigned:&#xA;    Signature|endswith:&#xA;      - &amp;quot;Unsigned&amp;quot;&#xA;  condition: selection_velociraptor and (selection_suspicious_args or selection_unsigned)&#xA;falsepositives:&#xA;  - Legitimate Velociraptor use by admins / security teams (especially if unsigned binary is used legitimately)&#xA;  - Test or dev environments&#xA;level: high&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;For organizations that are concerned about unauthorized deployments&#xA;and already have Velociraptor deployed, Rapid7 has published a&#xA;Velociraptor inception artifact that automates the above techniques&#xA;and can help detect unexpected instances. This can be viewed here:&#xA;&lt;a href=&#34;https://github.com/rapid7/Rapid7-Labs/blob/main/Vql/VelociraptorInception.yaml&#34; target=&#34;_blank&#34; &gt;https://github.com/rapid7/Rapid7-Labs/blob/main/Vql/VelociraptorInception.yaml&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;For organizations that do not already have Velociraptor deployed, the&#xA;above detections methods can be easily implemented using whatever&#xA;technology stack they already have deployed.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-if-i-am-already-using-velociraptor&#34;&gt;What if I am already using Velociraptor?&lt;/h2&gt;&#xA;&lt;p&gt;If Velociraptor use is already expected in your environment, misuse of&#xA;Velociraptor may blend in with legitimate use. In this case:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Forward the audit logs centrally and look for unusual sets of&#xA;command line arguments (if Velociraptor is usually installed as a&#xA;service it will always be started similar to the example above).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Check the integrity of the Velociraptor agent configuration to to&#xA;ensure that it is not tampered with.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Check the process lineage of the Velociraptor binary in your EDR to&#xA;ensure it is always started by the service control manager in the&#xA;usual way.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;</description>
    </item>
    <item>
      <title>How to set up a MinIO (S3-compatible) dropbox server for file uploads</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/dropbox_server/</link>
      <pubDate>Sat, 05 Jul 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/dropbox_server/</guid>
      <description>&lt;h1 id=&#34;how-to-set-up-a-minio-s3-compatible-dropbox-server-for-file-uploads&#34;&gt;How to set up a MinIO (S3-compatible) dropbox server for file uploads&lt;/h1&gt;&#xA;&lt;p&gt;AWS S3 buckets can be a useful upload destination for receiving files from&#xA;Velociraptor clients or collection containers from&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/&#34;&gt;offline collectors&lt;/a&gt;&#xA;in scenarios where the source system is internet connected and you do not want&#xA;to stand up storage services on the local network.&lt;/p&gt;&#xA;&lt;p&gt;This is made possible by the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/other/upload_s3/&#34;&gt;upload_s3&lt;/a&gt; VQL function.&lt;/p&gt;&#xA;&lt;p&gt;However, if you want similar functionality to AWS S3 and prefer to keep things&#xA;local, or at least fully under your own control, then&#xA;&lt;a href=&#34;https://www.min.io/&#34; target=&#34;_blank&#34; &gt;MinIO&lt;/a&gt; is a great open source, self-hosted, S3-compatible&#xA;dropbox server. It&amp;rsquo;s easy to install and works on all mainstream operating&#xA;systems. A MinIO server is a single Go binary licensed under the AGPL.&lt;/p&gt;&#xA;&lt;p&gt;Here we describe the steps to quickly set up a MinIO server.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;setup-steps&#34;&gt;Setup steps&lt;/h3&gt;&#xA;&lt;p&gt;For this example we assume the dropbox server has the IP &lt;code&gt;192.168.1.1&lt;/code&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;First download the MinIO binary from the &lt;a href=&#34;https://github.com/minio/minio?tab=readme-ov-file#binary-download&#34; target=&#34;_blank&#34; &gt;MinIO GitHub&#xA;page&lt;/a&gt;. For&#xA;example, on Linux the binary can be fetched from&#xA;&lt;a href=&#34;https://dl.min.io/server/minio/release/linux-amd64/minio&#34; target=&#34;_blank&#34; &gt;https://dl.min.io/server/minio/release/linux-amd64/minio&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Start the server using the following command:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=password ./minio server /tmp/minio --console-address &amp;quot;:9001&amp;quot; --address &amp;quot;:4566&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This will start a server with the admin password provided and store&#xA;all files in the &lt;code&gt;/tmp/minio&lt;/code&gt; directory. The web console will be&#xA;available on port &lt;code&gt;9001&lt;/code&gt; and the API port will be &lt;code&gt;4566&lt;/code&gt;. You can view the&#xA;web console for MinIO by navigating the browser to&#xA;&lt;code&gt;http://192.168.1.1:9001&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Please use a more complex password in reality, for this demonstration&#xA;we will use a weak password.&lt;/p&gt;&#xA;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;To administrate the MinIO server from the commandline we will use&#xA;the &lt;code&gt;mc&lt;/code&gt; command available from&#xA;&lt;a href=&#34;https://dl.min.io/client/mc/release/&#34; target=&#34;_blank&#34; &gt;https://dl.min.io/client/mc/release/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;wget https://dl.min.io/client/mc/release/linux-amd64/mc&#xA;chmod +x ./mc&#xA;&#xA;# Save credentials for the mc tool&#xA;./mc alias set &#39;myminio&#39; &#39;http://192.168.1.11:4566&#39; &#39;admin&#39; &#39;password&#39;&#xA;&#xA;# Create a new bucket called uploads&#xA;./mc mv myminio/uploads&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;4&#34;&gt;&#xA;&lt;li&gt;Next we need to create a new client key and secret - this a similar&#xA;process to what we need to do on the &lt;a href=&#34;https://training.velociraptor.app//modules/offline_collection/cloud_upload.html#/8&#34; target=&#34;_blank&#34; &gt;AWS S3&#xA;console&lt;/a&gt;,&#xA;but using the command line it is quicker&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;# Add a new uploader user with specific access key and secret key&#xA;./mc admin user add uploader access_key_123 secret_key_123&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;5&#34;&gt;&#xA;&lt;li&gt;Next we need to restrict the policy allowed for this user (the user&#xA;is basically identified by the access key). We create a JSON policy&#xA;with an editor and store it for example in&#xA;&lt;code&gt;/tmp/uploader.policy.json&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;{&#xA;    &amp;quot;Version&amp;quot;: &amp;quot;2012-10-17&amp;quot;,&#xA;    &amp;quot;Statement&amp;quot;: [&#xA;        {&#xA;            &amp;quot;Effect&amp;quot;: &amp;quot;Allow&amp;quot;,&#xA;            &amp;quot;Action&amp;quot;: &amp;quot;s3:PutObject&amp;quot;,&#xA;            &amp;quot;Resource&amp;quot;: &amp;quot;arn:aws:s3:::uploads/*&amp;quot;&#xA;        }&#xA;    ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;# Create the policy from the JSON file&#xA; ./mc admin policy create myminio uploader /tmp/uploader.policy.json&#xA;&#xA;# Attach the policy to the new user&#xA;./mc admin policy attach myminio --user=access_key_123 uploader&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;6&#34;&gt;&#xA;&lt;li&gt;Test the bucket and the permissions using the following VQL. Paste&#xA;the following code into a file say &lt;code&gt;/tmp/test.vql&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT&#xA;    upload_s3(accessor=&amp;quot;data&amp;quot;,&#xA;              file=&amp;quot;Hello&amp;quot;,&#xA;              name=&amp;quot;test.txt&amp;quot;,&#xA;              endpoint=&amp;quot;http://192.168.1.11:4566&amp;quot;,&#xA;              credentials_key=&amp;quot;access_key_123&amp;quot;,&#xA;              credentials_secret=&amp;quot;secret_key_123&amp;quot;,&#xA;              bucket=&amp;quot;uploads&amp;quot;)&#xA;FROM scope()&#xA;&#xA;LET S3_CREDENTIALS &amp;lt;= dict(endpoint=&#39;http://192.168.1.11:4566/&#39;,&#xA;                           credentials_key=&#39;access_key_123&#39;,&#xA;                           credentials_secret=&#39;secret_key_123&#39;,&#xA;                           no_verify_cert=1)&#xA;&#xA;SELECT *, read_file(filename=OSPath, length=10, accessor=&#39;s3&#39;) AS Data&#xA;FROM glob(globs=&#39;/uploads/*&#39;, accessor=&#39;s3&#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Run this query with Velociraptor:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;velociraptor-v0.74.4-linux-amd64 -v query -f /tmp/test.vql&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The first query uploads a test file to the bucket, we then try to read&#xA;it back out - this should be denied:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;[INFO] 2025-07-05T02:26:32Z upload_S3: Uploading test.txt to uploads&#xA;[&#xA; {&#xA;  &amp;quot;upload_s3(accessor=\&amp;quot;data\&amp;quot;, file=\&amp;quot;Hello\&amp;quot;, name=\&amp;quot;test.txt\&amp;quot;, endpoint=\&amp;quot;http://192.168.1.11:4566\&amp;quot;, credentials_key=\&amp;quot;access_key_123\&amp;quot;, credentials_secret=\&amp;quot;secret_key_123\&amp;quot;, bucket=\&amp;quot;uploads\&amp;quot;)&amp;quot;: {&#xA;   &amp;quot;Path&amp;quot;: &amp;quot;http://192.168.1.11:4566/uploads/test.txt&amp;quot;,&#xA;   &amp;quot;Size&amp;quot;: 5&#xA;  }&#xA; }&#xA;][][INFO] 2025-07-05T02:26:32Z Globber: operation error S3: ListBuckets, https response error StatusCode: 403, RequestID: 184F39DAD67D435B, HostID: f2a388c21e253e519af7cec24c2e281b7821740cf65cb6ff168ac3a3ce38718c, api error AccessDenied: Access Denied. while processing /&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can verify the file is there using the MinIO Console.&lt;/p&gt;&#xA;&lt;ol start=&#34;7&#34;&gt;&#xA;&lt;li&gt;Exporting the files. MinIO uses its internal data to store bucket&#xA;data but you can use it to copy files in raw format into another&#xA;directory. The &lt;code&gt;--watch&lt;/code&gt; flag will continuously watch the bucket to&#xA;export files in real time (omit it for one shot export).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;./mc mirror --watch myminio/uploads /tmp/backup/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
    </item>
    <item>
      <title>How to automatically post process flows with an external program.</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/post_process_with_external_program/</link>
      <pubDate>Sun, 29 Jun 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/post_process_with_external_program/</guid>
      <description>&lt;h1 id=&#34;how-to-automatically-post-process-flows-with-an-external-program&#34;&gt;How to automatically post process flows with an external program.&lt;/h1&gt;&#xA;&lt;p&gt;Sometimes we want to automatically post process a collection using an&#xA;external program - for example a Python script. This short article&#xA;will illustrate how to launch a python program automatically to post&#xA;process a collection.&lt;/p&gt;&#xA;&lt;p&gt;For our example we will write a Python program to post process the&#xA;&lt;code&gt;Generic.Client.Info&lt;/code&gt; artifact. As soon as the artifact is collected&#xA;we want to extract the &lt;code&gt;Hostname&lt;/code&gt; field from the &lt;code&gt;BasicInformation&lt;/code&gt;&#xA;source and greet the host with a welcome message.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-finding-the-result-files-in-a-flow&#34;&gt;1. Finding the result files in a flow.&lt;/h2&gt;&#xA;&lt;p&gt;Velociraptor collects artifacts in &lt;code&gt;Flows&lt;/code&gt; which are stored as a&#xA;collection of files within the VFS. You can see all the files in a&#xA;particular flow using the &lt;code&gt;enumerate_flow()&lt;/code&gt; plugin:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sql&#34;&gt;SELECT * FROM enumerate_flow(client_id=ClientId, flow_id=FlowId)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/post_process_with_external_program//knowledge_base/tips/post_process_with_external_program/enumerate_flow.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Enumerating Flow Files&#34;&#xA;         width=&#34;1355&#34; height=&#34;503&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;enumerate_flow.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Enumerating Flow Files&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;You will notice that each file has a &lt;code&gt;Type&lt;/code&gt; field and the path to the&#xA;file is given using the file store path. This allows the file to be&#xA;opened using the &lt;code&gt;fs&lt;/code&gt; accessor in VQL.&lt;/p&gt;&#xA;&lt;p&gt;However to receive the full file on disk, the &lt;code&gt;file_store()&lt;/code&gt; function&#xA;can be used.&lt;/p&gt;&#xA;&lt;p&gt;When collecting an artifact, each source query in the artifact is&#xA;stored in a single file on disk. In our case we want to know the file&#xA;that contains the &lt;code&gt;BasicInformation&lt;/code&gt; source:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sql&#34;&gt;SELECT file_store(path=Data.VFSPath) AS Path&#xA;FROM enumerate_flow(client_id=ClientId, flow_id=FlowId)&#xA;WHERE Type = &amp;quot;Result&amp;quot; AND Path =~ &amp;quot;BasicInformation&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;2-launching-the-python-program&#34;&gt;2. Launching the Python program&lt;/h2&gt;&#xA;&lt;p&gt;Now that we can find the path to the correct file, we need to launch&#xA;an external program to receive this path.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s encapsulate the logic in a VQL function:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sql&#34;&gt;LET _GetPath(ClientId, FlowId) =&#xA;  SELECT file_store(path=Data.VFSPath) AS Path&#xA;  FROM enumerate_flow(client_id=ClientId, flow_id=FlowId)&#xA;  WHERE Type = &amp;quot;Result&amp;quot; AND Path =~ &amp;quot;BasicInformation&amp;quot;&#xA;&#xA;LET GetPath(ClientId, FlowId) = _GetPath(ClientId=ClientId, FlowId=FlowId)[0].Path&#xA;&#xA;SELECT *&#xA;FROM execve(argv=[&amp;quot;python.exe&amp;quot;, &amp;quot;C:/MyScript.py&amp;quot;, GetPath(ClientId=ClientId, FlowId=FlowId)])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This query will extract the path to the &lt;code&gt;BasicInformation&lt;/code&gt; source and&#xA;launch my python script, while passing it the path to the result set.&lt;/p&gt;&#xA;&lt;p&gt;While working in a notebook I can iterate on developing my python&#xA;script by recalculating the cell all the time.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/post_process_with_external_program//knowledge_base/tips/post_process_with_external_program/iterating_dev.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Iterating development of the python script&#34;&#xA;         width=&#34;1388&#34; height=&#34;766&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;iterating_dev.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Iterating development of the python script&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;My goal is to write a python script which reads the result set from&#xA;disk (which is just a line separated &lt;code&gt;JSON&lt;/code&gt; file), then extracts the&#xA;&lt;code&gt;Hostname&lt;/code&gt; column. Finally the python program will emit a &lt;code&gt;JSON&lt;/code&gt;&#xA;object per line into &lt;code&gt;Stdout&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;import sys&#xA;import json&#xA;&#xA;if __name__ == &amp;quot;__main__&amp;quot;:&#xA;    PathName = sys.argv[1]&#xA;    with open(PathName, mode=&amp;quot;r&amp;quot;) as fd:&#xA;        for line in fd.readlines():&#xA;            try:&#xA;                data = json.loads(line)&#xA;                response = dict(Greeting = &amp;quot;Hello &amp;quot; + data[&amp;quot;Hostname&amp;quot;])&#xA;                print(json.dumps(response))&#xA;            except Exception as e:&#xA;                print(&amp;quot;Exception %s&amp;quot; % e)&#xA;                continue&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now that I have a python program which generates a JSON object per&#xA;line, I can expand the JSON object into a row using the &lt;code&gt;foreach()&lt;/code&gt;&#xA;plugin:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sql&#34;&gt;LET _GetPath(ClientId, FlowId) =&#xA;  SELECT file_store(path=Data.VFSPath) AS Path&#xA;  FROM enumerate_flow(client_id=ClientId, flow_id=FlowId)&#xA;  WHERE Type = &amp;quot;Result&amp;quot; AND Path =~ &amp;quot;BasicInformation&amp;quot;&#xA;&#xA;LET GetPath(ClientId, FlowId) = _GetPath(ClientId=ClientId, FlowId=FlowId)[0].Path&#xA;&#xA;SELECT *&#xA;FROM foreach(row={&#xA;    SELECT parse_json(data=Stdout) AS Row&#xA;    FROM execve(argv=[&amp;quot;python.exe&amp;quot;, &amp;quot;C:/MyScript.py&amp;quot;,&#xA;                  GetPath(ClientId=ClientId, FlowId=FlowId)])&#xA;  },&#xA;  column=&amp;quot;Row&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;3-automating-post-processing&#34;&gt;3. Automating post processing.&lt;/h2&gt;&#xA;&lt;p&gt;So far I was working in a notebook, but now I want to write the&#xA;artifact that will trigger it automatically. I want the server itself&#xA;to monitor when a new &lt;code&gt;Generic.Client.Info&lt;/code&gt; collection is made and&#xA;automatically post process it - So I need a &lt;code&gt;Server Event Monitor&lt;/code&gt;&#xA;artifact.&lt;/p&gt;&#xA;&lt;p&gt;When a collection is complete, the server emits a&#xA;&lt;code&gt;System.Flow.Completion&lt;/code&gt; event, which I can watch using&#xA;&lt;code&gt;watch_monitoring()&lt;/code&gt;. I can then filter collection by the artifacts&#xA;they found to obtain the &lt;code&gt;ClientId&lt;/code&gt; and &lt;code&gt;FlowId&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Putting it all together:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sql&#34;&gt;LET Completions = SELECT FlowId, ClientId&#xA;   FROM watch_monitoring(artifact=&#39;System.Flow.Completion&#39;)&#xA;   WHERE Flow.artifacts_with_results =~ &amp;quot;Generic.Client.Info/BasicInformation&amp;quot;&#xA;&#xA;LET PostProcess(ClientId, FlowId) = SELECT *&#xA;   FROM foreach(row={&#xA;      SELECT parse_json(data=Stdout) AS Row&#xA;      FROM execve(argv=[&amp;quot;python.exe&amp;quot;, &amp;quot;C:/MyScript.py&amp;quot;,&#xA;                  GetPath(ClientId=ClientId, FlowId=FlowId)])&#xA;    },&#xA;    column=&amp;quot;Row&amp;quot;)&#xA;&#xA;LET _GetPath(ClientId, FlowId) =&#xA;  SELECT file_store(path=Data.VFSPath) AS Path&#xA;  FROM enumerate_flow(client_id=ClientId, flow_id=FlowId)&#xA;  WHERE Type = &amp;quot;Result&amp;quot; AND Path =~ &amp;quot;BasicInformation&amp;quot;&#xA;&#xA;LET GetPath(ClientId, FlowId) = _GetPath(ClientId=ClientId, FlowId=FlowId)[0].Path&#xA;&#xA;SELECT * FROM foreach(row=Completions, query={&#xA;  SELECT * FROM PostProcess(ClientId=ClientId, FlowId=FlowId)&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I can test this in a notebook and see it works!&lt;/p&gt;&#xA;&lt;h2 id=&#34;4-convert-to-an-artifact-and-install&#34;&gt;4. Convert to an artifact and install&lt;/h2&gt;&#xA;&lt;p&gt;My Final artifact looks like this&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: Custom.BasicInformation.EnrichPython&#xA;type: SERVER_EVENT&#xA;sources:&#xA;  - query: |&#xA;        LET Completions = SELECT FlowId,&#xA;                                 ClientId&#xA;          FROM watch_monitoring(artifact=&#39;System.Flow.Completion&#39;)&#xA;          WHERE Flow.artifacts_with_results =~ &amp;quot;Generic.Client.Info/BasicInformation&amp;quot;&#xA;&#xA;        LET PostProcess(ClientId, FlowId) = SELECT *&#xA;          FROM foreach(row={&#xA;            SELECT parse_json(data=Stdout) AS Row&#xA;            FROM execve(argv=[&amp;quot;python.exe&amp;quot;, &amp;quot;C:/MyScript.py&amp;quot;,&#xA;                          GetPath(ClientId=ClientId, FlowId=FlowId)])&#xA;          },&#xA;                       column=&amp;quot;Row&amp;quot;)&#xA;&#xA;        LET _GetPath(ClientId, FlowId) = SELECT file_store(path=Data.VFSPath) AS Path&#xA;          FROM enumerate_flow(client_id=ClientId, flow_id=FlowId)&#xA;          WHERE Type = &amp;quot;Result&amp;quot;&#xA;           AND Path =~ &amp;quot;BasicInformation&amp;quot;&#xA;&#xA;        LET GetPath(ClientId, FlowId) = _GetPath(ClientId=ClientId, FlowId=FlowId)[0].Path&#xA;&#xA;        SELECT *&#xA;        FROM foreach(row=Completions,&#xA;                     query={&#xA;            SELECT *&#xA;            FROM PostProcess(ClientId=ClientId, FlowId=FlowId)&#xA;          })&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I can add it and install it as a server event monitor. Then each time I&#xA;collect &lt;code&gt;Generic.Client.Info&lt;/code&gt; the artifact will automatically post&#xA;process the results.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/post_process_with_external_program//knowledge_base/tips/post_process_with_external_program/server_event_artifact.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Post processing the collections with Python!&#34;&#xA;         width=&#34;1447&#34; height=&#34;381&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;server_event_artifact.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Post processing the collections with Python!&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;This quick example shows how to automatically post process collections&#xA;with external programs. You need to be able to shell out to the&#xA;external program which will run on the server. We used Python in this&#xA;example just for illustration purposes but you can use any language to&#xA;write the external program.&lt;/p&gt;&#xA;&lt;p&gt;You can also use &lt;code&gt;watch_monitoring()&lt;/code&gt; with the name of the new&#xA;artifact to watch for post processed results as well! &amp;hellip; &lt;code&gt;We need to go deeper!&lt;/code&gt; - for example use &lt;code&gt;Elastic.Events.Upload&lt;/code&gt; to upload those&#xA;to Elastic.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I configure Cloudflare Dynamic DNS?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/cloudflare_checkip/</link>
      <pubDate>Wed, 18 Jun 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/cloudflare_checkip/</guid>
      <description>&lt;h1 id=&#34;how-do-i-configure-cloudflare-dynamic-dns&#34;&gt;How do I configure Cloudflare Dynamic DNS?&lt;/h1&gt;&#xA;&lt;p&gt;Setting up Cloudflare as your preferred dynamic DNS provider requires&#xA;the following steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Sign into Cloudflare and buy a domain name.&lt;/li&gt;&#xA;&lt;li&gt;go to &lt;a href=&#34;https://dash.cloudflare.com/profile/api-tokens&#34; target=&#34;_blank&#34; &gt;https://dash.cloudflare.com/profile/api-tokens&lt;/a&gt; to generate an&#xA;API token. Select &lt;code&gt;Edit Zone DNS&lt;/code&gt; in the API Token templates.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/cloudflare_checkip//knowledge_base/tips/cloudflare_checkip/cloudflare_1.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1226&#34; height=&#34;441&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;cloudflare_1.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/cloudflare_checkip//knowledge_base/tips/cloudflare_checkip/cloudflare_2.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;836&#34; height=&#34;394&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;cloudflare_2.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;You will require the &amp;ldquo;Edit&amp;rdquo; permission on Zone DNS and include the&#xA;specific zone name you want to manage. The zone name is the domain you&#xA;purchased for example &amp;ldquo;example.com&amp;rdquo;. You will be able to set the&#xA;hostname under that domain, e.g. &amp;ldquo;velociraptor.example.com&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/cloudflare_checkip//knowledge_base/tips/cloudflare_checkip/cloudflare_3.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1078&#34; height=&#34;511&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;cloudflare_3.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Using this information you can now create the dyndns configuration:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;Frontend:&#xA;  ....&#xA;  dyn_dns:&#xA;    type: cloudflare&#xA;    api_token: XXXYYYZZZ&#xA;    zone_name: example.com&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Make sure the Frontend.Hostname field is set to the correct hostname&#xA;to update - for example&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;Frontend:&#xA;  hostname: velociraptor.example.com&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This is the hostname that will be updated.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I setup Velociraptor with a CloudFlare Tunnel?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/cloudflare_tunnel/</link>
      <pubDate>Mon, 19 May 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/cloudflare_tunnel/</guid>
      <description>&lt;h1 id=&#34;how-do-i-setup-velociraptor-with-a-cloudflare-tunnel&#34;&gt;How do I setup Velociraptor with a CloudFlare Tunnel?&lt;/h1&gt;&#xA;&lt;p&gt;For this tutorial I have built Velociraptor on an Ubuntu 20.04 machine.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1&#34;&gt;Step 1&lt;/h2&gt;&#xA;&lt;p&gt;Once you have Velociraptor installed, the first thing to do is to Generate a config file:&#xA;&lt;code&gt;velociraptor config generate -i&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/cloudflare_tunnel//knowledge_base/tips/cloudflare_tunnel/screenshot-12-05-2025-at-18-42-06.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Generating configuration&#34;&#xA;         width=&#34;1280&#34; height=&#34;441&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;screenshot-12-05-2025-at-18-42-06.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Generating configuration&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-2&#34;&gt;Step 2&lt;/h2&gt;&#xA;&lt;p&gt;Follow the following steps:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Deployment Type&lt;/strong&gt;: Self Signed SSL&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;What OS will the server be deployed on&lt;/strong&gt;: Linux&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Path to Datastore&lt;/strong&gt;: /var/tmp/velociraptor&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Path to the logs directory&lt;/strong&gt;: /var/log/velociraptor&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Internal PKI Certificate&lt;/strong&gt;: 2 Years&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Do you want to restrict VQL functionality on the server?&lt;/strong&gt;: No&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Use registry for client writeback?&lt;/strong&gt;: No&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;What is the public DNS name of the Master Frontend&lt;/strong&gt;: domain.com&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;DNS Type&lt;/strong&gt;: None : Configure DNS Manually&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Would you like to try the new experimental websocket comms?&lt;/strong&gt;: No&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Enter the frontend port to listen on.&lt;/strong&gt;: 443&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Enter the port for the GUI to listen on.&lt;/strong&gt;: 443&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Overwrite File&lt;/strong&gt;: /etc/velociraptor/server.config.yaml&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;step-3&#34;&gt;Step 3&lt;/h2&gt;&#xA;&lt;p&gt;Replace all the localhost IPs to listen on all interfaces (0.0.0.0)&#xA;&lt;code&gt;sed -e &#39;/bind_address:/{s/127.0.0.1/0.0.0.0/}&#39; -i /etc/velociraptor/server.config.yaml&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-4&#34;&gt;Step 4&lt;/h2&gt;&#xA;&lt;p&gt;As CloudFlare is handling the certificate you need to disable the self signed certificate in the yaml file&#xA;&lt;code&gt;nano /etc/velociraptor/server.config.yaml&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/cloudflare_tunnel//knowledge_base/tips/cloudflare_tunnel/SSL.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Remove the option for using self signed SSL&#34;&#xA;         width=&#34;1174&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;SSL.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Remove the option for using self signed SSL&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h1 id=&#34;step-5&#34;&gt;Step 5&lt;/h1&gt;&#xA;&lt;p&gt;In the CloudFlare Dashboard make a new public hostname pointing to your internal IP address.&#xA;The setting is under Zero Trust &amp;gt; Networks &amp;gt; Tunnels &amp;gt; &lt;em&gt;Your Tunnel Name&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/cloudflare_tunnel//knowledge_base/tips/cloudflare_tunnel/screenshot-12-05-2025-at-20-15-21.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Remove TLS Verification from CloudFlare&#34;&#xA;         width=&#34;1280&#34; height=&#34;737&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;screenshot-12-05-2025-at-20-15-21.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Remove TLS Verification from CloudFlare&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h1 id=&#34;step-6&#34;&gt;Step 6&lt;/h1&gt;&#xA;&lt;p&gt;Start your Velociraptor&#xA;&lt;code&gt;velociraptor -c  /etc/velociraptor/server.config.yaml frontend -v&lt;/code&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to set up authentication using Google OAuth SSO</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/setup_google_oauth/</link>
      <pubDate>Mon, 28 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/setup_google_oauth/</guid>
      <description>&lt;h1 id=&#34;how-to-set-up-authentication-using-google-oauth-sso&#34;&gt;How to set up authentication using Google OAuth SSO&lt;/h1&gt;&#xA;&lt;p&gt;This guide walks you through the configuration of Google OAuth SSO as an&#xA;authentication provider. This requires a user to authenticate via Google&#xA;Workspace using it&amp;rsquo;s associated authentication policy. For example if 2-factor&#xA;authentication is required then users will need to satisfy this requirement.&lt;/p&gt;&#xA;&lt;p&gt;Once the user authenticates to Google, they are redirected back into the&#xA;Velociraptor application with a token that allows the application to request&#xA;information about the user (for example, the username or email address).&lt;/p&gt;&#xA;&lt;h2 id=&#34;before-you-begin&#34;&gt;Before You Begin&lt;/h2&gt;&#xA;&lt;p&gt;Please note the following requirements:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Your Velociraptor server must have a valid SSL certificate already issued and&#xA;configured. This can be a certificate issued by Let&amp;rsquo;s Encrypt or&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/ssl/&#34;&gt;another public CA&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Google restricts OAuth 2.0 applications to using Authorized Domains. According&#xA;to Google:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;To use a domain as an authorized domain for OAuth, it must be a &amp;ldquo;top private&#xA;domain&amp;rdquo;, which is the domain component available for registration on a&#xA;public suffix, such as the domain before the .com, .net, or .biz, or similar&#xA;top-level domains. Subdomains are controlled by the parent domain and are&#xA;not considered top private domains.&lt;/p&gt;&#xA;&lt;p&gt;For example, if your application home page is&#xA;&lt;a href=&#34;https://sub.example.com/product&#34; target=&#34;_blank&#34; &gt;https://sub.example.com/product&lt;/a&gt;, you would need to verify ownership of the&#xA;example.com domain. This verification is necessary to ensure the security and&#xA;trustworthiness of the application.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;registering-velociraptor-as-an-oauth-application&#34;&gt;Registering Velociraptor as an OAuth application&lt;/h3&gt;&#xA;&lt;p&gt;Before using Google to authenticate, you need to register your Velociraptor&#xA;deployment as an OAuth App with Google. You register Velociraptor as an OAuth&#xA;app by accessing the Google cloud console at &lt;a href=&#34;https://console.cloud.google.com&#34; target=&#34;_blank&#34; &gt;https://console.cloud.google.com&lt;/a&gt;.&#xA;You must set up a cloud account and create a cloud project even if you do not&#xA;host your server on Google&amp;rsquo;s Cloud Platform.&lt;/p&gt;&#xA;&lt;p&gt;The ultimate goal of this step is to obtain OAuth credentials that will be used&#xA;in the Velociraptor configuration, but there are a few things set up first.&lt;/p&gt;&#xA;&lt;p&gt;Navigate to &lt;code&gt;APIs and Services&lt;/code&gt; in the GCP console and select &lt;code&gt;Credentials&lt;/code&gt; and&#xA;the &lt;code&gt;OAuth Consent Screen&lt;/code&gt; tab.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_google_oauth//knowledge_base/tips/setup_google_oauth/sso11.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Creating application credentials&#34;&#xA;         width=&#34;740&#34; height=&#34;615&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;sso11.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Creating application credentials&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Further down the page you need to provide an authorized domain.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_google_oauth//knowledge_base/tips/setup_google_oauth/sso12.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Authorizing domains&#34;&#xA;         width=&#34;603&#34; height=&#34;210&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;sso12.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Authorizing domains&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;In order to add an Authorized Domain you need to &lt;em&gt;verify it&lt;/em&gt;. Google&amp;rsquo;s help pages&#xA;&lt;a href=&#34;https://developers.google.com/identity/protocols/oauth2/production-readiness/brand-verification#authorized-domains&#34; target=&#34;_blank&#34; &gt;explain it further&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In this example we assume that you purchased your domain with Google&#xA;domains which makes this step easier since it is already verified.&lt;/p&gt;&#xA;&lt;p&gt;We can go back to the cloud console and &lt;code&gt;Create Credentials&lt;/code&gt; &amp;gt; &lt;code&gt;OAuth client ID&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_google_oauth//knowledge_base/tips/setup_google_oauth/sso15.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Creating OAuth2 client ID&#34;&#xA;         width=&#34;466&#34; height=&#34;352&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;sso15.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Creating OAuth2 client ID&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Now select &lt;code&gt;Web App&lt;/code&gt; and set the &lt;code&gt;Authorized redirect URIs&lt;/code&gt; to&#xA;&lt;code&gt;https://&amp;lt;Your Domain Name&amp;gt;/auth/google/callback&lt;/code&gt; -&#xA;This is the URL that successful OAuth authentication will redirect&#xA;to. Velociraptor accepts this redirect and uses it to log the user on.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_google_oauth//knowledge_base/tips/setup_google_oauth/sso16.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Specifying the redirect URL&#34;&#xA;         width=&#34;637&#34; height=&#34;727&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;sso16.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Specifying the redirect URL&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;If all goes well the Google Cloud Console will give us a client ID and&#xA;a client secret.&lt;/p&gt;&#xA;&lt;h3 id=&#34;generating-configuration&#34;&gt;Generating configuration&lt;/h3&gt;&#xA;&lt;p&gt;To generate a server config file run the &lt;code&gt;config generate&lt;/code&gt; command to invoke the&#xA;configuration wizard:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;velociraptor config generate -i&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_google_oauth//knowledge_base/tips/setup_google_oauth/config1.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Select SSO deployment type&#34;&#xA;         width=&#34;900&#34; height=&#34;600&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;config1.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Select SSO deployment type&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_google_oauth//knowledge_base/tips/setup_google_oauth/config2.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Select Google as authentication provider&#34;&#xA;         width=&#34;900&#34; height=&#34;400&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;config2.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Select Google as authentication provider&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_google_oauth//knowledge_base/tips/setup_google_oauth/config3.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Enter OAuth credentials&#34;&#xA;         width=&#34;700&#34; height=&#34;350&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;config3.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Enter OAuth credentials&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The configuration wizard asks a number of questions and creates a&#xA;server configuration file. The first question is &amp;ldquo;Deployment Type&amp;rdquo; and you&#xA;should choose the option &lt;strong&gt;Authenticate users with SSO&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In addition to other common configuration questions the&#xA;following are relevant to configuring SSO:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;What is the public DNS name of the Master Frontend&lt;/strong&gt;: This should match the&#xA;CN field of your valid SSL certificate.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Select the SSO Authentication Provider&lt;/strong&gt;: Here you should choose the option &amp;ldquo;Google&amp;rdquo;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Enter the OAuth Client ID&lt;/strong&gt;: the name as specified in Google Cloud Console.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Enter the OAuth Client Secret&lt;/strong&gt;: as specified in Google Cloud Console.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;GUI Username or email address to authorize:&lt;/strong&gt; The initial set of&#xA;administrator accounts can be stored in the configuration file. When&#xA;Velociraptor starts it will automatically add these accounts as&#xA;administrators. When using SSO, Velociraptor does not use any passwords so&#xA;only the user names will be requested. While accounts can be specified here it&#xA;is optional as they can also be created later, as we&amp;rsquo;ll show below. Entering a&#xA;blank value will cause the wizard to move on to the next question.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;grant-access-to-velociraptor&#34;&gt;Grant Access to Velociraptor&lt;/h2&gt;&#xA;&lt;p&gt;The OAuth flow ensures the user&amp;rsquo;s identity is correct but does not give them&#xA;permission to log into Velociraptor. Note that having an OAuth-enabled&#xA;application on the web allows anyone with a Google identity to authenticate to&#xA;the application but the user is still required to be authorized explicitly. If a&#xA;user is rejected, you will see messages similar to the following in the Audit&#xA;log:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;   {&#xA;     &amp;quot;level&amp;quot;: &amp;quot;error&amp;quot;,&#xA;     &amp;quot;method&amp;quot;: &amp;quot;GET&amp;quot;,&#xA;     &amp;quot;msg&amp;quot;: &amp;quot;User rejected by GUI&amp;quot;,&#xA;     &amp;quot;remote&amp;quot;: &amp;quot;192.168.0.10:40570&amp;quot;,&#xA;     &amp;quot;time&amp;quot;: &amp;quot;2018-12-21T18:17:47+10:00&amp;quot;,&#xA;     &amp;quot;user&amp;quot;: &amp;quot;mike@velocidex.com&amp;quot;&#xA;   }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In order to authorize the user we must explicitly add them using the&#xA;Velociraptor Admin tool:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;$ velociraptor --config ~/server.config.yaml user add mike@velocidex.com&#xA;Authentication will occur via Google - therefore no password needs to be set.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note that Velociraptor does not ask for a password, since authentication will&#xA;occur using Google&amp;rsquo;s SSO.&lt;/p&gt;&#xA;&lt;h2 id=&#34;authenticate-and-access-the-velociraptor-gui&#34;&gt;Authenticate and access the Velociraptor GUI&lt;/h2&gt;&#xA;&lt;p&gt;Since you have added users from the command line you will need to restart the&#xA;Velociraptor service:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;sudo systemctl restart velociraptor_server&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then access the GUI. If your web browser is already logged into Google then the&#xA;authentication process should be transparent. If not then you will be directed&#xA;to Google to authenticate and you will then be redirected back to the&#xA;Velociraptor GUI after successful logon.&lt;/p&gt;&#xA;&lt;p&gt;We can see that the logged in user is authenticated by Google, and we&#xA;can also see the user&amp;rsquo;s Google avatar at the top right.&lt;/p&gt;&#xA;&lt;!-- ![Velociraptor Dashboard](dashboard.png) --&gt;&#xA;&#xA;&lt;div class=&#34;mynotices note&#34;&gt;&#xA;  &lt;div heading=&#34;note&#34;&gt;&lt;p&gt;Velociraptor will retain its OAuth token for 24 hours. Each day users&#xA;will need to re-grant OAuth credentials. Therefore revoking a user&#xA;from the Google Admin console may take a full day to take effect. To&#xA;remove access sooner you should simply remove all permissions from the&#xA;user using &lt;code&gt;velociraptor user grant &#39;{}&#39;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;</description>
    </item>
    <item>
      <title>How to set up a SFTP server for file uploads</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/setting_up_sftp/</link>
      <pubDate>Tue, 25 Feb 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/setting_up_sftp/</guid>
      <description>&lt;h1 id=&#34;how-to-set-up-a-sftp-server-for-file-uploads&#34;&gt;How to set up a SFTP server for file uploads&lt;/h1&gt;&#xA;&lt;p&gt;There are many options for receiving file uploads from clients or collection&#xA;archives from&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/&#34;&gt;offline collectors&lt;/a&gt;,&#xA;for example&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/dropbox_server/&#34;&gt;using S3 buckets&lt;/a&gt;,&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_azure_storage/&#34;&gt;Azure storage services&lt;/a&gt;,&#xA;and even the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/blog/2021/2021-12-11-sftp-in-aws/&#34;&gt;AWS SFTP transfer service&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;However you might prefer to set up your own SFTP server to receive incoming&#xA;uploads instead of using a cloud storage service.&lt;/p&gt;&#xA;&lt;p&gt;This article explains how to set up a SFTP server with appropriate security for&#xA;automated remote file uploads.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices warning&#34;&gt;&#xA;  &lt;div heading=&#34;warning&#34;&gt;&lt;p&gt;Setting up SSH and SFTP can be tricky for novice Linux users. It is easy to&#xA;misconfigure things in ways that can leave a server open to exploitation.&lt;/p&gt;&#xA;&lt;p&gt;Unless you have a strong reason to prefer using SFTP we recommend that you&#xA;consider more self-contained alternative options such as the one described in&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/dropbox_server/&#34;&gt;How to set up a self-hosted S3-compatible dropbox server&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;setup-steps&#34;&gt;Setup steps&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Create a new Linux based VM and open port 22 for incoming&#xA;requests. This can be in the cloud or on prem.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Create an &lt;code&gt;sftpupload&lt;/code&gt; user&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo adduser sftpupload&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;Create a directory for files to be uploaded and set the directory&#xA;to be writable by the user.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code&gt;mkdir -p /var/sftp/files&#xA;chown root:root /var/sftp/files&#xA;&#xA;# Allow anyone to write there&#xA;chmod o+wx /var/sftp/files&#xA;&#xA;# No directory listing possible&#xA;chmod o-r /var/sftp/files&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;4&#34;&gt;&#xA;&lt;li&gt;Add the following in the file &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;PasswordAuthentication no&#xA;&#xA;Match User sftpupload&#xA;    ForceCommand internal-sftp&#xA;    PasswordAuthentication no&#xA;    ChrootDirectory /var/sftp&#xA;    PermitTunnel no&#xA;    AllowAgentForwarding no&#xA;    AllowTcpForwarding no&#xA;    X11Forwarding no&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and then restart the &lt;code&gt;sshd&lt;/code&gt; service:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;$ sudo systemctl restarts sshd&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;5&#34;&gt;&#xA;&lt;li&gt;Create keys for the &lt;code&gt;sftpupload&lt;/code&gt; user&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;sudo -u sftpupload bash&#xA;$ ssh-keygen&#xA;Generating public/private rsa key pair.&#xA;Enter file in which to save the key (/home/sftpuser/.ssh/id_rsa)&#xA;&#xA;# Authorize the user&#39;s public key for access&#xA;$ cat ~/.ssh/id_rsa.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys&#xA;&#xA;# Make sure that secure permissions are applied for the directory&#xA;$ chmod -v 600 /home/sftpupload/.ssh/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;6&#34;&gt;&#xA;&lt;li&gt;Verify you can connect to the server and upload files. Listing files will be&#xA;denied.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;$ sftp localhost&#xA;&#xA;sftp&amp;gt; put /etc/passwd /files/passwd.txt&#xA;Uploading /etc/passwd to /files/passwd.txt&#xA;&#xA;sftp&amp;gt; ls -l files&#xA;remote readdir(&amp;quot;/files/&amp;quot;): Permission denied&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As you can see the &lt;code&gt;sftpupload&lt;/code&gt; user does not have permission to read&#xA;the directory but can upload files to it.&lt;/p&gt;&#xA;&lt;p&gt;If we try shell access via SSH it will correctly be denied:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;$ ssh localhost&#xA;This service allows sftp connections only.&#xA;Connection to localhost closed.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;offline-collector-configuration&#34;&gt;Offline Collector configuration&lt;/h3&gt;&#xA;&lt;p&gt;In the offline collector configuration you should use the private key&#xA;(&lt;code&gt;/home/sftpupload/.ssh/id_rsa&lt;/code&gt;) of the form:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;-----BEGIN OPENSSH PRIVATE KEY-----&#xA;.....&#xA;-----END OPENSSH PRIVATE KEY-----&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and for the &lt;code&gt;Endpoint&lt;/code&gt; field, specify the value in the form&#xA;&lt;code&gt;&amp;lt;hostname or IP&amp;gt;:&amp;lt;ssh port&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How can I automatically add &amp; update client metadata?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata/</link>
      <pubDate>Thu, 30 Jan 2025 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata/</guid>
      <description>&lt;h1 id=&#34;how-can-i-automatically-add--update-client-metadata&#34;&gt;How can I automatically add &amp;amp; update client metadata?&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/clients/metadata/&#34;&gt;Client metadata&lt;/a&gt; is used to store custom&#xA;information associated with each client. Velociraptor always stores basic&#xA;information about all clients but you may want to store additional information,&#xA;for example asset information. Client metadata makes this possible by allowing&#xA;you to store any kind of data and associate it with a client. Client metadata&#xA;can also be used to search for and filter clients in the GUI and in VQL queries,&#xA;as we will demonstrate below.&lt;/p&gt;&#xA;&lt;p&gt;Metadata can be manually added and updated for any client in the client&amp;rsquo;s&#xA;Overview page, but also via VQL using the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/server/client_set_metadata/&#34;&gt;client_set_metadata&lt;/a&gt;&#xA;function.&lt;/p&gt;&#xA;&lt;p&gt;We can automate the addition and updating of client metadata by running a&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/server_automation/server_monitoring/&#34;&gt;Server Event Artifact&lt;/a&gt;&#xA;which sets metadata based on results of queries run on the client.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices note&#34;&gt;&#xA;  &lt;div heading=&#34; Metadata or Labels? &#34;&gt;&lt;p&gt;Metadata is a set of fields associated with each client. Labels can also be&#xA;regarded as information associated with a client, but in Velociraptor labels are&#xA;a more transient kind of information and are designed to be added and removed&#xA;relatively frequently. Labels provide a way to group clients whereas Metadata&#xA;provides a way to store information &lt;em&gt;about&lt;/em&gt; each client.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s important that you choose the appropriate one for your use case. This&#xA;article is about automating Metadata but if you want to do similar automation of&#xA;Labels then you may find this article more useful:&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_labels/&#34;&gt;How can I automatically apply labels to clients?&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;addingupdating-metadata-during-client-interrogation&#34;&gt;Adding/updating metadata during client interrogation&lt;/h2&gt;&#xA;&lt;p&gt;When a client connects for the first time in a Velociraptor deployment, the&#xA;server instructs the client to enroll and also tells it to run the&#xA;&lt;code&gt;Generic.Client.Info&lt;/code&gt; artifact. This built-in artifact is designed to collect&#xA;basic information about the endpoint. We refer to this process as&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/clients/interrogation/&#34;&gt;&amp;ldquo;interrogation&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;As explained&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/clients/interrogation/&#34;&gt;here&lt;/a&gt;,&#xA;the default interrogation artifact can be overridden with a custom version. If&#xA;such a custom artifact is present on the Velociraptor server then all clients&#xA;will use it.&lt;/p&gt;&#xA;&lt;p&gt;In this example we will use a custom interrogation artifact to collect custom&#xA;information and then use a&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/server_automation/server_monitoring/&#34;&gt;Server Event&lt;/a&gt; artifact&#xA;to watch for any new collections of &lt;code&gt;Custom.Generic.Client.Info&lt;/code&gt; and add or update&#xA;metadata fields based on the results.&lt;/p&gt;&#xA;&lt;p&gt;The interrogation flow can also be run manually by clicking the &lt;strong&gt;Interrogate&lt;/strong&gt;&#xA;button on the client Overview page, or by creating a hunt for the&#xA;&lt;code&gt;Generic.Client.Info&lt;/code&gt; artifact. Such a hunt can further be created on a&#xA;scheduled basis as demonstrated by the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/artifact_references/pages/server.monitoring.schedulehunt/&#34;&gt;Server.Monitoring.ScheduleHunt&lt;/a&gt;&#xA;artifact.&lt;/p&gt;&#xA;&lt;p&gt;Before we set up the event monitoring we first need to:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;prepare our custom interrogation artifact (including subordinate artifacts),&#xA;and&lt;/li&gt;&#xA;&lt;li&gt;configure metadata indexing on the server.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;add-custom-interrogation-artifacts&#34;&gt;Add custom interrogation artifacts&lt;/h3&gt;&#xA;&lt;p&gt;We are going to have our custom interrogation artifact&#xA;(&lt;code&gt;Custom.Generic.Client.Info&lt;/code&gt;) call 2 other artifacts which will each collect the&#xA;particular results we are interested in having as metadata.&lt;/p&gt;&#xA;&lt;h4 id=&#34;add-an-artifact-to-collect-some-bios-info&#34;&gt;Add an artifact to collect some BIOS info&lt;/h4&gt;&#xA;&lt;p&gt;The first artifact will query the endpoint for some BIOS information which may&#xA;be useful for asset management. On Windows it will use WMI and on Linux it will&#xA;use the &lt;code&gt;dmidecode&lt;/code&gt; program which is available by default on most modern Linux&#xA;systems. These methods both return equivalent data.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: Generic.Client.BiosInfo&#xA;description: |&#xA;  Extracts some key fields from the BIOS which may be useful for system&#xA;  inventory purposes. For demonstration purposes only. Currently does not cover macOS.&#xA;&#xA;type: CLIENT&#xA;&#xA;sources:&#xA;  - precondition: SELECT * From info() where OS = &#39;windows&#39;&#xA;    query: |&#xA;      -- On Windows we use WMI&#xA;      SELECT Manufacturer AS BaseBoardManufacturer,&#xA;             Product AS BaseBoardProduct,&#xA;             Version AS BaseBoardVersion,&#xA;             SerialNumber AS BaseBoardSerialNumber&#xA;      FROM wmi(query=&amp;quot;SELECT * FROM Win32_baseboard&amp;quot;)&#xA;&#xA;  - precondition: SELECT * From info() where OS = &#39;linux&#39; AND IsAdmin&#xA;    query: |&#xA;      -- on Linux we use dmidecode&#xA;      LET info = SELECT * FROM chain(&#xA;      a={SELECT regex_replace(source=Stdout,re=&amp;quot;([^[:graph:]])&amp;quot;,replace=&amp;quot;&amp;quot;) AS BaseBoardManufacturer&#xA;         FROM execve(argv=[&amp;quot;dmidecode&amp;quot;, &amp;quot;-s&amp;quot;, &amp;quot;baseboard-manufacturer&amp;quot;])},&#xA;      b={SELECT regex_replace(source=Stdout,re=&amp;quot;([^[:graph:]])&amp;quot;,replace=&amp;quot;&amp;quot;) AS BaseBoardProduct&#xA;         FROM execve(argv=[&amp;quot;dmidecode&amp;quot;, &amp;quot;-s&amp;quot;, &amp;quot;baseboard-product-name&amp;quot;])},&#xA;      c={SELECT regex_replace(source=Stdout,re=&amp;quot;([^[:graph:]])&amp;quot;,replace=&amp;quot;&amp;quot;) AS BaseBoardVersion&#xA;         FROM execve(argv=[&amp;quot;dmidecode&amp;quot;, &amp;quot;-s&amp;quot;, &amp;quot;baseboard-version&amp;quot;])},&#xA;      d={SELECT regex_replace(source=Stdout,re=&amp;quot;([^[:graph:]])&amp;quot;,replace=&amp;quot;&amp;quot;) AS BaseBoardSerialNumber&#xA;         FROM execve(argv=[&amp;quot;dmidecode&amp;quot;, &amp;quot;-s&amp;quot;, &amp;quot;baseboard-serial-number&amp;quot;])}&#xA;      )&#xA;      SELECT info[0].BaseBoardManufacturer AS BaseBoardManufacturer,&#xA;             info[1].BaseBoardProduct AS BaseBoardProduct,&#xA;             info[2].BaseBoardVersion AS BaseBoardVersion,&#xA;             info[3].BaseBoardSerialNumber AS BaseBoardSerialNumber&#xA;      FROM scope()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The key thing to note is that we are interested in having the following fields&#xA;as metadata fields:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;BaseBoardManufacturer&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;BaseBoardProduct&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;BaseBoardVersion&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;BaseBoardSerialNumber&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;After creating the artifact you can run it and verify that it produces the&#xA;expected results:&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/biosinfo_windows.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Windows BIOS info&#34;&#xA;         width=&#34;1200&#34; height=&#34;533&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;biosinfo_windows.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Windows BIOS info&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/biosinfo_linux.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Linux BIOS info&#34;&#xA;         width=&#34;1200&#34; height=&#34;533&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;biosinfo_linux.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Linux BIOS info&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h4 id=&#34;add-an-artifact-to-collect-the-last-logged-on-user&#34;&gt;Add an artifact to collect the last logged on user&lt;/h4&gt;&#xA;&lt;p&gt;Because the BIOS information is unlikely to ever change we also want to collect&#xA;something which &lt;em&gt;does&lt;/em&gt; change. For purposes of demonstration let&amp;rsquo;s query the&#xA;last logged on user. We already have built-in artifacts that provide the&#xA;relevant source information for Windows and Linux so we will leverage those in&#xA;our new artifact.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: Generic.Client.LastUser&#xA;&#xA;description: Query to find the last logged on user.&#xA;&#xA;type: CLIENT&#xA;&#xA;sources:&#xA;  - precondition: SELECT * From info() where OS = &#39;windows&#39;&#xA;    query: |&#xA;      SELECT Name AS LastUser, Mtime AS LastLogin&#xA;      FROM Artifact.Windows.Sys.Users()&#xA;      ORDER BY LastLogin DESC&#xA;      LIMIT 1&#xA;&#xA;  - precondition: SELECT * From info() where OS = &#39;linux&#39;&#xA;    query: |&#xA;      SELECT login_User AS LastUser, login_time AS LastLogin&#xA;      FROM Artifact.Linux.Sys.LastUserLogin()&#xA;      ORDER BY LastLogin DESC&#xA;      LIMIT 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As with any new artifact it&amp;rsquo;s always a good idea to run it and verify that it&#xA;produces the expected result:&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/lastuser_windows.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Windows last user logon&#34;&#xA;         width=&#34;1200&#34; height=&#34;533&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;lastuser_windows.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Windows last user logon&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/lastuser_linux.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Linux last user logon&#34;&#xA;         width=&#34;1200&#34; height=&#34;533&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;lastuser_linux.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Linux last user logon&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;From this artifact we get the following two fields which we want to have as&#xA;client metadata:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;LastUser&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;LastLogin&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;configure-metadata-indexing&#34;&gt;Configure Metadata Indexing&lt;/h4&gt;&#xA;&lt;p&gt;When run, the above two artifacts will altogether return 6 fields&#xA;which we want added as client metadata. As explained&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/clients/metadata/#indexed-metadata&#34;&gt;here&lt;/a&gt;,&#xA;client metadata fields can be indexed or non-indexed. While all metadata is&#xA;accessible - and therefore searchable - via VQL, indexed fields are also&#xA;searchable via the search bar in the GUI. So you might be thinking&#xA;&lt;em&gt;&amp;ldquo;great, let&amp;rsquo;s make everything indexed and searchable!&amp;rdquo;&lt;/em&gt;.&#xA;However there are performance consequences to indexing metadata fields,&#xA;especially if you have a large number of clients. In our case we are also going&#xA;to have fields who&amp;rsquo;s value may change with every interrogation and that will&#xA;require changes to the index and consequent re-indexing. So ideally you should&#xA;only index fields that are going to be useful for GUI searches. You can still&#xA;search all fields in VQL.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;BaseBoardManufacturer&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;BaseBoardProduct&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;BaseBoardVersion&lt;/code&gt; &amp;lt;- unlikely to be searched for, so it doesn&amp;rsquo;t need to be indexed&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;BaseBoardSerialNumber&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;LastUser&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;LastLogin&lt;/code&gt; &amp;lt;- a timestamp (string) which won&amp;rsquo;t be searched for, so it doesn&amp;rsquo;t need to be indexed&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Given the above considerations, we need to add the following to the server&#xA;configuration file (the &amp;ldquo;defaults&amp;rdquo; section should already exist in the config).&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;defaults:&#xA;  indexed_client_metadata:&#xA;    - BaseBoardManufacturer&#xA;    - BaseBoardProduct&#xA;    - BaseBoardSerialNumber&#xA;    - LastUser&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;After adding this configuration the server will need to be restarted so that it&#xA;reads the updated config file. The change will cause those metadata fields to be&#xA;created for every client. Initially the indexed metadata fields will be empty -&#xA;our server event artifact will populate their values later. You can navigate to&#xA;any client&amp;rsquo;s Overview page and verify that the fields exist.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/metadata_empty_.svg&#34; alt=&#34;&#34;&#xA;         class=&#34;inline&#34;&#xA;         height=&#34;622.3333333333333&#34;&#xA;         width=&#34;923.5&#34;  /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;metadata_empty.svg&#34;&gt;&lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Note: You can always edit any metadata field&amp;rsquo;s value, but you cannot delete&#xA;metadata fields that are indexed.&lt;/p&gt;&#xA;&lt;h4 id=&#34;add-custom-interrogation-artifact&#34;&gt;Add custom interrogation artifact&lt;/h4&gt;&#xA;&lt;p&gt;When interrogation happens on the client we want it to also run the 2 new&#xA;artifacts which we added in the previous steps.&lt;/p&gt;&#xA;&lt;p&gt;As explained&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/clients/interrogation/&#34;&gt;here&lt;/a&gt;,&#xA;the default interrogation artifact can be overridden with a custom version. If&#xA;such a custom artifact is present on the Velociraptor server then all clients&#xA;will use it.&lt;/p&gt;&#xA;&lt;p&gt;We want to modify the default artifact carefully and as little as possible (see&#xA;warning in the artifact&amp;rsquo;s description!), so we are only going to add two new&#xA;sources to it which won&amp;rsquo;t affect any of the default functionality:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The first new source will call the &lt;code&gt;Generic.Client.BiosInfo&lt;/code&gt; artifact.&lt;/li&gt;&#xA;&lt;li&gt;The second new source will call the &lt;code&gt;Generic.Client.LastUser&lt;/code&gt; artifact.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;We create our custom interrogation artifact by editing the default&#xA;&lt;code&gt;Generic.Client.Info&lt;/code&gt; artifact. By default the name of the edited artifact will&#xA;be &lt;code&gt;Custom.Generic.Client.Info&lt;/code&gt; which is exactly what we want it to be.&lt;/p&gt;&#xA;&lt;p&gt;In the custom version we add the new sources after the existing ones (around line&#xA;115 in the current default artifact):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;  - name: BiosInfo&#xA;    query: SELECT * FROM Artifact.Generic.Client.BiosInfo(preconditions=TRUE)&#xA;&#xA;  - name: LastUserLogin&#xA;    query: SELECT * FROM Artifact.Generic.Client.LastUser(preconditions=TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As you can see we are calling the other artifacts rather than including their&#xA;VQL directly in the interrogation artifact. This makes our addition more concise&#xA;and also allows the dependent artifacts to be run separately which is useful for&#xA;troubleshooting. The parameter &lt;code&gt;preconditions=TRUE&lt;/code&gt; is necessary because the&#xA;dependent artifacts include preconditions that must be checked so that the&#xA;correct VQL is run for each platform.&lt;/p&gt;&#xA;&lt;p&gt;As a check that the artifact works you can manually initiate a client&#xA;interrogation. The results should now include the two new sources.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/custom_generic_client_info.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;New sources have data&#34;&#xA;         width=&#34;1200&#34; height=&#34;576&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;custom_generic_client_info.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    New sources have data&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h3 id=&#34;configure-server-event-monitoring&#34;&gt;Configure Server Event Monitoring&lt;/h3&gt;&#xA;&lt;p&gt;At this point we have configured the collection of the required data. The next&#xA;step is to create a server event artifact and add it to server monitoring. This&#xA;will monitor for incoming results and then populate the metadata fields with&#xA;data from these results.&lt;/p&gt;&#xA;&lt;h4 id=&#34;add-a-server-event-monitoring-artifact&#34;&gt;Add a Server Event Monitoring artifact&lt;/h4&gt;&#xA;&lt;p&gt;Our server event artifact to be added has 2 sources - one to monitor each of the&#xA;new client artifacts that we added to &lt;code&gt;Custom.Generic.Client.Info&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: AutomateClientMetadata&#xA;type: SERVER_EVENT&#xA;sources:&#xA;- name: WatchBiosInfo&#xA;  query: |&#xA;    LET interrogations = SELECT *&#xA;    FROM watch_monitoring(artifact=&amp;quot;System.Flow.Completion&amp;quot;)&#xA;    WHERE Flow.artifacts_with_results =~ &amp;quot;Custom.Generic.Client.Info/BiosInfo&amp;quot;&#xA;&#xA;    LET results = SELECT *, ClientId&#xA;    FROM source(&#xA;       artifact=&amp;quot;Custom.Generic.Client.Info/BiosInfo&amp;quot; ,&#xA;       client_id=ClientId, flow_id=FlowId)&#xA;&#xA;    SELECT *,&#xA;      client_set_metadata(&#xA;                  client_id=ClientId,&#xA;                  metadata=dict(&#xA;                    BaseBoardManufacturer=BaseBoardManufacturer,&#xA;                    BaseBoardProduct=BaseBoardProduct,&#xA;                    BaseBoardVersion=BaseBoardVersion,&#xA;                    BaseBoardSerialNumber=BaseBoardSerialNumber&#xA;                    )&#xA;                  )&#xA;    FROM foreach(row=interrogations, query=results)&#xA;&#xA;- name: WatchLastUserLogin&#xA;  query: |&#xA;    LET interrogations = SELECT *&#xA;    FROM watch_monitoring(artifact=&amp;quot;System.Flow.Completion&amp;quot;)&#xA;    WHERE Flow.artifacts_with_results =~ &amp;quot;Custom.Generic.Client.Info/LastUserLogin&amp;quot;&#xA;&#xA;    -- we sleep this query to slightly stagger the update&#xA;    LET results = SELECT *, ClientId, sleep(time=3) AS _sleep&#xA;    FROM source(&#xA;       artifact=&amp;quot;Custom.Generic.Client.Info/LastUserLogin&amp;quot; ,&#xA;       client_id=ClientId, flow_id=FlowId)&#xA;&#xA;    SELECT *,&#xA;      client_set_metadata(&#xA;                  client_id=ClientId,&#xA;                  metadata=dict(&#xA;                    LastUser=LastUser,&#xA;                    LastLogin=LastLogin&#xA;                    )&#xA;                  )&#xA;    FROM foreach(row=interrogations, query=results)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;We now add this server event artifact to our server monitoring:&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/add_event_monitoring.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Add artifact to server event monitoring&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;add_event_monitoring.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Add artifact to server event monitoring&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h4 id=&#34;test-it&#34;&gt;Test it!&lt;/h4&gt;&#xA;&lt;p&gt;If you now enroll a new client &lt;em&gt;or&lt;/em&gt; perform a manual interrogation against an&#xA;existing client you will see the metadata fields populated.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/metadata_populated_.svg&#34; alt=&#34;&#34;&#xA;         class=&#34;inline&#34;&#xA;         height=&#34;703&#34;&#xA;         width=&#34;1044.5&#34;  /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;metadata_populated.svg&#34;&gt;&lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The indexed fields will now be available as&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/clients/searching/&#34;&gt;search operators&lt;/a&gt;&#xA;in the client search bar.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/indexed_search.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;search by indexed fields&#34;&#xA;         width=&#34;644&#34; height=&#34;344&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;indexed_search.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    search by indexed fields&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;As mentioned, the interrogation flow can be run manually by clicking the&#xA;&lt;strong&gt;Interrogate&lt;/strong&gt; button on the client Overview page, or by creating a hunt for&#xA;the &lt;code&gt;Custom.Generic.Client.Info&lt;/code&gt; artifact. Such a hunt can further be created on&#xA;a schedule as demonstrated by the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/artifact_references/pages/server.monitoring.schedulehunt/&#34;&gt;Server.Monitoring.ScheduleHunt&lt;/a&gt;&#xA;artifact.&lt;/p&gt;&#xA;&lt;h2 id=&#34;addingupdating-metadata-from-normal-collections&#34;&gt;Adding/updating metadata from normal collections&lt;/h2&gt;&#xA;&lt;p&gt;Although we previously linked the metadata to interrogations, it doesn&amp;rsquo;t have to&#xA;be done that way. We could, for example, hunt for either of the 2 new client&#xA;artifacts we created and have Server Monitoring add/update the metadata from the&#xA;results. Here&amp;rsquo;s how to do that&amp;hellip;&lt;/p&gt;&#xA;&lt;h4 id=&#34;add-a-new-server-monitoring-artifact&#34;&gt;Add a new server monitoring artifact&lt;/h4&gt;&#xA;&lt;p&gt;This artifact is almost identical to the one we previously created. The only&#xA;difference is that instead of watching for interrogation flow completions it&#xA;watches for completions of the client artifacts themselves.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: AutomateClientMetadataDirect&#xA;type: SERVER_EVENT&#xA;sources:&#xA;- name: WatchBiosInfo&#xA;  query: |&#xA;    LET interrogations = SELECT *&#xA;    FROM watch_monitoring(artifact=&amp;quot;System.Flow.Completion&amp;quot;)&#xA;    WHERE Flow.artifacts_with_results =~ &amp;quot;Generic.Client.BiosInfo&amp;quot;&#xA;&#xA;    LET results = SELECT *, ClientId&#xA;    FROM source(&#xA;       artifact=&amp;quot;Generic.Client.BiosInfo&amp;quot; ,&#xA;       client_id=ClientId, flow_id=FlowId)&#xA;&#xA;    SELECT *,&#xA;      client_set_metadata(&#xA;                  client_id=ClientId,&#xA;                  metadata=dict(&#xA;                    BaseBoardManufacturer=BaseBoardManufacturer,&#xA;                    BaseBoardProduct=BaseBoardProduct,&#xA;                    BaseBoardVersion=BaseBoardVersion,&#xA;                    BaseBoardSerialNumber=BaseBoardSerialNumber&#xA;                    )&#xA;                  )&#xA;    FROM foreach(row=interrogations, query=results)&#xA;&#xA;- name: WatchLastUserLogin&#xA;  query: |&#xA;    LET interrogations = SELECT *&#xA;    FROM watch_monitoring(artifact=&amp;quot;System.Flow.Completion&amp;quot;)&#xA;    WHERE Flow.artifacts_with_results =~ &amp;quot;Generic.Client.LastUser&amp;quot;&#xA;&#xA;    LET results = SELECT *, ClientId&#xA;    FROM source(&#xA;       artifact=&amp;quot;Generic.Client.LastUser&amp;quot; ,&#xA;       client_id=ClientId, flow_id=FlowId)&#xA;&#xA;    SELECT *,&#xA;      client_set_metadata(&#xA;                  client_id=ClientId,&#xA;                  metadata=dict(&#xA;                    LastUser=LastUser,&#xA;                    LastLogin=LastLogin&#xA;                    )&#xA;                  )&#xA;    FROM foreach(row=interrogations, query=results)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;We then add this new artifact to our Server Event Monitoring.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/add_event_monitoring_direct.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Add artifact to server event monitoring&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;add_event_monitoring_direct.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Add artifact to server event monitoring&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Now all we need to do is run the artifacts directly and the metadata will be&#xA;updated. You can create a hunt for these artifacts if you want to update the&#xA;data for all your clients.&lt;/p&gt;&#xA;&lt;p&gt;The two approaches are not mutually exclusive: You can have both&#xA;&lt;code&gt;AutomateClientMetadata&lt;/code&gt; and &lt;code&gt;AutomateClientMetadataDirect&lt;/code&gt; added to Server&#xA;Monitoring at the same time and either one will update the same metadata.&lt;/p&gt;&#xA;&lt;h2 id=&#34;searching-metadata-in-vql&#34;&gt;Searching metadata in VQL&lt;/h2&gt;&#xA;&lt;p&gt;Searching metadata values in VQL is easy. Here&amp;rsquo;s an example that will list all&#xA;systems where Mary was the last user to log on.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT client_id,&#xA;       os_info.hostname,&#xA;       client_metadata(client_id=client_id).LastUser AS LastUser,&#xA;       client_metadata(client_id=client_id).LastLogin AS LastLogin&#xA;FROM clients()&#xA;WHERE LastUser = &amp;quot;Mary&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata//knowledge_base/tips/automating_metadata/vql_search.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Running a search in a notebook&#34;&#xA;         width=&#34;1136&#34; height=&#34;401&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;vql_search.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Running a search in a notebook&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to set up OIDC authentication using Keycloak</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak/</link>
      <pubDate>Sat, 28 Dec 2024 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak/</guid>
      <description>&lt;h1 id=&#34;how-to-set-up-oidc-authentication-using-keycloak&#34;&gt;How to set up OIDC authentication using Keycloak&lt;/h1&gt;&#xA;&lt;p&gt;This guide walks you through the configuration of&#xA;&lt;a href=&#34;https://www.keycloak.org/&#34; target=&#34;_blank&#34; &gt;Keycloak&lt;/a&gt; as an OIDC authentication provider for&#xA;Velociraptor.&lt;/p&gt;&#xA;&lt;p&gt;Keycloak, as a self-hosted, free, and open source solution, may be an attractive&#xA;choice for Velociraptor deployments where using cloud-based and/or commercial&#xA;providers is not practical or possible. Most of the steps shown here would be&#xA;the same or similar for other self-hosted OIDC solutions (for example Zitadel or&#xA;Authentik), so it may be useful even if you are not using Keycloak.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices warning&#34;&gt;&#xA;  &lt;div heading=&#34; Production deployment of Keycloak &#34;&gt;&lt;p&gt;Keycloak is a Java application which can be installed manually or deployed via&#xA;several officially documented container-based methods. This guide partly mirrors Keycloak&amp;rsquo;s&#xA;&lt;a href=&#34;https://www.keycloak.org/getting-started/getting-started-docker&#34; target=&#34;_blank&#34; &gt;Getting started guide&lt;/a&gt;&#xA;which uses Docker to create a &lt;em&gt;&amp;ldquo;development mode&amp;rdquo; instance&lt;/em&gt; of Keycloak. This&#xA;method starts a working Keycloak instance but does not create a persistent&#xA;database or a production-ready secured server, since the goal here is only to&#xA;demonstrate the integration with Velociraptor.&lt;/p&gt;&#xA;&lt;p&gt;For production-ready deployment guidance we refer you to&#xA;&lt;a href=&#34;https://www.keycloak.org/server/configuration-production&#34; target=&#34;_blank&#34; &gt;Configuring Keycloak for production&lt;/a&gt;&#xA;and the official &lt;a href=&#34;https://www.keycloak.org/documentation&#34; target=&#34;_blank&#34; &gt;Keycloak documentation&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;p&gt;As mentioned above, the goal of this guide is to demonstrate a working SSO&#xA;configuration for Velociraptor using Keycloak. The basic steps and configuration&#xA;will be very similar or even identical for production deployments however some&#xA;of the steps shown here are deliberately over-simplified for reasons of brevity&#xA;and therefore do not reflect security best practices. Also Keycloak has a vast&#xA;array of options and capabilities, which we recommend you explore later, but the&#xA;intention here is to get up and running with a basic working integration since&#xA;it is better to start simple and be sure that it&amp;rsquo;s working as expected before&#xA;possibly adding complexity to it.&lt;/p&gt;&#xA;&lt;p&gt;In this simplified setup we have two hosts, with DNS names &lt;code&gt;keycloak.local&lt;/code&gt; and&#xA;&lt;code&gt;velociraptor.local&lt;/code&gt;. Substitute your DNS names where applicable. The two hosts&#xA;don&amp;rsquo;t need to be on the same network but the Velociraptor host needs to be able&#xA;to DNS-resolve the name of the Keycloak server and reach it on port 443. It&amp;rsquo;s&#xA;not necessary that the Keycloak server be able to resolve the Velociraptor&#xA;server&amp;rsquo;s DNS name but your server probably already has a DNS name already so&#xA;that clients can connect to it.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/network_overview_.svg&#34; alt=&#34;Network overview&#34;&#xA;         class=&#34;inline&#34;&#xA;         height=&#34;380&#34;&#xA;         width=&#34;658.5&#34;  /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;network_overview.svg&#34;&gt;&lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Network overview&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The high-level steps of this setup process are:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a self-hosted Docker-based Keycloak instance.&lt;/li&gt;&#xA;&lt;li&gt;Configure an authentication realm, OIDC client and test users in Keycloak.&lt;/li&gt;&#xA;&lt;li&gt;Configure the authentication provider in Velociraptor.&lt;/li&gt;&#xA;&lt;li&gt;Add test users to Velociraptor.&lt;/li&gt;&#xA;&lt;li&gt;Test the authentication process.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;create-a-docker-based-keycloak-instance&#34;&gt;Create a Docker-based Keycloak instance&lt;/h2&gt;&#xA;&lt;p&gt;We assume that Docker has already been installed and configured on the&#xA;designated Keycloak host. We aren&amp;rsquo;t going to use Docker Compose but for&#xA;production deployment you might prefer to do so, and example configurations can&#xA;be found on the internet.&lt;/p&gt;&#xA;&lt;p&gt;Before we install Keycloak we are going to need a certificate for it to use. Here&#xA;we will generate a simple self-signed cert with corresponding private key but ideally in&#xA;production you would have a cert signed by a trusted CA.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;1. Generate a key pair&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;# Create keycloak-server.crt.pem and keycloak-server.key.pem&#xA;openssl req -newkey rsa:2048 -nodes -subj &amp;quot;/CN=keycloak.local&amp;quot; \&#xA;-addext &amp;quot;subjectAltName=DNS:keycloak.local,IP:192.168.56.1&amp;quot; \&#xA;-keyout keycloak-server.key.pem -x509 -days 3650 -out keycloak-server.crt.pem&#xA;# Set appropriate permissions on files&#xA;chmod -R 644 keycloak-server*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;NOTE: The certificate SAN is required by Velociraptor. If not present you will receive&#xA;this error when trying to start Velociraptor.&lt;br&gt;&#xA;&lt;code&gt;error: gui: starting frontend: Get &amp;quot;https://keycloak.local/.well-known/openid-configuration&amp;quot;: x509: certificate relies on legacy Common Name field, use SANs instead&lt;/code&gt;&lt;br&gt;&#xA;Putting the IP in the SAN is not really necessary but helpful if you need to&#xA;connect to Keycloak&amp;rsquo;s admin page using it&amp;rsquo;s IP.&lt;/p&gt;&#xA;&lt;p&gt;Now that we have the key pair we can run Docker which will pull the latest&#xA;Keycloak image (26.0.7 at the time of writing).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;2. Run the Docker command.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;docker run -p 443:443 -e KC_HOSTNAME=keycloak.local \&#xA;-e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin \&#xA;-v /root/keycloak-server.crt.pem:/etc/x509/https/keycloak-server.crt.pem \&#xA;-v /root/keycloak-server.key.pem:/etc/x509/https/keycloak-server.key.pem \&#xA;-e KC_HTTPS_CERTIFICATE_FILE=/etc/x509/https/keycloak-server.crt.pem \&#xA;-e KC_HTTPS_CERTIFICATE_KEY_FILE=/etc/x509/https/keycloak-server.key.pem \&#xA;quay.io/keycloak/keycloak:latest start-dev --https-port=443&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;We set various Keycloak config options as Docker environment variables and&#xA;make the cert and private key available inside the Docker using volume mapping.&lt;/p&gt;&#xA;&lt;p&gt;If the Docker fails to start, you should inspect the command output for errors.&#xA;If successful it should report&#xA;&lt;code&gt;Listening on: http://0.0.0.0:8080 and https://0.0.0.0:443&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The KC_BOOTSTRAP* variables create an initial user &lt;code&gt;admin&lt;/code&gt; with password&#xA;&lt;code&gt;admin&lt;/code&gt; which we use to configure Keycloak in the next section.&lt;/p&gt;&#xA;&lt;h2 id=&#34;configure-keycloak&#34;&gt;Configure Keycloak&lt;/h2&gt;&#xA;&lt;p&gt;Next we go through the steps that are almost the same as described in Keycloak&amp;rsquo;s&#xA;&lt;a href=&#34;https://www.keycloak.org/getting-started/getting-started-docker&#34; target=&#34;_blank&#34; &gt;Getting started guide&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Connect to Keycloak&amp;rsquo;s Admin Console (in this case: &lt;a href=&#34;https://keycloak.local&#34; target=&#34;_blank&#34; &gt;https://keycloak.local&lt;/a&gt;) and&#xA;log in with the &lt;code&gt;admin&lt;/code&gt; user.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;3. Create an authentication realm&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak00.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak00.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;You can use any name for the realm but here we are going to just use &lt;code&gt;myrealm&lt;/code&gt;&#xA;for convenience.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak01.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak01.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;4. Create OIDC client configuration for Velociraptor&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;In this step we create a new client record and client secret which we will use&#xA;later in the Velociraptor configuration. In the realm selection drop-down ensure&#xA;that you are in the new &lt;code&gt;myrealm&lt;/code&gt; realm.&lt;/p&gt;&#xA;&lt;p&gt;In the sidebar select &lt;strong&gt;Clients&lt;/strong&gt; and then select &lt;strong&gt;Create client&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak02.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak02.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;This will start a 3-page configuration wizard. On the first page the &lt;strong&gt;Client&#xA;ID&lt;/strong&gt; is all that&amp;rsquo;s required. Enter &lt;code&gt;velociraptor&lt;/code&gt; and click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak03.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak03.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;On the second page, choose &lt;strong&gt;Client authentication: ON&lt;/strong&gt; and&#xA;&lt;strong&gt;Authentication flow: Standard flow&lt;/strong&gt; (only). Then click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak04.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak04.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;On the third page we use the following values (adapt to your DNS names if your&#xA;are replicating the setup in your own environment):&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Valid redirect URIs: &lt;code&gt;https://velociraptor.local:8889/auth/oidc/keycloak/callback&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Valid post logout redirect URIs:&#xA;&lt;code&gt;https://velociraptor.local:8889/app/logoff.html&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Web origins: &lt;code&gt;https://velociraptor.local&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak05.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak05.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Then click &lt;strong&gt;Save&lt;/strong&gt;. Your OIDC client configuration is now created.&lt;/p&gt;&#xA;&lt;p&gt;On the page that follows, go to the &lt;strong&gt;Credentials&lt;/strong&gt; tab. There you will find the&#xA;&lt;strong&gt;Client secret&lt;/strong&gt; which you will need for your Velociraptor configuration. It is&#xA;randomly generated and you can regenerate it if desired, but if you do so then&#xA;don&amp;rsquo;t forget to update your Velociraptor server&amp;rsquo;s config with the new secret.&#xA;Typically you would only regenerate it if you suspected a compromised secret.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak06.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak06.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The next action is to configure email addresses as login usernames. To do that&#xA;navigate via the sidebar to &lt;strong&gt;Realm settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;Login&lt;/strong&gt; tab. Ensure that&#xA;&lt;strong&gt;Email as username&lt;/strong&gt; and &lt;strong&gt;Login with email&lt;/strong&gt; are enabled. The additional user&#xA;preferences shown in the following screenshot are optional and in your case&#xA;would be determined by your organizational policies.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak08.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak08.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The last action in this step is to configure the required actions for&#xA;authentication so that users don&amp;rsquo;t have to enter additional information when&#xA;they first log in.&#xA;Navigate via the sidebar to &lt;strong&gt;Authentication&lt;/strong&gt; &amp;gt; &lt;strong&gt;Required actions&lt;/strong&gt; tab.&#xA;Disable all options except &lt;strong&gt;Update password&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;5. Create test users&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;We will need at least one user account to test the authentication. From the&#xA;sidebar select &lt;strong&gt;Users&lt;/strong&gt; and then click the &lt;strong&gt;Create new user&lt;/strong&gt; button.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak07.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak07.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;For the user account I am going to create one named &lt;code&gt;bob@local&lt;/code&gt;. Remember that&#xA;we previously enabled &lt;strong&gt;Email as username&lt;/strong&gt; and &lt;strong&gt;Login with email&lt;/strong&gt;, so all&#xA;other fields are optional. I also selected &lt;strong&gt;Email verified&lt;/strong&gt; to avoid an email&#xA;verification step when logging in.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak09.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak09.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;After creating the account, go to the Credentials tab and set a password. Note&#xA;that we leave &lt;strong&gt;Temporary:ON&lt;/strong&gt; set so that the password must be changed on first&#xA;logon. Note also that this is a simplified demonstration so for that reason&#xA;we&amp;rsquo;re ONLY using password auth while Keycloak easily supports multi-factor&#xA;authentication.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak10.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;666&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak10.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Repeat the user creation actions to also create a user account&#xA;&lt;code&gt;fred@local&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/keycloak11.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;538&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;keycloak11.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Now we are ready to move to configuring the Velociraptor side of things.&lt;/p&gt;&#xA;&lt;h2 id=&#34;configure-velociraptor&#34;&gt;Configure Velociraptor&lt;/h2&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34;tip&#34;&gt;&lt;p&gt;While configuring, testing and potentially troubleshooting problems, it&amp;rsquo;s&#xA;easier if you can see Velociraptor&amp;rsquo;s log messages. You can stop the server&#xA;service and then run the server manually on the command line by using the&#xA;following commands:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;sudo systemctl stop velociraptor_server&#xA;sudo -u velociraptor bash&#xA;velociraptor -c /etc/velociraptor/server.config.yaml frontend -v&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This will display the log messages in the terminal.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;6. Add the authenticator settings to your Velciraptor config&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;In the &lt;code&gt;GUI&lt;/code&gt; section of your Velociraptor config you should have the following&#xA;authenticator settings by default:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;  authenticator:&#xA;    type: Basic&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;We no longer want Basic auth and instead want SSO, so replace that with these&#xA;new settings to match our Keycloak configuration:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;    type: oidc&#xA;    oidc_issuer: https://keycloak.local/realms/myrealm&#xA;    oidc_name: keycloak&#xA;    avatar: https://www.keycloak.org/resources/images/logo.svg&#xA;    oauth_client_id: velociraptor&#xA;    oauth_client_secret: p4EABoniopnasbrmstDnsHrQcSukNmp2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The &lt;code&gt;oauth_client_secret&lt;/code&gt; is the value we obtained at the end of step 4. The&#xA;&lt;code&gt;oauth_client_id&lt;/code&gt; is the name we used for the OIDC Client ID in that same&#xA;section.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;oidc_name&lt;/code&gt; can be anything you want but it must exactly match&#xA;(case-sensitive) the substring used in the &lt;strong&gt;Valid redirect URIs&lt;/strong&gt; field of the&#xA;client configuration in Keycloak.&lt;/p&gt;&#xA;&lt;p&gt;Keycloak requires that the &lt;code&gt;oidc_issuer&lt;/code&gt; field specify the path&#xA;&lt;code&gt;/realms/myrealm&lt;/code&gt; as this is where is serves the OpenID Endpoint Configuration&#xA;that Velociraptor will need to access. If you have somehow gotten this wrong&#xA;then Velociraptor will log an error such as:&#xA;&lt;code&gt;[ERROR] can not get information from OIDC provider, check https://keycloak.local/.well-known/openid-configuration is correct and accessible from the server.&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Before you start Velociraptor, if you are using a self-signed cert for Keycloak&#xA;then also attend to the next step.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;7. Copy the Keycloak server cert to the trusted root store.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Because the Keycloak server is using a certificate that wasn&amp;rsquo;t issued by a&#xA;trusted CA, we need to add it&amp;rsquo;s certificate to the trusted root store on the&#xA;Velociraptor server. Assuming your server is Ubuntu or similar this means saving&#xA;a copy of the certificate to &lt;code&gt;/etc/ssl/certs&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Without this step you will see this error in the log when attempting to start&#xA;Velociraptor:&#xA;&lt;code&gt;error: gui: starting frontend: Get &amp;quot;https://keycloak.local/...&amp;quot;: x509: certificate signed by unknown authority (possibly because of &amp;quot;crypto/rsa: verification error&amp;quot; while trying to verify candidate authority certificate &amp;quot;keycloak.local&amp;quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;8. Start Velociraptor&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The server should now start cleanly and continue running. In the log messages&#xA;you should see &lt;code&gt;GUI will use the oidc authenticator&lt;/code&gt;. That means everything is&#xA;OK with the authenticator config.&lt;/p&gt;&#xA;&lt;p&gt;One possible gotcha is if the server&amp;rsquo;s &lt;code&gt;GUI.public_url&lt;/code&gt; setting is still using&#xA;an IP address or if &lt;code&gt;GUI.bind_address&lt;/code&gt; is not set to &lt;code&gt;0.0.0.0&lt;/code&gt; then you may get&#xA;stopped with the error:&#xA;&lt;code&gt;error: gui: starting frontend: Authentication type &#39;oidc&#39; requires valid public_url parameter&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;In this case the &lt;code&gt;GUI.public_url&lt;/code&gt; is set to &lt;code&gt;https://velociraptor.local:8889/&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;add-test-users&#34;&gt;Add test users&lt;/h2&gt;&#xA;&lt;p&gt;We have created 2 users in Keycloak but these users don&amp;rsquo;t yet exist in&#xA;Velociraptor. Velociraptor has it&amp;rsquo;s own permissions model and therefore needs to&#xA;know about any users so that once they authenticate the correct permissions can&#xA;be applied.&lt;/p&gt;&#xA;&lt;p&gt;Users can be created using VQL in Velociraptor notebooks but since we have now&#xA;switched authentication providers we no longer have access to the GUI. Of course&#xA;we could have added the users before we switched but let&amp;rsquo;s pretend we didn&amp;rsquo;t and&#xA;instead do it from the command line.&lt;/p&gt;&#xA;&lt;p&gt;We will make &lt;code&gt;bob@local&lt;/code&gt; a server admin and grant &lt;code&gt;fred@local&lt;/code&gt; the &amp;ldquo;reader&amp;rdquo;&#xA;role, which provides minimal access to Velociraptor&amp;rsquo;s GUI. The following two&#xA;commands will create these users:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;9. Add users to the datastore&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;velociraptor --config server.config.yaml user add --role administrator bob@local&#xA;velociraptor --config server.config.yaml user add --role reader fred@local&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;NOTE: We provide the &lt;code&gt;--config&lt;/code&gt; flag so that this invocation of the velociraptor&#xA;binary knows which datastore to add the new users to. This can be done while the&#xA;server service is running or not running, but either way the service will need&#xA;to be restarted to update itself with the datastore changes.&lt;/p&gt;&#xA;&lt;p&gt;Because of our OIDC authenticator config, when adding each user we will receive&#xA;an acknowledgement message saying&#xA;&lt;code&gt;&amp;quot;Authentication will occur via oidc - therefore no password needs to be set.&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-authentication-process&#34;&gt;Test authentication process&lt;/h2&gt;&#xA;&lt;p&gt;Test the authentication process by going to &lt;code&gt;https://velociraptor.local:8889/&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;You will be presented with the choice to log in with Keycloak (multiple&#xA;authentication providers are supported but we only have one configured).&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/auth00.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;auth00.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Enter initial credentials (password that was set in Keycloak).&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/auth01.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Login page&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;auth01.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Login page&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;You will be required to change the password because we configured&#xA;&lt;strong&gt;Temporary:ON&lt;/strong&gt; when setting the account&amp;rsquo;s password.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/auth02.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Change the password&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;auth02.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Change the password&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/auth03.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Successful login!&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;auth03.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Successful login!&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/auth04.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;We can verify that the user has the server admin role.&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;auth04.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    We can verify that the user has the server admin role.&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/setup_keycloak//knowledge_base/tips/setup_keycloak/auth05.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;We can sign out… and sign in again.&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;auth05.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    We can sign out… and sign in again.&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The same process applies to &lt;code&gt;fred@local&lt;/code&gt; except that we can verify in&#xA;Velociraptor that the user has the read-only role.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34;tip&#34;&gt;&lt;p&gt;For testing multiple users in the same web browser you may have trouble&#xA;fully logging a user out because while logged out of Velociraptor the OIDC&#xA;session is still active.&lt;/p&gt;&#xA;&lt;p&gt;Logout of the OIDC session can be achieved by&#xA;navigating to the the endpoint&#xA;&lt;code&gt;https://keycloak.local/realms/myrealm/protocol/openid-connect/logout&lt;/code&gt;&#xA;from within the same web browser and choosing to log out.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;what-next&#34;&gt;What next?&lt;/h2&gt;&#xA;&lt;p&gt;Once you have the working authentication setup, as per this guide, then you can&#xA;begin experimenting with additional options while knowing that any change which&#xA;causes a negative effect can be reverted back to a known working state. This is&#xA;a much easier approach than diving in with a complex configuration and spending&#xA;hours troubleshooting why it doesn&amp;rsquo;t work.&lt;/p&gt;&#xA;&lt;p&gt;Since the Docker installation used in the guide is non-permanent it will reset&#xA;when you restart the docker VM. For testing and experimenting that&amp;rsquo;s a good&#xA;thing as you gain familiarity by going through the process. As mentioned,&#xA;Keycloak supports multifactor authentication, complex authentication flow&#xA;options, themeable login screens, and many other cool features. However for&#xA;permanent configuration you will need to learn how to create a persistent&#xA;Keycloak database, possibly using a different deployment method.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Set operations in VQL</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/set_operations/</link>
      <pubDate>Mon, 16 Dec 2024 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/set_operations/</guid>
      <description>&lt;h1 id=&#34;set-operations-in-vql&#34;&gt;Set operations in VQL&lt;/h1&gt;&#xA;&lt;p&gt;Set operations are useful in a number of useful scenarios.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-are-sets&#34;&gt;What are sets?&lt;/h2&gt;&#xA;&lt;p&gt;Sets are a mathematical construct that allows &lt;code&gt;set operations&lt;/code&gt; on&#xA;groups of values. In VQL sets are analogous to dictionaries with the&#xA;key being the set member and the values ignored (usually just set to&#xA;&lt;code&gt;TRUE&lt;/code&gt;). Set operations are emulated using dict addition and&#xA;subtraction.&lt;/p&gt;&#xA;&lt;p&gt;For example consider the following VQL&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sql&#34;&gt;&#xA;// Convert a list into a dict for set operations&#xA;LET SET(LIST) = to_dict(item={&#xA;  SELECT _value AS _key, TRUE AS _value FROM foreach(row=LIST)&#xA;})&#xA;&#xA;// Convert a dict into a list of keys&#xA;LET KEYS(X) = items(item=X)._key&#xA;&#xA;LET X &amp;lt;= SET(LIST=[&amp;quot;A&amp;quot;, &amp;quot;B&amp;quot;])&#xA;LET Y &amp;lt;= SET(LIST=[&amp;quot;A&amp;quot;, &amp;quot;C&amp;quot;])&#xA;&#xA;SELECT X + Y AS Union,&#xA;       KEYS(X=X+Y) AS UnionKeys,&#xA;       X - Y AS Intersection,&#xA;       KEYS(X=X-Y) AS IntersectionKeys,&#xA;       X.A AS Membership,&#xA;       get(field=&amp;quot;A&amp;quot;, item=X) AS Membership2&#xA;FROM scope()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In the above example, we define a helper function &lt;code&gt;SET()&lt;/code&gt; to create a&#xA;dict from an array by iterating over each element of the array, and&#xA;setting the value to TRUE.&lt;/p&gt;&#xA;&lt;p&gt;A &lt;code&gt;Set Union&lt;/code&gt; operation is the combination of all keys in the first&#xA;set and the second set. This is achieved by adding the&#xA;dicts. Similarly a &lt;code&gt;Set Difference&lt;/code&gt; removes keys present in the second&#xA;set from the first set. This is implemented by subtracting the second&#xA;set from the first set.&lt;/p&gt;&#xA;&lt;p&gt;Set membership check can be done by simply checking if the dict&#xA;contains the value. This can be done directly when the key name is&#xA;known in advance, or by using the &lt;code&gt;get()&lt;/code&gt; function to access the named&#xA;field.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/set_operations//knowledge_base/tips/set_operations/set_operations.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Set Operations in VQL&#34;&#xA;         width=&#34;1851&#34; height=&#34;684&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;set_operations.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Set Operations in VQL&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;using-set-operations-in-vql&#34;&gt;Using Set operations in VQL&lt;/h2&gt;&#xA;&lt;p&gt;An example use case is in responding to a number of distinct artifact&#xA;collections. For example, for post processing the results of some&#xA;collections.&lt;/p&gt;&#xA;&lt;p&gt;Generally to respond to server events we need to write a&#xA;&lt;code&gt;SERVER_EVENT&lt;/code&gt; artifact that watches for certain events on the&#xA;server. In this case we watch for events from the&#xA;&lt;code&gt;System.Flow.Completion&lt;/code&gt; artifact, this artifact emits the flow object&#xA;from each flow containing a list of &lt;code&gt;artifacts_with_results&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET SET(LIST) = to_dict(item={&#xA;  SELECT _value AS _key, TRUE AS _value FROM foreach(row=LIST)&#xA;})&#xA;&#xA;LET FlowsToWatch &amp;lt;= SET(LIST=[&amp;quot;Generic.Client.Info/Users&amp;quot;,&#xA;   &amp;quot;Generic.Client.Info/WindowsInfo&amp;quot;])&#xA;&#xA;SELECT Flow&#xA;FROM watch_monitoring(artifact=&amp;quot;System.Flow.Completion&amp;quot;)&#xA;WHERE any(items=Flow.artifacts_with_results, filter=&amp;quot;x=&amp;gt;get(item=FlowsToWatch, field=x)&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The above query prepares a set into the variable &lt;code&gt;FlowsToWatch&lt;/code&gt;. The&#xA;query then filters out all flows except those that contain results&#xA;from the set of interest.&lt;/p&gt;&#xA;&lt;p&gt;An alternative to the previous query is to use a regular expression&#xA;(This solution is more flexible as it allows matching artifact names&#xA;by regular expressions):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET FlowsToWatch &amp;lt;= join(array=[&amp;quot;Generic.Client.Info/Users&amp;quot;,&#xA;   &amp;quot;Generic.Client.Info/WindowsInfo&amp;quot;], sep=&amp;quot;|&amp;quot;)&#xA;&#xA;SELECT Flow&#xA;FROM watch_monitoring(artifact=&amp;quot;System.Flow.Completion&amp;quot;)&#xA;WHERE Flow.artifacts_with_results =~ FlowsToWatch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This works because a regular expression match on an array is true if&#xA;any of the members of the array match.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I get a list of hunts across multiple organizations?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/multi_org/</link>
      <pubDate>Fri, 06 Dec 2024 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/multi_org/</guid>
      <description>&lt;h1 id=&#34;how-do-i-get-a-list-of-hunts-across-multiple-organizations&#34;&gt;How do I get a list of hunts across multiple organizations?&lt;/h1&gt;&#xA;&lt;p&gt;Are you looking for a way to generate user metrics across the entire server (like Hunts run per user)?&lt;/p&gt;&#xA;&lt;p&gt;Orgs are separated out so when you run a query you are running that query within the context of the org. Normally the hunts scheduled in an organization can be accessed using the &lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/server/hunts/&#34;&gt;hunts()&lt;/a&gt; plugin, but that normally acts within a single Org.&lt;/p&gt;&#xA;&lt;p&gt;To run a query in another org, you can switch org contexts using the &lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/server/query/&#34;&gt;query()&lt;/a&gt; plugin.&lt;/p&gt;&#xA;&lt;p&gt;So for example to see all hunts in all orgs:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sql&#34;&gt;SELECT * FROM foreach(&#xA;  row={&#xA;    SELECT OrgId FROM orgs()&#xA;  },&#xA;  query={&#xA;    SELECT * FROM query(query={&#xA;      SELECT * FROM hunts()&#xA;    }, org_id=OrgId)&#xA;  })&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This query iterates over all the orgs, then runs the &lt;code&gt;SELECT * FROM hunts()&lt;/code&gt; query within the org context.&lt;/p&gt;&#xA;&lt;p&gt;You can simplify the query using LET stored queries:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sql&#34;&gt;LET MyQuery = SELECT * FROM hunts()&#xA;LET AllOrgs = SELECT OrgId FROM orgs()&#xA;&#xA;SELECT * FROM foreach(row=AllOrgs,&#xA;  query={&#xA;    SELECT * FROM query(query=MyQuery, org_id=OrgId)&#xA;  })&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Of course your user account must have access to the orgs. Each org has a separate ACL for each user, so your user needs to have at least the &lt;code&gt;READ_RESULTS&lt;/code&gt; permission to be able to see the org.&lt;/p&gt;&#xA;&lt;p&gt;Some plugins (e.g. &lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/server/hunt/&#34;&gt;hunt()&lt;/a&gt; ) support orgs directly for convenience but generally you should use the above approach. This will also remind you that each such query is running in a separate org context and therefore can not see other data at the same time.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Error &#34;Parameter refers to an unknown artifact&#34; when collecting a CLIENT artifact</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/collect_artifact_unknown/</link>
      <pubDate>Sat, 31 Aug 2024 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/collect_artifact_unknown/</guid>
      <description>&lt;h1 id=&#34;error-parameter-refers-to-an-unknown-artifact-when-collecting-a-client-artifact&#34;&gt;Error &amp;ldquo;Parameter refers to an unknown artifact&amp;rdquo; when collecting a CLIENT artifact&lt;/h1&gt;&#xA;&lt;p&gt;Before an artifact is collected from the client, the artifact is&#xA;compiled into a VQL request by the artifact compiler. This actually&#xA;transforms the vql and injects dependent artifacts into the request so&#xA;the client can evaluate it. The client&amp;rsquo;s VQL engine will &lt;strong&gt;never&lt;/strong&gt; use&#xA;built in artifacts and must always have artifacts injected in the request.&lt;/p&gt;&#xA;&lt;p&gt;The reason for that is that if an artifact is updated on the server&#xA;(e.g. by upgrading the server or edit the custom artifact) the client&#xA;must be given the latest version of the artifact.&lt;/p&gt;&#xA;&lt;p&gt;When the VQL compiler sees a statement like:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT * FROM Artifact.Dependant.Artifact()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It will recognize the the the VQL is dependent on the artifact&#xA;&lt;code&gt;Dependent.Artifact&lt;/code&gt; and will inject it into the VQL request. You can&#xA;see this in the &lt;code&gt;Request&lt;/code&gt; tab - the &lt;code&gt;artifacts&lt;/code&gt; section of the request&#xA;will include dependent artifact definitions (in this case the artifact&#xA;calls &lt;code&gt;Generic.Utils.FetchBinary&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;[&#xA;  {&#xA;     &amp;quot;session_id&amp;quot;: &amp;quot;F.CR3B2IIN3E8GK&amp;quot;,&#xA;     &amp;quot;request_id&amp;quot;: &amp;quot;1&amp;quot;,&#xA;     &amp;quot;FlowRequest&amp;quot;: {&#xA;         &amp;quot;VQLClientActions&amp;quot;: [&#xA;         {&#xA;           &amp;quot;query_id&amp;quot;: &amp;quot;1&amp;quot;,&#xA;           &amp;quot;total_queries&amp;quot;: &amp;quot;1&amp;quot;,&#xA;           ....&#xA;           &amp;quot;artifacts&amp;quot;: [&#xA;           {&#xA;               &amp;quot;name&amp;quot;: &amp;quot;Generic.Utils.FetchBinary&amp;quot;,&#xA;               &amp;quot;parameters&amp;quot;: [&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This issue comes up commonly in two scenarios:&lt;/p&gt;&#xA;&lt;h3 id=&#34;using-the-vql-shell-to-collect-a-custom-artifact&#34;&gt;Using the VQL shell to collect a custom artifact&lt;/h3&gt;&#xA;&lt;p&gt;In this case the GUI will collect the artifact &lt;code&gt;Generic.Client.VQL&lt;/code&gt;&#xA;which essentially evaluates the query provided as a string on the&#xA;client.&lt;/p&gt;&#xA;&lt;p&gt;Because the query is given as an opaque string parameter, the artifact&#xA;compiler does not see any dependencies and can not inject them into&#xA;the request. Built in artifacts are allowed in this case but custom&#xA;artifacts are not supported.&lt;/p&gt;&#xA;&lt;p&gt;If you need to collect a custom artifact from the endpoint, just&#xA;collect it as normal - do not use the VQL shell for that.&lt;/p&gt;&#xA;&lt;h3 id=&#34;using-the-collect-plugin-on-the-client-to-prepare-a-collection-zip-file&#34;&gt;Using the &lt;code&gt;collect()&lt;/code&gt; plugin on the client to prepare a collection zip file.&lt;/h3&gt;&#xA;&lt;p&gt;Another similar issue occurs when writing a custom artifact that uses&#xA;the &lt;code&gt;collect()&lt;/code&gt; plugin. Similarly because the artifacts to collect are&#xA;given as strings, the compiler has no idea these are a dependency.&lt;/p&gt;&#xA;&lt;p&gt;For example this VQL code&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT * from collect(artifacts=[&#39;Generic.Collectors.File&#39;],&#xA;   args=dict(`Generic.Collectors.File`=dict(`collectionSpec`=collectionSpec,&#xA;             `Root`=Root)),&#xA;   password=&#39;infected&#39;,&#xA;   output=tempzip)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To fix this artifact the &lt;code&gt;Generic.Collectors.File&lt;/code&gt; artifact must be&#xA;given as a dependency. Either include it in the artifact&amp;rsquo;s &lt;code&gt;import&lt;/code&gt;&#xA;section or add the following VQL statement:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET _ = SELECT * FROM Artifact.Generic.Collectors.File()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;That statement will not actually run the artifact (it is a lazy LET&#xA;statement) but the compiler&amp;rsquo;s static analyzer will identify the&#xA;artifact as a dependency and be able to inject it into the request.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to manage storage space on the server</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/deleting_old_data/</link>
      <pubDate>Fri, 19 Jul 2024 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/deleting_old_data/</guid>
      <description>&lt;h1 id=&#34;how-to-manage-storage-space-on-the-server&#34;&gt;How to manage storage space on the server&lt;/h1&gt;&#xA;&lt;p&gt;Velociraptor can collect a lot of data quickly but usually the data is&#xA;only relevant for short periods of time.&lt;/p&gt;&#xA;&lt;p&gt;Disk space management is an important part of Velociraptor&#xA;administrators tasks. You can keep an eye on the disk utilization as&#xA;shown on the dashboard.&lt;/p&gt;&#xA;&lt;p&gt;If you need to grow the disk during an investigation, and you are&#xA;using a cloud VM from Amazon with Elastic Block Storage (EBS), disk&#xA;space management is very easy. In the AWS cloud it is possible to&#xA;resize disk space dynamically. See &lt;a href=&#34;https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/requesting-ebs-volume-modifications.html&#34; target=&#34;_blank&#34; &gt;Requesting&#xA;Modifications&lt;/a&gt;&#xA;to Your EBS Volumes and &lt;a href=&#34;https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html&#34; target=&#34;_blank&#34; &gt;Extending a Linux File System After&#xA;Resizing&lt;/a&gt;&#xA;a Volume. You can do this without even restarting the server.&lt;/p&gt;&#xA;&lt;p&gt;If you must attach a new volume you can migrate data from the old&#xA;datastore directory (as specified in the config file) to the new&#xA;directory by simply copying all the files. You must ensure permissions&#xA;remain the same (typically files are owned by the &lt;code&gt;velociraptor&lt;/code&gt; low&#xA;privilege local linux account).&lt;/p&gt;&#xA;&lt;p&gt;It is also possible to start with an empty datastore directory and&#xA;only copy selected files:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;code&gt;users&lt;/code&gt; directory contains user accounts (hashed password etc)&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;acl&lt;/code&gt; directory contains user ACLs&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;artifact_definitions&lt;/code&gt; contains custom artifacts&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;config&lt;/code&gt; directory contains various configuration settings.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;orgs&lt;/code&gt; directory contains data from various orgs.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Velociraptor will automatically re-enroll clients with the same client&#xA;id (The client id is set by the client itself) as needed.&lt;/p&gt;&#xA;&lt;p&gt;You can also check the backups directory to recover from backup.&lt;/p&gt;&#xA;&lt;h2 id=&#34;management-of-old-collections&#34;&gt;Management of old collections&lt;/h2&gt;&#xA;&lt;p&gt;You can automatically delete old collections using the&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/artifact_references/pages/server.utils.deletemanyflows/&#34;&gt;Server.Utils.DeleteManyFlows&#xA;&lt;/a&gt; and&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/artifact_references/pages/server.utils.deletemonitoringdata/&#34;&gt;Server.Utils.DeleteMonitoringData&#xA;&lt;/a&gt;&#xA;artifacts. These are server artifacts which can delete flows and&#xA;monitoring data older than the specified time.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I enable password protected VFS downloads?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/download_password/</link>
      <pubDate>Mon, 18 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/download_password/</guid>
      <description>&lt;h1 id=&#34;how-do-i-enable-password-protected-vfs-downloads&#34;&gt;How do I enable password protected VFS downloads?&lt;/h1&gt;&#xA;&lt;p&gt;You can just export them from the GUI!&lt;/p&gt;&#xA;&lt;p&gt;Set the password in your user preferences you can enable password&#xA;protected exports.&lt;/p&gt;&#xA;&lt;p&gt;Highlight the directory you want to export.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/download_password//knowledge_base/tips/download_password/01.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1439&#34; height=&#34;551&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;01.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Hit the export button - this will start a server collection to take a&#xA;snapshot of the vfs - you can set any filtering globs (so for example&#xA;don&amp;rsquo;t export all the files - maybe only &lt;code&gt;*.exe&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/download_password//knowledge_base/tips/download_password/02.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;613&#34; height=&#34;308&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;02.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;By default it just does &lt;code&gt;**&lt;/code&gt; which is everything under the directory.&#xA;This makes a collection and adds a link to it.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/download_password//knowledge_base/tips/download_password/03.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;535&#34; height=&#34;260&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;03.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Then click that and export like any other collection.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/download_password//knowledge_base/tips/download_password/04.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1352&#34; height=&#34;604&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;04.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Password can be set in the user preferences (the top right tile&#xA;with the username).  This will enable the lock feature of the zip&#xA;export - make sure to click close button to save the password (instead&#xA;of just clicking outside the modal dialog).&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/download_password//knowledge_base/tips/download_password/05.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1079&#34; height=&#34;532&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;05.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do you generate random characters?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/random/</link>
      <pubDate>Wed, 09 Aug 2023 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/random/</guid>
      <description>&lt;h1 id=&#34;how-do-you-generate-random-characters&#34;&gt;How do you generate random characters?&lt;/h1&gt;&#xA;&lt;p&gt;Using the rand() function we can manipulate the results to output a character set then use the WHERE condition to filter for the characters of interest.&lt;/p&gt;&#xA;&lt;p&gt;For example output 32 random printable characters:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;  LET RandomChars = SELECT format(format=&amp;quot;%c&amp;quot;, args=rand(range=255)) AS Character&#xA;  FROM range(end=9999999999)&#xA;  WHERE Character =~ &amp;quot;[ -~]&amp;quot;&#xA;  LIMIT 32&#xA;&#xA;SELECT join(array=RandomChars.Character) as Characters FROM scope()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Modify the Character WHERE regex and LIMIT for desired results.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/random//knowledge_base/tips/random/259396221-15d5e7f3-f519-4446-bbcb-fb42d97f4197.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;&#34;&#xA;         width=&#34;1060&#34; height=&#34;274&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;259396221-15d5e7f3-f519-4446-bbcb-fb42d97f4197.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    &#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How can I clone an organization with all its hunts and artifacts to another instance?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/clone_organization_to_other_server/</link>
      <pubDate>Mon, 24 Jul 2023 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/clone_organization_to_other_server/</guid>
      <description>&lt;h1 id=&#34;how-can-i-clone-an-organization-with-all-its-hunts-and-artifacts-to-another-instance&#34;&gt;How can I clone an organization with all its hunts and artifacts to another instance?&lt;/h1&gt;&#xA;&lt;p&gt;There are a few use cases where you need to migrate data from an instance to another. It could be for educational purpose to provide pre-filled labs, or to provide a third party with the exact insights you had during your investigation. Event for archiving, being able to reload a dataset in Velociraptor to review what was done if something went amiss, being able to export and import an organization dataset could prove useful.&lt;/p&gt;&#xA;&lt;h2 id=&#34;exporting&#34;&gt;Exporting&lt;/h2&gt;&#xA;&lt;p&gt;Everything related to an organization is stored in a directory under &lt;code&gt;&amp;lt;file store&amp;gt;/orgs&lt;/code&gt;. There is:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A directory with the org ID&lt;/li&gt;&#xA;&lt;li&gt;A configuration file &lt;code&gt;&amp;lt;orgId&amp;gt;.json.db&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;We need to transfer both to the destination server.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Identify the org ID, either with the &lt;a href=&#34;https://www.velociraptor-docs.org/artifact_references/pages/server.orgs.listorgs/&#34;&gt;&lt;code&gt;Server.Orgs.ListOrgs&lt;/code&gt; Artifact&lt;/a&gt; or scrolling down the Velociraptor &lt;em&gt;root org&lt;/em&gt; home page.&lt;/li&gt;&#xA;&lt;li&gt;Archive the folder and the &lt;code&gt;json.db&lt;/code&gt; file (mind the star)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;tar czf transport-&amp;lt;org name&amp;gt;.tar.gz &amp;lt;file store&amp;gt;/orgs/&amp;lt;org id&amp;gt;* &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;Transfer the resulting archive to the destination Velociraptor server.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;importing&#34;&gt;Importing&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Decompress the archive under the &lt;code&gt;&amp;lt;file store&amp;gt;/orgs&lt;/code&gt; directory.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34; No orgs folder &#34;&gt;&lt;p&gt;The &lt;code&gt;orgs&lt;/code&gt; directory is created with the first organization. After a fresh install of Velociraptor, it doesn&amp;rsquo;t exist until you create an org. You may also simply create the directory.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;Verify file ownership and permissions are similar to other directories in the file store&lt;/li&gt;&#xA;&lt;li&gt;Start Velociraptor&lt;/li&gt;&#xA;&lt;li&gt;You should see the organization with all its content as it were on the origin server&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34; Can&amp;#39;t see the org &#34;&gt;&lt;p&gt;Upon startup, Velociraptor will run the workers linked to the organization, so you can find a trace of it in the logs, but you may only see it in GUI if you are granted permissions on it. Just edit with your favorite text editor: &lt;code&gt;&amp;lt;file store&amp;gt;/orgs/&amp;lt;org id&amp;gt;/acl/&amp;lt;username&amp;gt;.json.db&lt;/code&gt; to give the access rights to an existing user (or create a user with the name of a user who was allowed to see the org),&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;</description>
    </item>
    <item>
      <title>What to do about error &#34;Plugin info not found&#34;</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/plugin_not_found/</link>
      <pubDate>Fri, 05 May 2023 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/plugin_not_found/</guid>
      <description>&lt;h1 id=&#34;what-to-do-about-error-plugin-info-not-found&#34;&gt;What to do about error &amp;ldquo;Plugin info not found&amp;rdquo;&lt;/h1&gt;&#xA;&lt;p&gt;Velociraptor VQL queries can run on the server in the context of&#xA;server artifacts or notebook queries. Usually server side VQL is used&#xA;to post-process collected results, manage the server configuration,&#xA;schedule new collections etc.&lt;/p&gt;&#xA;&lt;p&gt;However, server side VQL can do a lot more than that - including shell&#xA;out to external binaries, read and write files on the server or&#xA;connect to external servers. In some deployments (especially shared&#xA;deployments) it is desirable to block any functionality on the server&#xA;which may interfere with other users or server security or&#xA;configuration.&lt;/p&gt;&#xA;&lt;p&gt;In recent Velociraptor versions the administrator can add an allow&#xA;list to the configuration file. This forces server side VQL to only&#xA;register plugins on the allow list, so potentially dangerous plugins&#xA;are not present at all (regardless of the Velociraptor permission&#xA;model).&lt;/p&gt;&#xA;&lt;p&gt;The configuration wizard will offer this functionality using the&#xA;question:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Do you want to restrict VQL functionality on the server?&#xA;&#xA;This is useful for a shared server where users are not fully trusted.&#xA;It removes potentially dangerous plugins like execve(),filesystem access etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you selected this during configuration you will receive these&#xA;errors in the notebook (or using the API) for any plugins not in the&#xA;allow list:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;ERROR:Plugin info not found.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you decide you need this particular plugin you can either add to&#xA;the allow list in the server configuration file. Or you may remove the&#xA;allow list entirely (which allows all plugins to be registered).&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Custom quarantine exclusions</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/quarantine/</link>
      <pubDate>Sat, 04 Mar 2023 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/quarantine/</guid>
      <description>&lt;h1 id=&#34;custom-quarantine-exclusions&#34;&gt;Custom quarantine exclusions&lt;/h1&gt;&#xA;&lt;p&gt;We may want to add custom exclusions to Velociraptor quarantine and allow communication to another IP&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Add machine in scope to a new label: e.g NewQuarantine&lt;/li&gt;&#xA;&lt;li&gt;Remove standard quarantine&lt;/li&gt;&#xA;&lt;li&gt;Run a hunt targeting your label above or a collection on the single machine&lt;/li&gt;&#xA;&lt;li&gt;Select relevant quarantine content:  Windows.Remediation.Quarantine&lt;/li&gt;&#xA;&lt;li&gt;Add additional IP exclusions&#xA;Action = Permit&#xA;SrcAddr = me&#xA;DstAddr = IP to exclude&#xA;Mirrored = yes for bidirectional communication&#xA;Description&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/quarantine/https://user-images.githubusercontent.com/13081800/222630435-4882554a-eefa-4a78-9ae2-fe41d3d60874.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;image&#34; /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    image&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How can I convert decimal?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/decimaldecode/</link>
      <pubDate>Wed, 02 Nov 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/decimaldecode/</guid>
      <description>&lt;h1 id=&#34;how-can-i-convert-decimal&#34;&gt;How can I convert decimal?&lt;/h1&gt;&#xA;&lt;p&gt;During investigation you may find logs or other data with decimal-encoded strings - we can leverage the format() function to convert to data.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET decimal = ( 91,78,101,116,46,83,101,114,118,105,99,101,80,111,105,110,116,77,97,110,97,103,101,114,93,58,58,83,101,114,118,101,114,67,101,114,116,105,102,105,99,97,116,101,86,97,108,105,100,97,116,105,111,110,67,97,108,108,98,97,99,107,32,61,32,123,36,116,114,117,101,125,10,116,114,121,123,10,91,82,101,102,93,46,65,115,115,101,109,98,108,121,46,71,101,116,84,121,112,101,40,39,83,121,115,39,43,39,116,101,109,46,77,97,110,39,43,39,97,103,101,109,101,110,116,46,65,117,116,39,43,39,111,109,97,116,105,111,110,46,65,109,39,43,39,115,105,85,116,39,43,39,105,108,115,39,41,46,71,101,116,70,105,101,108,100,40,39,97,109,39,43,39,115,105,73,110,105,39,43,39,116,70,97,105,108,101,100,39,44,32,39,78,111,110,80,39,43,39,117,98,108,105,99,44,83,116,97,39,43,39,116,105,99,39,41,46,83,101,116,86,97,108,117,101,40,36,110,117,108,108,44,32,36,116,114,117,101,41,10,125,99,97,116,99,104,123,125,10,91,78,101,116,46,83,101,114,118,105,99,101,80,111,105,110,116,77,97,110,97,103,101,114,93,58,58,83,101,114,118,101,114,67,101,114,116,105,102,105,99,97,116,101,86,97,108,105,100,97,116,105,111,110,67,97,108,108,98,97,99,107,32,61,32,123,36,116,114,117,101,125,10,91,83,121,115,116,101,109,46,78,101,116,46,83,101,114,118,105,99,101,80,111,105,110,116,77,97,110,97,103,101,114,93,58,58,83,101,99,117,114,105,116,121,80,114,111,116,111,99,111,108,32,61,32,91,83,121,115,116,101,109,46,78,101,116,46,83,101,99,117,114,105,116,121,80,114,111,116,111,99,111,108,84,121,112,101,93,39,83,115,108,51,44,84,108,115,44,84,108,115,49,49,44,84,108,115,49,50,39,10,73,69,88,32,40,78,101,119,45,79,98,106,101,99,116,32,78,101,116,46,87,101,98,67,108,105,101,110,116,41,46,68,111,119,110,108,111,97,100,83,116,114,105,110,103,40,39,104,116,116,112,115,58,47,47,49,48,46,48,46,49,46,55,58,52,52,51,47,73,110,118,111,107,101,45,77,105,109,105,107,97,116,122,46,112,115,49,39,41,10,36,99,109,100,32,61,32,73,110,118,111,107,101,45,77,105,109,105,107,97,116,122,32,45,67,111,109,109,97,110,100,32,39,112,114,105,118,105,108,101,103,101,58,58,100,101,98,117,103,32,115,101,107,117,114,108,115,97,58,58,108,111,103,111,110,112,97,115,115,119,111,114,100,115,32,101,120,105,116,39,10,36,114,101,113,117,101,115,116,32,61,32,91,83,121,115,116,101,109,46,78,101,116,46,87,101,98,82,101,113,117,101,115,116,93,58,58,67,114,101,97,116,101,40,39,104,116,116,112,115,58,47,47,49,48,46,48,46,49,46,55,58,52,52,51,47,39,41,10,36,114,101,113,117,101,115,116,46,77,101,116,104,111,100,32,61,32,39,80,79,83,84,39,10,36,114,101,113,117,101,115,116,46,67,111,110,116,101,110,116,84,121,112,101,32,61,32,39,97,112,112,108,105,99,97,116,105,111,110,47,120,45,119,119,119,45,102,111,114,109,45,117,114,108,101,110,99,111,100,101,100,39,10,36,98,121,116,101,115,32,61,32,91,83,121,115,116,101,109,46,84,101,120,116,46,69,110,99,111,100,105,110,103,93,58,58,65,83,67,73,73,46,71,101,116,66,121,116,101,115,40,36,99,109,100,41,10,36,114,101,113,117,101,115,116,46,67,111,110,116,101,110,116,76,101,110,103,116,104,32,61,32,36,98,121,116,101,115,46,76,101,110,103,116,104,10,36,114,101,113,117,101,115,116,83,116,114,101,97,109,32,61,32,36,114,101,113,117,101,115,116,46,71,101,116,82,101,113,117,101,115,116,83,116,114,101,97,109,40,41,10,36,114,101,113,117,101,115,116,83,116,114,101,97,109,46,87,114,105,116,101,40,36,98,121,116,101,115,44,32,48,44,32,36,98,121,116,101,115,46,76,101,110,103,116,104,41,10,36,114,101,113,117,101,115,116,83,116,114,101,97,109,46,67,108,111,115,101,40,41,10,36,114,101,113,117,101,115,116,46,71,101,116,82,101,115,112,111,110,115,101,40,41 )&#xA;&#xA;LET convert_decimal(data) = SELECT format(format=&#39;%c&#39;,args=_value) as Value FROM foreach(row=data)&#xA;&#xA;SELECT join(array=convert_decimal(data=decimal).Value,sep=&#39;&#39;) as Data FROM scope()&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/decimaldecode/https://user-images.githubusercontent.com/13081800/199373835-a27910e7-40ea-4dcc-a818-baff4e19b40c.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;image&#34; /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    image&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I re-collect a failed artifact in a hunt?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/retry_hunt/</link>
      <pubDate>Sat, 10 Sep 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/retry_hunt/</guid>
      <description>&lt;h1 id=&#34;how-do-i-re-collect-a-failed-artifact-in-a-hunt&#34;&gt;How do I re-collect a failed artifact in a hunt?&lt;/h1&gt;&#xA;&lt;p&gt;Sometimes collecting an artifact in a hunt does not work as&#xA;expected.&lt;/p&gt;&#xA;&lt;p&gt;Most commonly the issue is that the timeout or upload limit&#xA;for collecting the artifact is exceeded and Velociraptor cancels the&#xA;collection to prevent placing the endpoint under too much strain.&lt;/p&gt;&#xA;&lt;p&gt;How do we work around this? We can recollect the artifact only on that&#xA;failed endpoint with a few button clicks.&lt;/p&gt;&#xA;&lt;p&gt;In the following example I will start a collection for the &lt;code&gt;$MFT&lt;/code&gt; but&#xA;I will only set the timeout to 10 seconds and &lt;code&gt;100Mb&lt;/code&gt; uploaded.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/retry_hunt//knowledge_base/tips/retry_hunt/hunting_by_label.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Hunting for Files&#34;&#xA;         width=&#34;844&#34; height=&#34;555&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;hunting_by_label.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Hunting for Files&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;In the hunt resources screen I can specify limits for collection from&#xA;any one client. These limits are intended to set reasonable boundaries&#xA;for how much data I am expecting to collect so we do not overload the&#xA;network or the endpoint itself.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/retry_hunt//knowledge_base/tips/retry_hunt/setting_resources.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Setting resource limits&#34;&#xA;         width=&#34;855&#34; height=&#34;538&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;setting_resources.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Setting resource limits&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Clearly these limits are too small for this client because the&#xA;collection was cancelled after 10 seconds. Normally the default&#xA;timeout of 10 Minutes, but collecting such a lot of data may take&#xA;longer than that.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/retry_hunt//knowledge_base/tips/retry_hunt/timed_out.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Collection timed out&#34;&#xA;         width=&#34;1519&#34; height=&#34;763&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;timed_out.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Collection timed out&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Although some data was transferred, not all the data was fully&#xA;collected. This might be acceptable but if this machine is really&#xA;compromised how can I recollect the same artifact?&lt;/p&gt;&#xA;&lt;p&gt;By inspecting the collections for each client in the &lt;code&gt;Clients&lt;/code&gt; tab, I&#xA;can quickly see which one failed.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/retry_hunt//knowledge_base/tips/retry_hunt/failed_collection.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Inspecting failed collection&#34;&#xA;         width=&#34;1833&#34; height=&#34;447&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;failed_collection.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Inspecting failed collection&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Since a hunt is just a grouping of regular collections, I can navigate&#xA;to the client in the interface (by clicking the client button) and&#xA;find the hunt&amp;rsquo;s collection that failed.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/retry_hunt//knowledge_base/tips/retry_hunt/copy_collection.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Copying the collection&#34;&#xA;         width=&#34;998&#34; height=&#34;266&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;copy_collection.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Copying the collection&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Now I just copy the collection as normal and here I can update the&#xA;resource limits if needed (or maybe change some of the parameters).&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/retry_hunt//knowledge_base/tips/retry_hunt/successful_collection.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Successful Collection&#34;&#xA;         width=&#34;1884&#34; height=&#34;530&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;successful_collection.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Successful Collection&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Now that this collection is completed I can just look at the results&#xA;of the collections by itself or download the collection files for&#xA;further analysis.&lt;/p&gt;&#xA;&lt;p&gt;However, it is much more useful to keep all related collections in the&#xA;same hunt. This helps when analyzing the hunt results in the notebook&#xA;or exporting all the related files at once.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34; Hunts are a set of collections &#34;&gt;&lt;p&gt;It is best to think of a &lt;code&gt;hunt&lt;/code&gt; as just a set of related artifact&#xA;collections. You can add/remove collections from this set at will.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;p&gt;I am adding the new collection to the hunt manually by clicking the&#xA;&lt;code&gt;Add to Hunt&lt;/code&gt; button.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/retry_hunt//knowledge_base/tips/retry_hunt/manually_adding_hunt_collection.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Manually Adding the collection to the hunt&#34;&#xA;         width=&#34;1280&#34; height=&#34;454&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;manually_adding_hunt_collection.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Manually Adding the collection to the hunt&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The interface shows me all hunts that collected the same artifact so I&#xA;choose which hunt to add it to.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/retry_hunt//knowledge_base/tips/retry_hunt/new_hunt_collection.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;The new collection is now part of the hunt&#34;&#xA;         width=&#34;1876&#34; height=&#34;550&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;new_hunt_collection.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    The new collection is now part of the hunt&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Now the new successful collection is part of the hunt. I can see it as&#xA;a second entry in the client&amp;rsquo;s list.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices note&#34;&gt;&#xA;  &lt;div heading=&#34; Deleting the old collection &#34;&gt;&lt;p&gt;Velociraptor does not automatically delete the old failed collection&#xA;because it may still have some useful data (some data &lt;strong&gt;was&lt;/strong&gt;&#xA;transferred).&lt;/p&gt;&#xA;&lt;p&gt;If you do not want the old data any more, then just click the &lt;code&gt;Delete Flow&lt;/code&gt; button once a better collection is available.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;using-vql&#34;&gt;Using VQL&lt;/h2&gt;&#xA;&lt;p&gt;The above discussion was how to manually redo collections in the GUI&#xA;but if there are many collections, it might be easier to use VQL to do&#xA;this.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET NewCollections = SELECT ClientId, FlowId,&#xA;    collect_client(client_id=ClientId,&#xA;        artifacts=Flow.request.artifacts,&#xA;        spec=Flow.request.specs,&#xA;        max_bytes=1000000000,&#xA;        timeout=600) AS NewCollection&#xA;FROM hunt_flows(hunt_id=HuntId)&#xA;WHERE Flow.state =~ &amp;quot;ERROR&amp;quot;&#xA;&#xA;SELECT ClientId, NewCollection, hunt_add(&#xA;   client_id=ClientId,&#xA;   hunt_id=HuntId,&#xA;   flow_id=NewCollection.flow_id) AS Hunt&#xA;FROM NewCollections&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The &lt;code&gt;NewCollections&lt;/code&gt; query gets all Flows in the &lt;code&gt;ERROR&lt;/code&gt; state&#xA;within a hunt and schedules a new collection using the same&#xA;artifacts but increasing the maximum upload size to 1gb and timeout&#xA;to 600 seconds.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The next query adds the new collection to the hunt.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Note this query will only work after &lt;a href=&#34;https://github.com/Velocidex/velociraptor/commit/768021225bd617bb279fe424dcdf29c6d7d467b4&#34; target=&#34;_blank&#34; &gt;#2067&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to control hunting by label groups?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/hunt_by_label/</link>
      <pubDate>Sat, 10 Sep 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/hunt_by_label/</guid>
      <description>&lt;h1 id=&#34;how-to-control-hunting-by-label-groups&#34;&gt;How to control hunting by label groups?&lt;/h1&gt;&#xA;&lt;p&gt;In Velociraptor, &lt;code&gt;Hunts&lt;/code&gt; are sets of the same collections across&#xA;clients. For example, a hunt for &lt;code&gt;Scheduled Tasks&lt;/code&gt; will automatically&#xA;collect the scheduled tasks from each client.&lt;/p&gt;&#xA;&lt;p&gt;When creating the hunt it is possible to target the hunt to a&#xA;&lt;code&gt;Label&lt;/code&gt;. This only schedules the hunt on clients that have that same&#xA;label. This is useful when collecting a lot of data which does not&#xA;make sense to collect from every machine in the fleet. For example in&#xA;the following screenshot I am limiting the heavy triaging collection&#xA;to machines with the label &lt;code&gt;Triage&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/hunt_by_label//knowledge_base/tips/hunt_by_label/limiting_hunts.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Limiting a hunt to a label&#34;&#xA;         width=&#34;1018&#34; height=&#34;694&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;limiting_hunts.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Limiting a hunt to a label&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;assigning-clients-to-the-hunt&#34;&gt;Assigning clients to the hunt.&lt;/h2&gt;&#xA;&lt;p&gt;Normally when we limit a hunt for a label we immediately schedule the&#xA;hunt on all machines with that label.&lt;/p&gt;&#xA;&lt;p&gt;However it also works the other way around - When a label is added on&#xA;a client, if the hunt targets this label, the client will be&#xA;automatically added to the hunt!&lt;/p&gt;&#xA;&lt;p&gt;This means it is possible to create heavy hunts targeting specific&#xA;labels, and then as the investigation progresses, simply assign the&#xA;label to the client to automatically cause the hunt to collect on that&#xA;client.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/hunt_by_label//knowledge_base/tips/hunt_by_label/apply_label.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Apply a label to a client to trigger hunt participation&#34;&#xA;         width=&#34;791&#34; height=&#34;363&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;apply_label.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Apply a label to a client to trigger hunt participation&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I get the latest release binary?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/getting_latest_release/</link>
      <pubDate>Sat, 03 Sep 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/getting_latest_release/</guid>
      <description>&lt;h1 id=&#34;how-do-i-get-the-latest-release-binary&#34;&gt;How do I get the latest release binary?&lt;/h1&gt;&#xA;&lt;p&gt;The Velociraptor release process uses a release branch to prepare a&#xA;new release. Releases go through a release candidate (RC) process with&#xA;one or more release builds.  Sometimes after the release a new patch&#xA;release is made to backport critical bug fixes.&lt;/p&gt;&#xA;&lt;p&gt;If you need to automate downloading of the latest release binary,&#xA;simply use the GitHub API which presents detailed release information&#xA;in JSON form. You can use a tool such as &lt;code&gt;jq&lt;/code&gt; to extract the download&#xA;URL:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;WINDOWS_URL=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq&#xA;-r &#39;[.assets | sort_by(.created_at) | reverse | .[] | .browser_download_url | select(test(&amp;quot;windows-amd64.exe$&amp;quot;))][0]&#39;)&#xA;LINUX_URL=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq&#xA;-r &#39;[.assets | sort_by(.created_at) | reverse | .[] | .browser_download_url | select(test(&amp;quot;linux-amd64$&amp;quot;))][0]&#39;)&#xA;MACOS_URL=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq&#xA;-r &#39;[.assets | sort_by(.created_at) | reverse | .[] | .browser_download_url | select(test(&amp;quot;darwin-amd64$&amp;quot;))][0]&#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The above &lt;code&gt;jq&lt;/code&gt; filter sorts all asserts by creation data and filters&#xA;the relevant binaries, then extracts the most recent binary.&lt;/p&gt;&#xA;&lt;p&gt;Powershell can also be used to download the latest binary for 64 bit Windows as per this example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-PowerShell&#34;&gt;#Get the latest entry from the GitHub API&#xA;$VeloLatest = Invoke-WebRequest https://api.github.com/repos/velocidex/velociraptor/releases/latest&#xA;#Parse out the url to the binary&#xA;$VeloURL = ($VeloLatest.content | convertfrom-json).assets.browser_download_url | select-string windows-amd64.exe | select-object -First 1&#xA;#Download and write to a file&#xA;Invoke-WebRequest -Uri $VeloURL.tostring() -OutFile velociraptor.exe&#xA;#Verify the Authenticode Signature&#xA;Get-AuthenticodeSignature .\velociraptor.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;verifying-signatures&#34;&gt;Verifying signatures&lt;/h2&gt;&#xA;&lt;p&gt;Velociraptor releases are signed using Authenticode on Windows as well&#xA;as using GPG. To verify the signatures using gpg:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ gpg --verify velociraptor-v0.6.5-2-linux-amd64.sig&#xA;gpg: assuming signed data in &#39;velociraptor-v0.6.5-2-linux-amd64&#39;&#xA;gpg: Signature made Wed Jul 27 02:49:33 2022 AEST&#xA;gpg:                using RSA key 0572F28B4EF19A043F4CBBE0B22A7FB19CB6CFA1&#xA;gpg: Good signature from &amp;quot;Velociraptor Team (Velociraptor - Dig deeper!  https://docs.velociraptor.app/) &amp;lt;support@velocidex.com&amp;gt;&amp;quot; [unknown]&#xA;gpg: WARNING: This key is not certified with a trusted signature!&#xA;gpg:          There is no indication that the signature belongs to the owner.&#xA;Primary key fingerprint: 0572 F28B 4EF1 9A04 3F4C  BBE0 B22A 7FB1 9CB6 CFA1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You may need to import the key first into your keyring:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ gpg --receive-keys 0572F28B4EF19A043F4CBBE0B22A7FB19CB6CFA1&#xA;gpg: key B22A7FB19CB6CFA1: public key &amp;quot;Velociraptor Team (Velociraptor - Dig deeper!  https://docs.velociraptor.app/) &amp;lt;support@velocidex.com&amp;gt;&amp;quot; imported&#xA;gpg: Total number processed: 1&#xA;gpg:               imported: 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;div class=&#34;mynotices warning&#34;&gt;&#xA;  &lt;div heading=&#34; API limiting &#34;&gt;&lt;p&gt;GitHub limits how many unauthenticated API requests are allowed per IP&#xA;address. If you need to increase this limit, create a personal access&#xA;token (see&#xA;&lt;a href=&#34;https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token&#34; target=&#34;_blank&#34; &gt;https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token&lt;/a&gt;)&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;</description>
    </item>
    <item>
      <title>How can I url/percent decode a string?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/urldecode/</link>
      <pubDate>Mon, 06 Jun 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/urldecode/</guid>
      <description>&lt;h1 id=&#34;how-can-i-urlpercent-decode-a-string&#34;&gt;How can I url/percent decode a string?&lt;/h1&gt;&#xA;&lt;p&gt;During investigation you may find logs or other data with percent-encoded strings.&#xA;Since 0.6.5 we have included a lambda function in regex_replace() that enables decode and managing errors to enable analysis.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET Line = &#39;&#39;&#39;http://target/login.asp?userid=bob%27%3b%20update%20logintable%20set%20passwd%3d%270wn3d%27%3b--%00&#39;&#39;&#39;&#xA;&#xA;SELECT regex_replace(source=Line, replace_lambda=&amp;quot;x=&amp;gt;unhex(string=x[1:]) || x&amp;quot;, re=&amp;quot;%..&amp;quot;) as Decoded FROM scope() &#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/urldecode/https://user-images.githubusercontent.com/13081800/172098424-d78c73f9-e7d2-405b-99ca-129eba4350c0.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Url Decode: results&#34; /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    Url Decode: results&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Similarly, to URL encode we can run a similar function:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET Line = &#39;&#39;&#39;http://target/login.asp?userid=bob&#39;; update logintable set passwd=&#39;0wn3d&#39;;--&#39;&#39;&#39;&#xA;&#xA;SELECT&#xA;    url(path=Line).String[1:] as URLFunction,&#xA;    regex_replace(source=Line,replace_lambda=&amp;quot;x=&amp;gt;format(format=&#39;%%%02x&#39;,args=x)&amp;quot;, re=&amp;quot;[^a-z0-9\\-_.~:/?]&amp;quot;) as ManualMethod&#xA;FROM scope()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/urldecode/https://user-images.githubusercontent.com/13081800/187116187-9347d6be-5566-49b0-98d6-65ce0d2ff0cc.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Url Encode: results&#34; /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    Url Encode: results&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How can I make a multipart/form-data POST request in VQL</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/multiparts_uploads/</link>
      <pubDate>Sat, 21 May 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/multiparts_uploads/</guid>
      <description>&lt;h1 id=&#34;how-can-i-make-a-multipartform-data-post-request-in-vql&#34;&gt;How can I make a multipart/form-data POST request in VQL&lt;/h1&gt;&#xA;&lt;p&gt;&lt;em&gt;NOTE: The technique described in this article should no longer be necessary&#xA;since the&lt;code&gt;http_client&lt;/code&gt; plugin now&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/popular/http_client/#example---uploading-files&#34;&gt;supports multipart uploads&lt;/a&gt;.&#xA;However this information may still be useful in certain circumstances and for&#xA;providing insight into advanced VQL.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;VQL can be used to make http requests using the &lt;code&gt;http_client()&lt;/code&gt;&#xA;plugin. While &lt;code&gt;GET&lt;/code&gt; requests are usually pretty straight forward,&#xA;sometimes we need to upload using something called&#xA;&lt;code&gt;multipart/form-data&lt;/code&gt; POST. What is it and how can VQL do this?&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-multipartform-data-post&#34;&gt;What is &lt;code&gt;multipart/form-data&lt;/code&gt; POST?&lt;/h2&gt;&#xA;&lt;p&gt;This is a standard way of serializing multiple &amp;ldquo;parts&amp;rdquo; into a single&#xA;request. A &amp;ldquo;part&amp;rdquo; here is a value of a parameter or usually a&#xA;file. Traditionally this came from a HTML &amp;ldquo;form&amp;rdquo; element, but often&#xA;these are used for APIs now without a browser interface at all.&lt;/p&gt;&#xA;&lt;p&gt;The idea is that we define a &amp;ldquo;boundary&amp;rdquo; - a special string which is so&#xA;unique it might not appear accidentally in the data, then we separate&#xA;the parts using this boundary:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;--boundary&#xA;Headers&#xA;&#xA;Data&#xA;--boundary&#xA;Headers&#xA;&#xA;Data&#xA;--boundary--&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Each part starts with &amp;ldquo;&amp;ndash;&amp;rdquo; followed by the boundary and a line feed.&lt;/li&gt;&#xA;&lt;li&gt;Next come the headers which describe things about this part&#xA;followed by two line feeds.&lt;/li&gt;&#xA;&lt;li&gt;Next come the body of the part&lt;/li&gt;&#xA;&lt;li&gt;Finally after the last part, the end is signaled by &amp;ldquo;&amp;ndash;&amp;rdquo; followed&#xA;by the boundary and another &amp;ldquo;&amp;ndash;&amp;rdquo; followed by new line.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The most confusing part of this is that when looking at examples, the&#xA;boundary is often something like&#xA;&lt;code&gt;-----------------------------9051914041544843365972754266&lt;/code&gt; making it&#xA;virtually impossible to see the extra &amp;ldquo;&amp;ndash;&amp;rdquo; at the start and end (you&#xA;have to carefully count to realize the boundary header adds two&#xA;extra dashes!).&lt;/p&gt;&#xA;&lt;h2 id=&#34;combining-in-vql&#34;&gt;Combining in VQL&lt;/h2&gt;&#xA;&lt;p&gt;Anyway once the whole this is demystified it is really easy to create&#xA;this in VQL. Here is an example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET Boundary = &amp;quot;-----------------------------9051914041544843365972754266&amp;quot;&#xA;&#xA;-- A Helper function to make a regular form variable.&#xA;LET Data(Name, Value) = format(&#xA;  format=&#39;--%s\r\nContent-Disposition: form-data; name=&amp;quot;%s&amp;quot;\r\n\r\n\r\n%v\r\n&#39;,&#xA;  args=[Boundary, Name, Value])&#xA;&#xA;-- A Helper function to embed a file content.&#xA;LET File(Filename, ParameterName, ContentType, Data) = format(&#xA;  format=&#39;--%s\r\nContent-Disposition: form-data; name=&amp;quot;%s&amp;quot;; filename=&amp;quot;%s&amp;quot;\r\nContent-Type: %s\r\n\r\n%v\r\n&#39;,&#xA;  args=[Boundary, ParameterName, Filename, ContentType, Data])&#xA;&#xA;-- The End boundary signals the last part&#xA;LET END = format(format=&amp;quot;%s--\r\n&amp;quot;, args=Boundary)&#xA;&#xA;-- Now make the HTTP request and post the form&#xA;-- Remember the Content-Type header which includes the boundary!&#xA;SELECT * FROM http_client(&#xA;  method=&amp;quot;POST&amp;quot;,&#xA;  url=&amp;quot;http://www.example.com/formhandler&amp;quot;,&#xA;  headers=dict(`Content-Type`=&amp;quot;multipart/form-data; boundary=&amp;quot; + Boundary),&#xA;  data=Data(Name=&amp;quot;name&amp;quot;, Value=&amp;quot;Bar&amp;quot;) +&#xA;       File(Filename=&amp;quot;Hello.txt&amp;quot;, ParameterName=&amp;quot;file_upload&amp;quot;, ContentType=&amp;quot;text/plain&amp;quot;, Data=&amp;quot;this is a test&amp;quot;) +&#xA;       END)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In this example I used some utility functions to make it easier to build the&#xA;different parts and make sure the encoding structure is always correct.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Applying labels to hunt results</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/huntlabel/</link>
      <pubDate>Fri, 20 May 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/huntlabel/</guid>
      <description>&lt;h1 id=&#34;applying-labels-to-hunt-results&#34;&gt;Applying labels to hunt results&lt;/h1&gt;&#xA;&lt;p&gt;Sometimes it is useful to label clients from a hunt.&lt;/p&gt;&#xA;&lt;p&gt;For the following example, I will label all machines with rows from the Windows.Carving.CobaltStrike artifact with a label &amp;ldquo;CobaltStrike&amp;rdquo;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT ClientId,Fqdn,Rule,&#xA;    label(client_id=ClientId,labels=[&#39;CobaltStrike&#39;],op=&#39;set&#39;) as SetLabel&#xA;FROM source(artifact=&amp;quot;Windows.Carving.CobaltStrike&amp;quot;)&#xA;GROUP BY ClientId&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/huntlabel/https://user-images.githubusercontent.com/13081800/169450498-39d31902-81ec-4b7c-8c6c-72abe0419c7e.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Label clients from hunt&#34; /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    Label clients from hunt&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How can I quickly reconfigure an offline collector?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/reconfigure_offline_collector/</link>
      <pubDate>Fri, 06 May 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/reconfigure_offline_collector/</guid>
      <description>&lt;h1 id=&#34;how-can-i-quickly-reconfigure-an-offline-collector&#34;&gt;How can I quickly reconfigure an offline collector?&lt;/h1&gt;&#xA;&lt;p&gt;The offline collector is a pre-configured version of Velociraptor that&#xA;automatically collects certain artifacts when invoked with no command line args.&lt;/p&gt;&#xA;&lt;p&gt;The offline collector is a full Velociraptor binary that simply has a custom&#xA;configuration embedded. So you can still use the collector binary to perform any&#xA;operations that an unmodified Velociraptor binary is capable of.&lt;/p&gt;&#xA;&lt;p&gt;Usually the collector is built using the GUI by selecting the correct artifacts&#xA;and injecting parameters into the embedded configuration file. But sometimes we&#xA;might want to slightly modify the embedded configuration, and firing up a GUI to&#xA;rebuild a new collector from scratch is a bit too much work.&lt;/p&gt;&#xA;&lt;p&gt;Here we describe an easy way to quickly modify the embedded configuration, which&#xA;is suitable for small changes in the embedded configuration. While it is&#xA;recommended that you use the GUI to prepare a completely new collector, for&#xA;small tweaks to an existing offline collector this method may be quicker.&lt;/p&gt;&#xA;&lt;p&gt;Also note that you can override or append command line arguments to those&#xA;embedded in and offline collector using&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/cli/#autoexec-mode-and-post-args&#34;&gt;post-args&lt;/a&gt;,&#xA;which may be sufficient when you want to change the collector behaviour on a&#xA;once-off basis.&lt;/p&gt;&#xA;&lt;h2 id=&#34;general-method&#34;&gt;General Method&lt;/h2&gt;&#xA;&lt;p&gt;Assuming you have an existing offline collector named&#xA;&lt;code&gt;Collector_velociraptor-v0.74.3-windows-amd64.exe&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;First extract the existing embedded config from the collector into a local&#xA;file:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;Collector_velociraptor-v0.74.3-windows-amd64.exe config show &amp;gt; config.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Next, edit the config file - for example, you might want to tweak one or two&#xA;parameters.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Finally, repack the new configuration file into a new collector:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;Collector_velociraptor-v0.74.3-windows-amd64.exe config repack config.yaml new_collector.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can verify that the new collector has the modified configuration using&#xA;&lt;code&gt;new_collector.exe config show&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In the example above the &lt;code&gt;config repack&lt;/code&gt; command repacked the collector config&#xA;into a copy of the binary which invoked the command. This is the default&#xA;behaviour. If you wish to repack into a different binary then please see the&#xA;next section.&lt;/p&gt;&#xA;&lt;p&gt;Also note that the commands above are invoked using the offline collector binary&#xA;itself, since this is just a normal Velociraptor binary which happens to have an&#xA;embedded config. This is just for convenience - you could use any Velociraptor&#xA;binary on any platform to do the config extraction or repacking, provided you&#xA;also supply it with the target binary that it will use in generating the output&#xA;file (see next section).&lt;/p&gt;&#xA;&lt;h3 id=&#34;repacking-to-a-different-binary&#34;&gt;Repacking to a different binary&lt;/h3&gt;&#xA;&#xA;&lt;div class=&#34;mynotices warning&#34;&gt;&#xA;  &lt;div heading=&#34; Limitations &#34;&gt;&lt;p&gt;Repacking the config into a different binary will not transfer any bundled tools&#xA;to the new binary! This will cause the collection to fail if the offline&#xA;collector can&amp;rsquo;t access these tools from an alternative location, such as from a&#xA;URL defined in the embedded artifacts&amp;rsquo; tool definitions. And even if it can&#xA;download the tool from an external location, you may not want it to.&lt;/p&gt;&#xA;&lt;p&gt;If your collector uses artifacts which use tools then you should NOT use the&#xA;method described here. You should instead rebuild your offline collector using&#xA;the GUI or the CLI &lt;code&gt;collector&lt;/code&gt; command.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;p&gt;You can use the &lt;code&gt;--exe&lt;/code&gt; flag to specify a different target binary. This allows&#xA;you to transfer an existing collector config to a different architecture, and/or&#xA;to a newer binary version. For example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;# from Windows amd64 to i386&#xA;velociraptor-v0.74.3-windows-amd64.exe config repack --exe velociraptor-v0.74.3-windows-386.exe config.yaml new_collector.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;# using Linux to repack a Windows collector&#xA;./velociraptor-v0.74.3-linux-amd64 config repack --exe velociraptor-v0.74.3-windows-amd64.exe config.yaml new_collector.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;repacking-a-generic-collector&#34;&gt;Repacking a Generic Collector&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/offline_collections/&#34;&gt;Generic Collector&lt;/a&gt;&#xA;is independent of any binary. It&amp;rsquo;s essentially a standalone collector config&#xA;with compression applied. This allows it to be used with any Velociraptor binary&#xA;since it is external to the binary.&lt;/p&gt;&#xA;&lt;p&gt;You can unpack the Generic Collector into uncompressed YAML as follows:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;First extract the existing embedded config from the collector into a local&#xA;file:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;velociraptor config show --embedded_config Collector_velociraptor-collector &amp;gt; Collector_velociraptor-collector.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Then make minor tweaks if needed, as mentioned above.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;And then repack it back into the Generic Collector format using the &lt;code&gt;--exe&lt;/code&gt;&#xA;flag. In this case the &amp;ldquo;exe&amp;rdquo; can be any generic collector file including the&#xA;default &amp;ldquo;blank&amp;rdquo; one available on our&#xA;&lt;a href=&#34;https://github.com/Velocidex/velociraptor/releases&#34; target=&#34;_blank&#34; &gt;GitHub Releases page&lt;/a&gt;&#xA;(named &lt;code&gt;velociraptor-collector&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;velociraptor config repack --exe velociraptor-collector Collector_velociraptor-collector.yaml new_generic-collector&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Even though the &lt;code&gt;velociraptor-collector&lt;/code&gt; file is not actually an exe, this works&#xA;because the generic collector file contains the same embedding section as any&#xA;Velociraptor binary, so the &lt;code&gt;config repack&lt;/code&gt; command recognizes it as a valid&#xA;binary and therefore allows it as an alternative repacking target.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How can I override the configuration file?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/merging_config/</link>
      <pubDate>Tue, 26 Apr 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/merging_config/</guid>
      <description>&lt;h1 id=&#34;how-can-i-override-the-configuration-file&#34;&gt;How can I override the configuration file?&lt;/h1&gt;&#xA;&lt;p&gt;Velociraptor relies on the configuration file to control the operation&#xA;of the server or client. Usually the configuration file is generated&#xA;interactively using the &lt;code&gt;velociraptor config generate -i&lt;/code&gt; command.&lt;/p&gt;&#xA;&lt;p&gt;Many people want to automate the configuration generation or override&#xA;the configuration in some way. This short tip covers some of the&#xA;common ways to do that.&lt;/p&gt;&#xA;&lt;h2 id=&#34;automating-configuration-generation&#34;&gt;Automating configuration generation.&lt;/h2&gt;&#xA;&lt;p&gt;When generating a new configuration, Velociraptor will generate new&#xA;key material and create a reasonable skeleton for the supported&#xA;deployment scenario. In the following command, Velociraptor will emit&#xA;a basic configuration file template to standard output, which can be&#xA;easily redirected to a file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ velociraptor-v0.6.4-linux-amd64 config generate &amp;gt; /tmp/config.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To customize the generated configuration we can apply a JSON&#xA;merge/patch step. &lt;a href=&#34;https://datatracker.ietf.org/doc/html/rfc7396&#34; target=&#34;_blank&#34; &gt;JSON&#xA;merge&lt;/a&gt; and &lt;a href=&#34;http://jsonpatch.com/&#34; target=&#34;_blank&#34; &gt;JSON&#xA;patch&lt;/a&gt; are standard ways of specifying a&#xA;transformation on a JSON object.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34;tip&#34;&gt;&lt;p&gt;Normally the configuration file is in YAML but you can also view it in&#xA;JSON using the &lt;code&gt;--json&lt;/code&gt; flag to the &lt;code&gt;config show&lt;/code&gt; command:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;velociraptor --config config.yaml config show --json&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Since YAML is a superset of JSON you can also provide this JSON blob&#xA;to Velociraptor as the actual configuration (no need to convert it&#xA;back to YAML). This helps to prepare the JSON merge patch - simply&#xA;remove the fields you dont want to change and change the fields you do&#xA;want to change.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;p&gt;For example, imagine we want to specify a new URL for clients to&#xA;connect to. We can merge the following JSON blob with the config:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ velociraptor --config /tmp/config.yaml config show --merge &#39;{&amp;quot;Client&amp;quot;:{&amp;quot;server_urls&amp;quot;:[&amp;quot;https://192.168.1.11:8000/&amp;quot;, &amp;quot;https://192.168.1.12:8000/&amp;quot;]}}&#39; &amp;gt; /tmp/new_config.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It may be more convenient to store the JSON merge blob in a file&#xA;instead of specifying on the command line - use the &lt;code&gt;--merge_file&lt;/code&gt;&#xA;option to provide it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;overriding-configuration-at-runtime&#34;&gt;Overriding configuration at runtime&lt;/h2&gt;&#xA;&lt;p&gt;While the &lt;code&gt;config show&lt;/code&gt; command can be used to manipulate the&#xA;configuration file, sometimes we want to change a few values at&#xA;runtime on a temporary basis.&lt;/p&gt;&#xA;&lt;h2 id=&#34;overriding-configuration-via-command-line-flags&#34;&gt;Overriding configuration via command line flags&lt;/h2&gt;&#xA;&lt;p&gt;Velociraptor allows most configuration settings to be overriden by&#xA;suitable command line flags. Since there are so many flags, the usual&#xA;help shown with the &lt;code&gt;--help&lt;/code&gt; flag does not include these configuration&#xA;overriding flags.&lt;/p&gt;&#xA;&lt;p&gt;You can see all the defined flags by enabling the DEBUG environment&#xA;variable:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ DEBUG=1 ./velociraptor --help&#xA;&#xA;...&#xA;  --config.client-writeback-darwin=CONFIG.CLIENT-WRITEBACK-DARWIN&#xA;  --config.client-writeback-linux=CONFIG.CLIENT-WRITEBACK-LINUX&#xA;  --config.client-writeback-windows=CONFIG.CLIENT-WRITEBACK-WINDOWS&#xA;  --config.client-tempdir-linux=CONFIG.CLIENT-TEMPDIR-LINUX&#xA;  --config.client-tempdir-windows=CONFIG.CLIENT-TEMPDIR-WINDOWS&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This is useful to override specific settings temporarily - for example&#xA;when running the server in a cloud environment, the bind port is&#xA;determined by the platform. In this case it is easier to simply&#xA;override this on the command line rather than manipulate the config&#xA;file.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;velociraptor --config /etc/velociraptor/server.config.yaml frontend --config.frontend-bind-port=$PORT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
    </item>
    <item>
      <title>How can I save my favorite collections for the future?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/favorites/</link>
      <pubDate>Tue, 26 Apr 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/favorites/</guid>
      <description>&lt;h1 id=&#34;how-can-i-save-my-favorite-collections-for-the-future&#34;&gt;How can I save my favorite collections for the future?&lt;/h1&gt;&#xA;&lt;p&gt;Sometimes we tend to collect the same set of artifacts together,&#xA;possibly with some specific parameters. It gets tedious to constantly&#xA;reconfigure the &lt;code&gt;New Collection&lt;/code&gt; interface with the same set of&#xA;artifacts.&lt;/p&gt;&#xA;&lt;p&gt;This where the &lt;code&gt;favorites&lt;/code&gt; feature comes in. We can save existing&#xA;collections including the artifacts collected and their&#xA;parameters. Then in future we just need to restore our collections&#xA;from our favorites.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/favorites//knowledge_base/tips/favorites/fav.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Saving a collection as a favorite&#34;&#xA;         width=&#34;1049&#34; height=&#34;614&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;fav.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Saving a collection as a favorite&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The favorite can be restored in future by simply adding a new&#xA;collection, clicking the favorite button and searching for it.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/favorites//knowledge_base/tips/favorites/fav2.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Restoring a favorite collection&#34;&#xA;         width=&#34;1477&#34; height=&#34;716&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;fav2.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Restoring a favorite collection&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;creating-favorites-programmatically&#34;&gt;Creating favorites programmatically&lt;/h2&gt;&#xA;&lt;p&gt;Favorites are stored into the user&amp;rsquo;s profile, since each user might&#xA;have a different set of artifacts they normally use.&lt;/p&gt;&#xA;&lt;p&gt;You can see your own favorites using the &lt;code&gt;favorites_list()&lt;/code&gt;&#xA;plugin. The below query will produce serialized spec strings that may&#xA;be fed directly into &lt;code&gt;favorites_save()&lt;/code&gt; below.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT name, description, type, serialize(item=spec) AS Spec&#xA;FROM favorites_list()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It is possible however to create favorites using VQL with the &lt;a href=&#34;https://www.velociraptor-docs.org/vql_reference/server/favorites_save/&#34;&gt;favorites_save()&lt;/a&gt; function:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT favorites_save(type=&amp;quot;CLIENT&amp;quot;, name=&amp;quot;MyFavorite&amp;quot;,&#xA;specs=&#39;&#39;&#39;&#xA;[{&amp;quot;artifact&amp;quot;:&amp;quot;Windows.Search.FileFinder&amp;quot;,&#xA;  &amp;quot;parameters&amp;quot;: {&#xA;    &amp;quot;env&amp;quot;: [{&#xA;        &amp;quot;key&amp;quot;: &amp;quot;SearchFilesGlob&amp;quot;,&#xA;        &amp;quot;value&amp;quot;: &amp;quot;HKEY_USERS/*/Software/Sysinternals/*/*&amp;quot;&#xA;    }, {&#xA;        &amp;quot;key&amp;quot;: &amp;quot;Accessor&amp;quot;,&#xA;        &amp;quot;value&amp;quot;: &amp;quot;registry&amp;quot;&#xA;    }]}}]&#39;&#39;&#39;)&#xA;FROM scope()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note the &lt;code&gt;spec&lt;/code&gt; parameter is a JSON encoded blob of the various&#xA;artifact parameters.&lt;/p&gt;&#xA;&lt;p&gt;By including the VQL in a notebook, any user can collect it and&#xA;install the favorites in their own profile.&lt;/p&gt;&#xA;&lt;h2 id=&#34;applying-favorites-to-other-users&#34;&gt;Applying favorites to other users&lt;/h2&gt;&#xA;&lt;p&gt;The above example showed how to programmatically set favorites in&#xA;one&amp;rsquo;s own user profile, but sometimes we want to apply the favorites&#xA;in other user&amp;rsquo;s profile as well. This helps to establish a common set&#xA;of artifacts for the entire team.&lt;/p&gt;&#xA;&lt;p&gt;To set other user&amp;rsquo;s favorites, you will need to be an administrator&#xA;with the impersonation permission, and run the above query in the&#xA;user&amp;rsquo;s context:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT * FROM foreach(row={&#xA;&#xA;    -- Iterate over all users in the current org&#xA;    -- (use all_org=TRUE to iterate over all users).&#xA;    SELECT * FROM gui_users()&#xA;&#xA;}, query={&#xA;&#xA;   -- Run this query in its own scope.&#xA;   -- Runas will switch to that user.&#xA;&#xA;   SELECT * FROM query(runas=name, query={&#xA;&#xA;        -- Here is the original query to be run in&#xA;        -- the user&#39;s context - same as above.&#xA;        SELECT favorites_save(type=&amp;quot;CLIENT&amp;quot;, name=&amp;quot;MyFavorite&amp;quot;,&#xA;        specs=&#39;&#39;&#39;&#xA;        [{&amp;quot;artifact&amp;quot;:&amp;quot;Windows.Search.FileFinder&amp;quot;,&#xA;          &amp;quot;parameters&amp;quot;: {&#xA;            &amp;quot;env&amp;quot;: [{&#xA;                &amp;quot;key&amp;quot;: &amp;quot;SearchFilesGlob&amp;quot;,&#xA;                &amp;quot;value&amp;quot;: &amp;quot;HKEY_USERS/*/Software/Sysinternals/*/*&amp;quot;&#xA;            }, {&#xA;                &amp;quot;key&amp;quot;: &amp;quot;Accessor&amp;quot;,&#xA;                &amp;quot;value&amp;quot;: &amp;quot;registry&amp;quot;&#xA;            }]}}]&#39;&#39;&#39;)&#xA;        FROM scope()&#xA;   })&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
    </item>
    <item>
      <title>How to fix &#34;certificate has expired or not yet valid error&#34;?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/rolling_certificates/</link>
      <pubDate>Tue, 26 Apr 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/rolling_certificates/</guid>
      <description>&lt;h1 id=&#34;how-to-fix-certificate-has-expired-or-not-yet-valid-error&#34;&gt;How to fix &amp;ldquo;certificate has expired or not yet valid error&amp;rdquo;?&lt;/h1&gt;&#xA;&lt;p&gt;When Velociraptor generates a configuration file it also generates&#xA;some certificates to secure it&amp;rsquo;s internal PKI.&lt;/p&gt;&#xA;&lt;p&gt;The CA certificate is embedded in the client&amp;rsquo;s configuration file and&#xA;underpins the entire Velociraptor communications protocol - all&#xA;certificates are issued by this internal CA. The Velociraptor CA is&#xA;set to expire in 10 years.&lt;/p&gt;&#xA;&lt;p&gt;The Server certificate is signed by the CA certificate and is set to&#xA;expire in 1 year by default. When the certificate expires, clients&#xA;will be unable to connect to the server any more.&lt;/p&gt;&#xA;&lt;p&gt;You can check the expiry time of the server certificate using curl and&#xA;openssl:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ curl -s -k https://127.0.0.1:8000/server.pem | openssl x509 -text  | grep -A 2 Validity&#xA;Validity&#xA;   Not Before: Apr 13 12:05:46 2022 GMT&#xA;   Not After : Apr 13 12:05:46 2023 GMT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;what-happens-when-the-certificate-expires&#34;&gt;What happens when the certificate expires?&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When the internal server certificate expires clients will not accept it and&#xA;they will refuse to communicate. Clients will show as offline in the GUI and&#xA;buffer data as long as possible, subject to their configured buffer limits.&lt;/li&gt;&#xA;&lt;li&gt;New GUI sessions will fail with &amp;ldquo;500 Internal Server Error&amp;rdquo; and the response&#xA;body &lt;code&gt;{&amp;quot;code&amp;quot;:2,&amp;quot;message&amp;quot;:&amp;quot;Must set a username&amp;quot;}&lt;/code&gt; and fail to load.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;For Velociraptor versions 0.74 and later there is a mechanism to mitigate the&#xA;impact of unexpected certificate expiry:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Upon restarting the server service, if the certificate&#xA;(&lt;code&gt;Frontend.certificate&lt;/code&gt;) has expired, and if the server.config.yaml contains&#xA;the CA private key then it will automatically issue a new cert with the same&#xA;validity period as the expired one. This temporary certificate is held in&#xA;memory only and is NOT written to the server.config.yaml.&lt;/li&gt;&#xA;&lt;li&gt;In the server log you will see the following messages:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;[ERROR] &amp;lt;log_date&amp;gt; Frontend Certificate is not valid: Certificate Valid NotBefore &amp;lt;start_date&amp;gt; and Not After &amp;lt;end_date&amp;gt; but Now is &amp;lt;current_date&amp;gt;. See https://docs.velociraptor.app/knowledge_base/tips/rolling_certificates/&#xA;[INFO] &amp;lt;log_date&amp;gt; Found CA private key in config, will automatically rotate keys, but you should consider updating the config file using `velociraptor config rotate`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If this is the case you should update your server certificate by reissuing a new&#xA;one.&lt;/p&gt;&#xA;&lt;h2 id=&#34;rotating-certificates&#34;&gt;Rotating certificates&lt;/h2&gt;&#xA;&lt;p&gt;Reissuing a new server certificate can be performed at any time using the&#xA;&lt;code&gt;config reissue_certs&lt;/code&gt; command. You can even reissue a certificate with extended&#xA;validity before you deploy your server.&lt;/p&gt;&#xA;&lt;p&gt;The procedure amounts to generating a new server configuration which is derived&#xA;from the old one, and then replacing the old config with the new config.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;config rotate_keys&lt;/code&gt; command can be used to regenerate both the server&#xA;certificate and the associated private key. Although this is not necessary for&#xA;operational purposes, it is considered good security practice to rotate keys and&#xA;certificates periodically, and particularly after a suspected systems&#xA;compromise.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices info&#34;&gt;&#xA;  &lt;div heading=&#34;info&#34;&gt;&lt;p&gt;For server versions older than 0.72.3 please use the following commands instead&#xA;of those shown below:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th style=&#34;text-align: center&#34;&gt;Goal&lt;/th&gt;&#xA;          &lt;th&gt;Command for the current version&lt;/th&gt;&#xA;          &lt;th&gt;Command for versions &amp;lt;0.72.3&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;Reissue only the server cert&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;velociraptor config reissue_certs&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;velociraptor config reissue_key&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;Reissue the server cert and&lt;br&gt; also the private key&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;velociraptor config rotate_keys&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;velociraptor config rotate_key&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h4 id=&#34;setting-a-non-standard-validity&#34;&gt;Setting a non-standard validity&lt;/h4&gt;&#xA;&lt;p&gt;When reissuing the certificate the &lt;code&gt;--validity&lt;/code&gt; flag can be used to extend the&#xA;validity beyond the default of one year. For example, to generate a config&#xA;containing a server certificate which is valid for 2 years, you would run the&#xA;command:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;velociraptor --config server.config.yaml config reissue_certs --validity 730  &amp;gt; new.server.config.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you expect your server to be a long-term instance then you don&amp;rsquo;t have to&#xA;start with the default 1-year validity and wait for the certificate to expire.&#xA;You can generate a new config on day 1 based on the initial config using the&#xA;&lt;code&gt;config reissue_certs&lt;/code&gt; command. You can then use the new config for the new&#xA;server installation.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34;tip&#34;&gt;&lt;p&gt;In version 0.74 and later the configuration wizard (&lt;code&gt;velociraptor config generate -i&lt;/code&gt;) allows you to issue the server certificate with either 1-year,&#xA;2-year or 10-year validity.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h4 id=&#34;option-1-reissue-only-the-server-cert&#34;&gt;Option 1: Reissue only the server cert&lt;/h4&gt;&#xA;&lt;p&gt;To rotate server certificates, use the following command to generate a new&#xA;configuration file containing rotated certificates:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ velociraptor config reissue_certs --config /etc/velociraptor/server.config.yaml &amp;gt; /tmp/new_key.config.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The &lt;code&gt;config reissue_key&lt;/code&gt; command updates the following configuration items:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;GUI.gw_certificate&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Frontend.certificate&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;code&gt;CA.private_key&lt;/code&gt;, &lt;code&gt;Client.ca_certificate&lt;/code&gt;, &lt;code&gt;GUI.gw_private_key&lt;/code&gt;, and &lt;code&gt;Frontend.private_key&lt;/code&gt; are preserved.&lt;/p&gt;&#xA;&lt;h4 id=&#34;option-2-reissue-the-server-cert-and-also-the-private-key&#34;&gt;Option 2: Reissue the server cert and also the private key&lt;/h4&gt;&#xA;&lt;p&gt;Alternatively, you can regenerate the server&amp;rsquo;s private keys and rotate the&#xA;certificates at the same time:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ velociraptor config rotate_keys --config /etc/velociraptor/server.config.yaml &amp;gt; /tmp/new_key.config.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The &lt;code&gt;config rotate_keys&lt;/code&gt; command updates the following configuration items:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;GUI.gw_certificate&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;GUI.gw_private_key&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Frontend.certificate&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Frontend.private_key&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;code&gt;CA.private_key&lt;/code&gt; and &lt;code&gt;Client.ca_certificate&lt;/code&gt; are preserved.&lt;/p&gt;&#xA;&lt;p&gt;The previous two commands will not affect the CA private key and&#xA;certificate, which is valid for 10 years, as described previously.&lt;/p&gt;&#xA;&lt;p&gt;You can view the new certificate using jq and openssl (here &lt;code&gt;jq&lt;/code&gt; is&#xA;used to show the PEM certificate of the frontend and &lt;code&gt;openssl&lt;/code&gt; is used&#xA;to decode it)&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ velociraptor --config /tmp/new_key.config.yaml config show --json | jq -r .Frontend.certificate | openssl x509 -text  | grep -A 2 Validity&#xA;Validity&#xA;   Not Before: Apr 25 21:01:51 2022 GMT&#xA;   Not After : Apr 25 21:01:51 2023 GMT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now back up the old configuration file and replace it with the new&#xA;file, then restart the server. Clients should reconnect automatically.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to initialize a Velociraptor server with custom artifacts?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/startup_artifacts/</link>
      <pubDate>Tue, 26 Apr 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/startup_artifacts/</guid>
      <description>&lt;h1 id=&#34;how-to-initialize-a-velociraptor-server-with-custom-artifacts&#34;&gt;How to initialize a Velociraptor server with custom artifacts?&lt;/h1&gt;&#xA;&lt;p&gt;Velociraptor frontend process has a component called the &lt;strong&gt;Artifact&#xA;Repository&lt;/strong&gt;. This component knows about all the artifacts that are&#xA;defined.&lt;/p&gt;&#xA;&lt;p&gt;When the server starts up, it loads artifacts into the repository from the&#xA;following sources.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Built-in artifacts that are embedded into the binary itself (compiled in).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Custom artifacts that are defined inside the configuration file itself.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Directories containing artifact YAML files that can be defined in one or more&#xA;of the following ways:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;specified by the &lt;code&gt;--definitions&lt;/code&gt; CLI flag: a single directory&lt;/li&gt;&#xA;&lt;li&gt;specified by &lt;code&gt;Frontend.artifact_definitions_directory&lt;/code&gt; in the config: a&#xA;single directory.&lt;/li&gt;&#xA;&lt;li&gt;specified by &lt;code&gt;defaults.artifact_definitions_directories&lt;/code&gt; in the config: a&#xA;list of directories.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Velociraptor will search these directories recursively for artifact YAML&#xA;files.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Finally, the server will load artifacts from the configured&#xA;filestore path under &lt;code&gt;&amp;lt;filestore&amp;gt;/artifact_definitions&lt;/code&gt;. These are&#xA;usually the custom artifacts defined through the GUI.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The location of where an artifact came from does not matter,&#xA;Velociraptor organizes artifacts internally using the artifact&#xA;name. It is customary to denote custom artifacts with the &lt;code&gt;Custom.&lt;/code&gt;&#xA;prefix but this is not mandatory.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices warning&#34;&gt;&#xA;  &lt;div heading=&#34;warning&#34;&gt;&lt;p&gt;Velociraptor does not allow a custom artifact to override a built in&#xA;artifact (i.e. have the same name). Built in artifacts are protected&#xA;because overriding built in artifacts may break the proper&#xA;functionality of Velociraptor. If you want to customize a built in&#xA;artifact, simply change the name when you save it.&lt;/p&gt;&#xA;&lt;p&gt;Velociraptor considers artifacts defined in the config file, or given&#xA;in the &lt;code&gt;--definitions&lt;/code&gt; directory as &amp;ldquo;built in&amp;rdquo;.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;specifying-a-startup-artifact&#34;&gt;Specifying a startup artifact.&lt;/h2&gt;&#xA;&lt;p&gt;When the Velociraptor server is run for the very first time, it&#xA;creates an install record in the filestore&#xA;&lt;code&gt;&amp;lt;filestore&amp;gt;/config/install_time.json.db&lt;/code&gt;. It can then setup initial&#xA;artifacts to collect as specified by the config file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;Frontend:&#xA;  default_client_monitoring_artifacts:&#xA;  - Generic.Client.Stats&#xA;  initial_server_artifacts:&#xA;  - MyServerArtifact&#xA;  default_server_monitoring_artifacts:&#xA;  - MyCustomServerMonitor&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In the above snippet, we see the following parameters:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;code&gt;default_client_monitoring_artifacts&lt;/code&gt; specifies the initial client&#xA;monitoring table that will be created. By default, Velociraptor&#xA;collects endpoint CPU and Memory telemetry from all endpoints. You&#xA;can remove this, or specify a different client artifact to collect.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;code&gt;default_server_monitoring_artifacts&lt;/code&gt; specifies an initial set of&#xA;server event artifacts to collect.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;code&gt;initial_server_artifacts&lt;/code&gt; is a list of server artifacts that will&#xA;be automatically launched on the server on initial startup. You can&#xA;specify the names of any artifacts here (including custom artifacts)&#xA;which can be bootstrapped to perform any kinds of server&#xA;configuration needed. The artifacts are simply scheduled and will&#xA;appear in the usual &lt;code&gt;Server Artifacts&lt;/code&gt; screen.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;div class=&#34;mynotices note&#34;&gt;&#xA;  &lt;div heading=&#34;note&#34;&gt;&lt;p&gt;Currently it is not possible to specify parameters for initial&#xA;artifacts so if you need to tweak the parameters it is best to create&#xA;a custom artifact that in turn launches the needed artifacts with the&#xA;correct parameters. You can find an example below.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;initializing-the-server-using-a-custom-artifact&#34;&gt;Initializing the server using a custom artifact.&lt;/h2&gt;&#xA;&lt;p&gt;For more complex initialization tasks you can write a custom artifact&#xA;that will be collected the first time the server is started. The&#xA;artifact can import any custom artifacts and start monitoring&#xA;queries. The custom artifact should take no arguments. It is most&#xA;reliable to add the custom artifact to the configuration file itself&#xA;to ensure it is loaded and ready when the server initializes.&lt;/p&gt;&#xA;&lt;p&gt;For example, the relevant part of the server configuration might be:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;autoexec:&#xA;  artifact_definitions:&#xA;    - name: InitializeServer&#xA;      description: Setup the server on first run&#xA;      sources:&#xA;        - query: |&#xA;            LET _ &amp;lt;= SELECT *&#xA;                     FROM Artifact.Server.Import.CuratedSigma()&#xA;&#xA;            SELECT add_client_monitoring(&#xA;                      label=&amp;quot;Monitoring&amp;quot;,&#xA;                      artifact=&amp;quot;Windows.Hayabusa.Monitoring&amp;quot;,&#xA;                      parameters=dict(RuleLevel=&amp;quot;Critical, High, and Medium&amp;quot;,&#xA;                                      RuleStatus=&amp;quot;Stable&amp;quot;)) AS Monitoring,&#xA;                  artifact_set_metadata(name=&amp;quot;InitializeServer&amp;quot;, hidden=TRUE)&#xA;            FROM scope()&#xA;&#xA;Frontend:&#xA;  initial_server_artifacts:&#xA;    - InitializeServer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The above parts:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;An artifact is defined inline in the config file.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The artifact imports the Sigma artifacts from the velociraptor&#xA;sigma projects (you can add your own URLs to import your own set of&#xA;custom artifacts).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A client monitoring artifact is added using the &lt;code&gt;Hayabusa&lt;/code&gt; Sigma&#xA;artifact targeting the &amp;ldquo;Monitoring&amp;rdquo; label. Parameters to the&#xA;artifact are passed here.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Finally the server is configured to collect the &lt;code&gt;InitializeServer&lt;/code&gt;&#xA;artifact when first run.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;</description>
    </item>
    <item>
      <title>What do I do about &#34;version GLIBC_2.xx not found&#34; errors?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/glibc_errors/</link>
      <pubDate>Tue, 26 Apr 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/glibc_errors/</guid>
      <description>&lt;h1 id=&#34;what-do-i-do-about-version-glibc_2xx-not-found-errors&#34;&gt;What do I do about &amp;ldquo;version GLIBC_2.xx not found&amp;rdquo; errors?&lt;/h1&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34; TLDR - use the `musl` build &#34;&gt;&lt;p&gt;Use the &lt;code&gt;musl&lt;/code&gt; built binary for older Linux systems. You can&#xA;find this build together with the others on the release page with the&#xA;&lt;code&gt;-musl&lt;/code&gt; suffix in the name.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;p&gt;On Linux, binaries always link to the C library dynamically. This&#xA;happens even with a static binary like Velociraptor. The C library is&#xA;intimately linked to the version of Linux installed on the system and&#xA;it is generally not possible to upgrade the C library without also&#xA;upgrading the entire Linux distribution.&lt;/p&gt;&#xA;&lt;p&gt;During the build process, the compiler creates a version requirement&#xA;for this C library embedded in the binary itself. You can see the&#xA;exact version of all libraries needed at runtime using the &lt;code&gt;read_elf&lt;/code&gt;&#xA;program:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ readelf -V velociraptor-v0.6.4-linux-amd64&#xA;...&#xA;Version needs section &#39;.gnu.version_r&#39; contains 3 entries:&#xA; Addr: 0x00000000004106a0  Offset: 0x0106a0  Link: 7 (.dynstr)&#xA;   000000: Version: 1  File: libdl.so.2  Cnt: 1&#xA;   0x0010:   Name: GLIBC_2.2.5  Flags: none  Version: 10&#xA;   0x0020: Version: 1  File: libpthread.so.0  Cnt: 2&#xA;   0x0030:   Name: GLIBC_2.3.2  Flags: none  Version: 6&#xA;   0x0040:   Name: GLIBC_2.2.5  Flags: none  Version: 5&#xA;   0x0050: Version: 1  File: libc.so.6  Cnt: 8&#xA;   0x0060:   Name: GLIBC_2.11  Flags: none  Version: 12&#xA;   0x0070:   Name: GLIBC_2.7  Flags: none  Version: 11&#xA;   0x0080:   Name: GLIBC_2.14  Flags: none  Version: 9&#xA;   0x0090:   Name: GLIBC_2.15  Flags: none  Version: 8&#xA;   0x00a0:   Name: GLIBC_2.4  Flags: none  Version: 7&#xA;   0x00b0:   Name: GLIBC_2.3.4  Flags: none  Version: 4&#xA;   0x00c0:   Name: GLIBC_2.2.5  Flags: none  Version: 3&#xA;   0x00d0:   Name: GLIBC_2.3  Flags: none  Version: 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In the above example this binary requires at least &lt;code&gt;GLIBC_2.15&lt;/code&gt; to&#xA;run. You can tell what version of libc you have on any particular&#xA;system using the local package manager.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ dpkg -l libc6:amd64&#xA;Desired=Unknown/Install/Remove/Purge/Hold&#xA;| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend&#xA;|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)&#xA;||/ Name           Version       Architecture Description&#xA;+++-==============-=============-============-=================================&#xA;ii  libc6:amd64    2.33-0ubuntu5 amd64        GNU C Library: Shared libraries&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In this case this system has GLIBC version 2.33 which is higher than&#xA;the minimum required version of 2.15.&lt;/p&gt;&#xA;&lt;p&gt;However for older systems, the locally installed GLIBC may be older&#xA;than required. This results in an error when we attempt to run it. For&#xA;example on an old CentOS 6 system:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ ./velociraptor-v0.6.4-linux-amd64&#xA;./velociraptor-v0.6.4-linux-amd64: /lib64/libc.so.6: version `GLIBC_2.14&#39; not found (required by ./velociraptor-v0.6.4-linux-amd64)&#xA;./velociraptor-v0.6.4-linux-amd64: /lib64/libc.so.6: version `GLIBC_2.15&#39; not found (required by ./velociraptor-v0.6.4-linux-amd64)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Since the version requirement is added at build time, we really need&#xA;to build on an old system to ensure the linked to GLIBC is old enough.&lt;/p&gt;&#xA;&lt;p&gt;Velociraptor uses the &lt;a href=&#34;https://www.musl-libc.org/&#34; target=&#34;_blank&#34; &gt;musl&lt;/a&gt; project to&#xA;build completely static binaries independent of the GLIBC installed on&#xA;the system. While this feature is considered experimental it seems to&#xA;work well and produces truly portable binaries.&lt;/p&gt;&#xA;&lt;p&gt;We recommend that version to only be used for clients on older&#xA;systems, although it might also work for a server too (but really you&#xA;should be running servers on modern patched systems).&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I search for registry keys</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/registry_finder/</link>
      <pubDate>Mon, 25 Apr 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/registry_finder/</guid>
      <description>&lt;h1 id=&#34;how-do-i-search-for-registry-keys&#34;&gt;How do I search for registry keys&lt;/h1&gt;&#xA;&lt;p&gt;To search the registry simply use the &amp;ldquo;registry&amp;rdquo; accessor with the &lt;code&gt;Windows.Search.FileFinder&lt;/code&gt; artifact.&lt;/p&gt;&#xA;&lt;p&gt;This works because Velociraptor can glob the registry as if it were a filesystem (See &lt;a href=&#34;https://www.velociraptor-docs.org/docs/forensic/filesystem/#filesystem-accessors&#34;&gt;Filesystem Accessors&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/registry_finder/https://user-images.githubusercontent.com/3856546/165133750-a694844a-5bb5-44bc-94a8-fd715a6efe4a.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Searching the registry&#34; /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    Searching the registry&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I use my own SSL certificates?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/ssl/</link>
      <pubDate>Mon, 18 Apr 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/ssl/</guid>
      <description>&lt;h1 id=&#34;how-do-i-use-my-own-ssl-certificates&#34;&gt;How do I use my own SSL certificates?&lt;/h1&gt;&#xA;&lt;p&gt;Use case: For an on-premises deployment, Let&amp;rsquo;s Encrypt may not be an option. You may want to use your own enterprise/corporate Certificate Authority (CA) or another 3rd party.&lt;/p&gt;&#xA;&lt;p&gt;Thanks to recent enhancements by the Velociraptor developers, this is quite a simple task. The below is a simple test configuration used and may need adapting to your environment.&lt;/p&gt;&#xA;&lt;p&gt;Prior to commencing we have a plaintext PEM private key, certificate for our Velociraptor server, and the certificate chain of our enterprise CA, including the root and multiple intermediaries.&lt;/p&gt;&#xA;&lt;h3 id=&#34;generate-the-configuration&#34;&gt;Generate the configuration&lt;/h3&gt;&#xA;&lt;p&gt;Using Ubuntu we generated a stock standard &amp;ldquo;Self-signed SSL&amp;rdquo; configuration:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;./velociraptor-v0.6.3-2-linux-amd64 config generate -i&lt;/code&gt;&lt;/p&gt;&#xA;&lt;img width=&#34;491&#34; alt=&#34;image&#34; src=&#34;https://user-images.githubusercontent.com/30587915/163787136-f9e6f16f-5119-4cd0-ba43-741ab64cdc42.png&#34;&gt;&#xA;&lt;h3 id=&#34;update-the-serverconfigyaml&#34;&gt;Update the server.config.yaml&lt;/h3&gt;&#xA;&lt;p&gt;Locate the frontend section and add the &lt;code&gt;tls_certificate_filename&lt;/code&gt; and &lt;code&gt;tls_private_key_filename&lt;/code&gt; parameters. Enter the absolute path to these files. For testing, we placed in /etc however there are better places for production use.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;Frontend:&#xA;  tls_certificate_filename: /etc/velociraptor.pem&#xA;  tls_private_key_filename: /etc/velociraptor.key&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;img width=&#34;221&#34; alt=&#34;image&#34; src=&#34;https://user-images.githubusercontent.com/30587915/163787153-9734cbb8-ddbf-4140-b4d6-1c89e19afa7c.png&#34;&gt;&#xA;&lt;h3 id=&#34;update-the-clientconfigyaml&#34;&gt;Update the client.config.yaml&lt;/h3&gt;&#xA;&lt;p&gt;In the client section modify &lt;code&gt;use_self_signed_ssl&lt;/code&gt; to be false, and add the CA root/intermediary certificates to be trusted by the client:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;use_self_signed_ssl: false&#xA;&#xA;Crypto:&#xA;    root_certs: |&#xA;          -----BEGIN CERTIFICATE-----&#xA;          XXXXX&#xA;          -----END CERTIFICATE-----&#xA;          -----BEGIN CERTIFICATE-----&#xA;          XXXXX&#xA;          -----END CERTIFICATE-----&#xA;          -----BEGIN CERTIFICATE-----&#xA;          XXXXX&#xA;          -----END CERTIFICATE-----&#xA;          ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;test&#34;&gt;Test&lt;/h3&gt;&#xA;&lt;p&gt;Launching the server we should be able to connect to the GUI using our new certificate. Note this must be trusted by browser/system to prevent errors.&lt;/p&gt;&#xA;&lt;p&gt;Launching the client, it should connect securely without error, using the trusted CA chain and the new server certificate.&lt;/p&gt;&#xA;&lt;p&gt;No changes need to be made to the pinned certificate name, nor do any certificates need to be modified in the configuration files.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I set a proxy for client communications?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/proxy/</link>
      <pubDate>Fri, 15 Apr 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/proxy/</guid>
      <description>&lt;h1 id=&#34;how-do-i-set-a-proxy-for-client-communications&#34;&gt;How do I set a proxy for client communications?&lt;/h1&gt;&#xA;&lt;p&gt;Many enterprise environments require a proxy to be set before outbound&#xA;web communications is allowed. The Velociraptor client uses HTTP to&#xA;communicate with the server, and therefore must use a proxy to&#xA;connect in such environments.&lt;/p&gt;&#xA;&lt;p&gt;It is possible to specify the HTTP proxy using the configuration file&#xA;or environment variables.&lt;/p&gt;&#xA;&lt;h3 id=&#34;environment-variables&#34;&gt;Environment variables.&lt;/h3&gt;&#xA;&lt;p&gt;Environment variables may be configured using group policy or similar&#xA;methods. Setting the &lt;code&gt;http_proxy&lt;/code&gt; and &lt;code&gt;https_proxy&lt;/code&gt; environment&#xA;variables will force the client to go through the specified proxy.&lt;/p&gt;&#xA;&lt;p&gt;The rules for environment variables are described&#xA;&lt;a href=&#34;https://go.dev/src/net/http/transport.go#422&#34; target=&#34;_blank&#34; &gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;// ProxyFromEnvironment returns the URL of the proxy to use for a&#xA;// given request, as indicated by the environment variables&#xA;// HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions&#xA;// thereof). HTTPS_PROXY takes precedence over HTTP_PROXY for https&#xA;// requests.&#xA;//&#xA;// The environment values may be either a complete URL or a&#xA;// &amp;quot;host[:port]&amp;quot;, in which case the &amp;quot;http&amp;quot; scheme is assumed.&#xA;// The schemes &amp;quot;http&amp;quot;, &amp;quot;https&amp;quot;, and &amp;quot;socks5&amp;quot; are supported.&#xA;// An error is returned if the value is a different form.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;setting-a-proxy-in-the-configuration-file&#34;&gt;Setting a proxy in the configuration file&lt;/h3&gt;&#xA;&lt;p&gt;You can also hard code the proxy in the configuration file&amp;rsquo;s Client&#xA;section:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;Client:&#xA;  proxy: http://proxy.example.com:3128/&#xA;  server_urls:&#xA;  - https://velo.example.com:8100/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
    </item>
    <item>
      <title>How to increase notebook timeout</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/notebook_timeout/</link>
      <pubDate>Tue, 29 Mar 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/notebook_timeout/</guid>
      <description>&lt;h1 id=&#34;how-to-increase-notebook-timeout&#34;&gt;How to increase notebook timeout&lt;/h1&gt;&#xA;&lt;p&gt;In the notebook, VQL queries are limited to 10 minutes. Once the timeout is expired, the query is cancelled.&#xA;Regular collections from clients also have a timeout, that timeout can be changed in the new collection wizard GUI to give the query more time.&lt;/p&gt;&#xA;&lt;p&gt;But there is no similar control for the notebook cells. In the notebook, the time limit serves to limit server load - because the notebook queries are run on the server we don&amp;rsquo;t want them to take too long or make it too easy to extend the timeout too long.&lt;/p&gt;&#xA;&lt;p&gt;If you find that your cell query is routinely exceeding the timeout, you can use one of the following approaches:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Make the query more efficient - for example using multi-threaded queries or the &lt;code&gt;parallelize()&lt;/code&gt; plugin.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Turn the query into a server artifact. Large queries are often very reusable and if you can turn it into an artifact, it might be useful again. Running a server artifact allows the timeout to be increased if needed.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;As a last resort update the default notebook timeout in the configuration file. Find or add the section called &lt;code&gt;defaults&lt;/code&gt; and add the following setting:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;Frontend:&#xA;... other settings ...&#xA;defaults:&#xA;    notebook_cell_timeout_min: 20&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I upgrade my server and clients?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/upgrading/</link>
      <pubDate>Sun, 27 Mar 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/upgrading/</guid>
      <description>&lt;h1 id=&#34;how-do-i-upgrade-my-server-and-clients&#34;&gt;How do I upgrade my server and clients?&lt;/h1&gt;&#xA;&lt;p&gt;To upgrade the Velociraptor server to a new version, simply download the latest release binary from the GitHub Release Page and regenerate a new &lt;code&gt;Debian&lt;/code&gt; package as described above, but using the existing configuration file.&lt;/p&gt;&#xA;&lt;p&gt;See &lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/server/upgrades/&#34;&gt;this page for more details&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;To upgrade the Velociraptor clients, you will need to push out new MSIs using the existing client configuration files.&lt;/p&gt;&#xA;&lt;p&gt;More details on &lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/clients/#client-upgrades&#34;&gt;Client upgrades&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;supported-upgrade-scenarios&#34;&gt;Supported Upgrade Scenarios&lt;/h2&gt;&#xA;&lt;p&gt;Matching client and server versions is the most supported configuration.&#xA;See &lt;a href=&#34;https://www.velociraptor-docs.org/docs/overview/support/#client-and-server-versioning&#34;&gt;the support policy&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Before upgrading perform testing of the combination of client and server versions to be used, compatibility of mixed versions is best efforts based on community testing and issues being reported.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Check &lt;a href=&#34;https://github.com/Velocidex/velociraptor/issues&#34; target=&#34;_blank&#34; &gt;GitHub&lt;/a&gt; for issues reported by the community.&lt;/li&gt;&#xA;&lt;li&gt;Read &lt;a href=&#34;https://github.com/Velocidex/velociraptor/releases&#34; target=&#34;_blank&#34; &gt;release notes&lt;/a&gt; for all  versions between the current version, and the version you are moving to if skipping versions. Generally though avoid skipping versions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;other-tips&#34;&gt;Other tips&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Recent versions of clients and servers generally can communicate with each other without a problem, but new functionality may not be available on old clients. Artifacts like &lt;a href=&#34;https://github.com/Velocidex/velociraptor/issues/1566&#34; target=&#34;_blank&#34; &gt;this&lt;/a&gt; will (0.6.4+) help reduce this.&lt;/li&gt;&#xA;&lt;li&gt;Upgrading the server before clients is more common, so version problems are more likely to have been caught in community testing with this approach.&lt;/li&gt;&#xA;&lt;li&gt;Consider running a parallel deployment as the most compatible way to upgrade. Such as when upgrading and there are known breaking changes between the current client and target server versions (going from self-signed to auto cert), or when there are large version differences (unusual combinations of client and server).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
    </item>
    <item>
      <title>In VQL, can I SELECT a column with special characters in its name?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/identifier_with_space/</link>
      <pubDate>Sun, 27 Mar 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/identifier_with_space/</guid>
      <description>&lt;h1 id=&#34;in-vql-can-i-select-a-column-with-special-characters-in-its-name&#34;&gt;In VQL, can I SELECT a column with special characters in its name?&lt;/h1&gt;&#xA;&lt;p&gt;Sometimes a VQL query will emit a column name with special characters in its name, such as a dot, space or other special characters.&lt;/p&gt;&#xA;&lt;p&gt;You can still refer to this column using backticks around the identifier name:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;-- This will not work because VQL will interpret the dot as an operator&#xA;SELECT Raddr.IP FROM ...&#xA;&#xA;-- This will work because VQL will treat the entire thing as a single identifier&#xA;SELECT `Raddr.IP` FROM ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can read more about &lt;a href=&#34;https://www.velociraptor-docs.org/docs/vql/#identifiers-with-spaces&#34;&gt;VQL identifiers&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How can I automatically apply labels to clients?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/automating_labels/</link>
      <pubDate>Sat, 26 Mar 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/automating_labels/</guid>
      <description>&lt;h1 id=&#34;how-can-i-automatically-apply-labels-to-clients&#34;&gt;How can I automatically apply labels to clients?&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/clients/labels/&#34;&gt;Labels&lt;/a&gt; are used to target clients in&#xA;Velociraptor. All clients that share a particular label can be treated as a&#xA;group in common operations such as hunts and client monitoring. Labels can also&#xA;be used to search for and filter clients in the GUI and in VQL queries.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes it is useful to automatically label clients based on some property of&#xA;the client or the results of a collection. You can do this by running a&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/server_automation/server_monitoring/&#34;&gt;Server Event&lt;/a&gt; artifact&#xA;which automatically applies labels based on some criteria that you define.&lt;/p&gt;&#xA;&lt;p&gt;In this article we demonstrate two use cases: a basic and a more advanced one.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices note&#34;&gt;&#xA;  &lt;div heading=&#34; Labels or Metadata? &#34;&gt;&lt;p&gt;Metadata is a set of fields associated with each client. Labels can also be&#xA;regarded as information associated with a client, but in Velociraptor labels are&#xA;a more transient kind of information and are designed to be added and removed&#xA;relatively frequently. Labels provide a way to group clients whereas Metadata&#xA;provides a way to store information &lt;em&gt;about&lt;/em&gt; each client.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s important that you choose the appropriate one for your use case. This&#xA;article is about automating Labels but if you want to do similar automation of&#xA;Metadata then you may find this article more useful:&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_metadata/&#34;&gt;How can I automatically add &amp;amp; update client metadata?&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;basic-use-case-labelling-based-on-default-interrogation-data&#34;&gt;Basic Use Case: Labelling based on default interrogation data&lt;/h2&gt;&#xA;&lt;p&gt;When a client connects for the first time in a Velociraptor deployment, the&#xA;server instructs the client to enroll and also tells it to run the&#xA;&lt;code&gt;Generic.Client.Info&lt;/code&gt; artifact. This built-in artifact is designed to collect&#xA;basic information about the endpoint. We refer to this process as&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/clients/interrogation/&#34;&gt;&amp;ldquo;interrogation&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;We can watch the system for any new collections of &lt;code&gt;Generic.Client.Info&lt;/code&gt; and&#xA;apply labels based on the results.&lt;/p&gt;&#xA;&lt;p&gt;The following example will label a client with the label &amp;ldquo;Server&amp;rdquo; if it is&#xA;running any kind of Windows Server Operating System.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;LET interrogations = SELECT *&#xA;  FROM watch_monitoring(artifact=&amp;quot;System.Flow.Completion&amp;quot;)&#xA;  WHERE Flow.artifacts_with_results =~ &amp;quot;Generic.Client.Info/BasicInformation&amp;quot;&#xA;&#xA;LET results = SELECT *, ClientId&#xA;              FROM source(&#xA;                 artifact=&amp;quot;Generic.Client.Info/BasicInformation&amp;quot; ,&#xA;                 client_id=ClientId, flow_id=FlowId)&#xA;              WHERE Platform =~ &amp;quot;Server&amp;quot;&#xA;&#xA;SELECT *, label(client_id=ClientId, labels=&amp;quot;Server&amp;quot;, op=&amp;quot;set&amp;quot;)&#xA;FROM foreach(row=interrogations, query=results)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;code&gt;interrogations&lt;/code&gt; query will watch for any flow completion with results&#xA;for the &lt;code&gt;Generic.Client.Info/BasicInformation&lt;/code&gt; source. This will provide the&#xA;flow id and the client id.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;results&lt;/code&gt; query will read all the results from the collection. Typically&#xA;the &lt;code&gt;Platform&lt;/code&gt; field will contain the Windows Release information. We filter&#xA;out all rows except those that match the word &amp;ldquo;Server&amp;rdquo; to only see results&#xA;from the Windows Server platform.&lt;/li&gt;&#xA;&lt;li&gt;Finally for each interrogation we get the results and finally &amp;ldquo;set&amp;rdquo; the&#xA;label &amp;ldquo;Server&amp;rdquo; on the client id.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Now that we have the VQL worked out, we just package it in a &lt;code&gt;SERVER_EVENT&lt;/code&gt;&#xA;artifact.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: AutomateServerLabels&#xA;type: SERVER_EVENT&#xA;sources:&#xA;- query: |&#xA;    LET interrogations = SELECT *&#xA;    FROM watch_monitoring(artifact=&amp;quot;System.Flow.Completion&amp;quot;)&#xA;    WHERE Flow.artifacts_with_results =~ &amp;quot;Generic.Client.Info/BasicInformation&amp;quot;&#xA;&#xA;    LET results = SELECT *, ClientId&#xA;    FROM source(&#xA;       artifact=&amp;quot;Generic.Client.Info/BasicInformation&amp;quot; ,&#xA;       client_id=ClientId, flow_id=FlowId)&#xA;    WHERE Platform =~ &amp;quot;Server&amp;quot;&#xA;&#xA;    SELECT *&#xA;    label(client_id=ClientId, labels=&amp;quot;Server&amp;quot;, op=&amp;quot;set&amp;quot;)&#xA;    FROM foreach(row=interrogations, query=results)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_labels//knowledge_base/tips/automating_labels/artifact.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Adding a new artifact&#34;&#xA;         width=&#34;1280&#34; height=&#34;625&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;artifact.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Adding a new artifact&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Now we can enable monitoring of these events by adding the artifact to&#xA;the server event table.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_labels//knowledge_base/tips/automating_labels/installing_event_monitoring_.svg&#34; alt=&#34;Installing server event monitoring&#34;&#xA;         class=&#34;inline&#34;&#xA;         height=&#34;746.2499999999999&#34;&#xA;         width=&#34;988.3333333333331&#34;  /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;installing_event_monitoring.svg&#34;&gt;&lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Installing server event monitoring&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Now when a new server enrolls the label &amp;ldquo;Server&amp;rdquo; will be applied.&lt;/p&gt;&#xA;&lt;p&gt;Note that we don&amp;rsquo;t need to add a label for non-servers (i.e. &amp;ldquo;workstations&amp;rdquo;)&#xA;because targeting a hunt, for example, allows us to exclude specific labels.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_labels//knowledge_base/tips/automating_labels/server_label_.svg&#34; alt=&#34;Label added&#34;&#xA;         class=&#34;inline&#34;&#xA;         height=&#34;519&#34;&#xA;         width=&#34;976.7095070422533&#34;  /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;server_label.svg&#34;&gt;&lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Label added&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34; Refreshing labels &#34;&gt;&lt;p&gt;The above artifact will automatically label clients when the&#xA;&lt;code&gt;Generic.Client.Info&lt;/code&gt; collection is run on the clients. This collection runs&#xA;when the client is first seen but you can run it at any time.&lt;/p&gt;&#xA;&lt;p&gt;To relabel all clients - even after they were enrolled - you can just start a&#xA;hunt for &lt;code&gt;Generic.Client.Info&lt;/code&gt; at any time. It is fine to re-apply the label&#xA;many times as duplicate labels cannot occur.&lt;/p&gt;&#xA;&lt;p&gt;Bulk removal of a specific label is possible by running VQL in a notebook, for&#xA;example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;SELECT client_id, label(client_id=client_id, labels=[&amp;quot;Server&amp;quot;], op=&amp;quot;remove&amp;quot;)&#xA;FROM clients()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;advanced-use-case-labelling-based-on-custom-interrogation-data&#34;&gt;Advanced Use Case: Labelling based on custom interrogation data&lt;/h2&gt;&#xA;&lt;p&gt;In the previous example we used data that was already being gathered by the&#xA;&lt;code&gt;Generic.Client.Info&lt;/code&gt; artifact. In addition, the &lt;code&gt;Platform&lt;/code&gt; information doesn&amp;rsquo;t&#xA;ever change, so every time you run it you will get the same result. That&amp;rsquo;s a bit&#xA;boring, so let&amp;rsquo;s do something more interesting!&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at applying a label based on data that &lt;em&gt;isn&amp;rsquo;t&lt;/em&gt; included in the&#xA;default interrogation artifact, and that is dynamic (i.e. where the outcome will&#xA;change over time).&#xA;Here we will use a Sigma rule from the&#xA;&lt;a href=&#34;https://sigma.velocidex.com/docs/artifacts/velociraptor_hayabusa_ruleset/&#34; target=&#34;_blank&#34; &gt;Hayabusa Rules&lt;/a&gt;&#xA;ruleset.&lt;/p&gt;&#xA;&lt;p&gt;In order for this to work you&amp;rsquo;ll need to have already imported the &amp;ldquo;Velociraptor&#xA;Hayabusa Ruleset&amp;rdquo; by running the &lt;code&gt;Server.Import.CuratedSigma&lt;/code&gt; server artifact on&#xA;your server. To learn more about Sigma rules in Velociraptor&#xA;&lt;a href=&#34;https://sigma.velocidex.com/docs/sigma_in_velociraptor/&#34; target=&#34;_blank&#34; &gt;see this page&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_labels//knowledge_base/tips/automating_labels/sigma_import.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Running Server.Import.CuratedSigma&#34;&#xA;         width=&#34;929&#34; height=&#34;447&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;sigma_import.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Running Server.Import.CuratedSigma&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The Sigma rule we will be using in this example is&#xA;&lt;a href=&#34;https://github.com/Yamato-Security/hayabusa-rules/blob/main/sigma/builtin/windefend/win_defender_threat.yml&#34; target=&#34;_blank&#34; &gt;Windows Defender Threat Detected&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When interrogation happens on the client we want it to also check whether&#xA;Windows Defender has detected any threats in the past 24 hours. This may be a&#xA;somewhat contrived example but it (or something similar) may also have realworld&#xA;usefulness in some scenarios, like for example: if you are rolling out&#xA;Velociraptor clients in response to an incident. It may be useful to have&#xA;endpoints flagged based on recent Defender detections to aid with triage.&lt;/p&gt;&#xA;&lt;p&gt;As explained&#xA;&lt;a href=&#34;https://www.velociraptor-docs.org/docs/clients/interrogation/&#34;&gt;here&lt;/a&gt;,&#xA;the default interrogation artifact can be overridden with a custom version. If&#xA;such a custom artifact is present on the Velociraptor server then all clients&#xA;will use it.&lt;/p&gt;&#xA;&lt;p&gt;When creating our custom version, we want to modify the default artifact as&#xA;little as possible, as advised in the artifact&amp;rsquo;s description, so we are only&#xA;going to add a new source to it: one which calls the &lt;code&gt;Windows.Hayabusa.Rules&lt;/code&gt;&#xA;artifact.&lt;/p&gt;&#xA;&lt;p&gt;We do this by editing the default &lt;code&gt;Generic.Client.Info&lt;/code&gt; artifact. By default the&#xA;name of the edited artifact will be &lt;code&gt;Custom.Generic.Client.Info&lt;/code&gt; which is&#xA;exactly what we want it to be.&lt;/p&gt;&#xA;&lt;p&gt;In the custom version we add a new source after the existing ones (around line&#xA;115 in the current default artifact):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-vql&#34;&gt;  - name: RecentDefenderDetections&#xA;    precondition: SELECT OS From info() where OS = &#39;windows&#39;&#xA;    query: |&#xA;      LET past_day &amp;lt;= timestamp_format(time=now() - 86400)&#xA;      SELECT *&#xA;      FROM Artifact.Windows.Hayabusa.Rules(RuleLevel=&amp;quot;All&amp;quot;,&#xA;                                           RuleStatus=&amp;quot;All Rules&amp;quot;,&#xA;                                           RuleTitleFilter=&amp;quot;Windows Defender Threat Detected&amp;quot;,&#xA;                                           DateAfter=past_day)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If we now run an interrogation manually on a Windows client where we have&#xA;deliberately triggered a detection using the EICAR test file, we see that the&#xA;Sigma rule has run and that the detection has been included in the collection&#xA;results.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;  &#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_labels//knowledge_base/tips/automating_labels/defender_detection_.svg&#34; alt=&#34;Manual interrogation test&#34;&#xA;         class=&#34;inline&#34;&#xA;         height=&#34;558&#34;&#xA;         width=&#34;1096&#34;  /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;defender_detection.svg&#34;&gt;&lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Manual interrogation test&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;We have now extended our interrogation data with something more dynamic than in&#xA;the first example. The remaining steps are essentially the same except that we&#xA;are monitoring a different source and adding a different label.&lt;/p&gt;&#xA;&lt;p&gt;We add a new &lt;code&gt;SERVER_EVENT&lt;/code&gt; artifact:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: LabelRecentDefenderDetections&#xA;type: SERVER_EVENT&#xA;sources:&#xA;- query: |&#xA;    LET interrogations = SELECT *&#xA;    FROM watch_monitoring(artifact=&amp;quot;System.Flow.Completion&amp;quot;)&#xA;    WHERE Flow.artifacts_with_results =~ &amp;quot;Custom.Generic.Client.Info/RecentDefenderDetections&amp;quot;&#xA;&#xA;    SELECT *,&#xA;    label(client_id=ClientId, labels=&amp;quot;Recent Threat Detection&amp;quot;, op=&amp;quot;set&amp;quot;)&#xA;    FROM interrogations&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This artifact is slightly simpler than the one in the previous example because&#xA;we don&amp;rsquo;t need to check for any specific value in the results. If the results&#xA;contain &lt;em&gt;any&lt;/em&gt; rows then we want the label to be applied. Of course you could&#xA;make it more sophisticated if you wanted.&lt;/p&gt;&#xA;&lt;p&gt;Lastly we add the artifact to the server event table as we did with the first&#xA;example.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_labels//knowledge_base/tips/automating_labels/event_monitoring2.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Installing server event monitoring&#34;&#xA;         width=&#34;1200&#34; height=&#34;800&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;event_monitoring2.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Installing server event monitoring&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Now the interrogation of any Windows client will also check the Windows Defender&#xA;logs and if a threat was logged in the past 24 hours the client will be labelled&#xA;&amp;ldquo;Recent Threat Detection&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/automating_labels//knowledge_base/tips/automating_labels/label_added.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Label added!&#34;&#xA;         width=&#34;1200&#34; height=&#34;533&#34;&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    &lt;a class=&#34;image-link&#34;&#xA;       target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&#xA;       href=&#34;label_added.png&#34;&gt;&#xA;      &lt;i class=&#34;fa fa-download&#34;&gt;&lt;/i&gt;&lt;/a&gt;&#xA;    Label added!&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;As with the basic use case you can force all clients to re-run this check by&#xA;creating a hunt for the &lt;code&gt;Custom.Generic.Client.Info&lt;/code&gt; artifact.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How can I configure Velociraptor for multiple SSO providers</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/multiple_oauth/</link>
      <pubDate>Sat, 26 Mar 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/multiple_oauth/</guid>
      <description>&lt;h1 id=&#34;how-can-i-configure-velociraptor-for-multiple-sso-providers&#34;&gt;How can I configure Velociraptor for multiple SSO providers&lt;/h1&gt;&#xA;&lt;p&gt;Velociraptor can be configured to use a single SSO provider using the usual configuration building wizard (see &lt;a href=&#34;https://www.velociraptor-docs.org/docs/deployment/server/&#34;&gt;Here&lt;/a&gt;), but the wizard does not offer to configure multiple providers.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes we want to have multiple providers so we can allow users from another organization to be able to log into Velociraptor. To do this we need to configure the SSO authenticator manually in the configuration file.&lt;/p&gt;&#xA;&lt;p&gt;Simply run &lt;code&gt;velociraptor config generate -i&lt;/code&gt; and select the OAuth provider for the first provider. In the end your config file will have the following section where &lt;code&gt;oauth_client_id&lt;/code&gt; and &lt;code&gt;oauth_client_secret&lt;/code&gt; refer to the Google OAuth app you created:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;GUI:&#xA;  ... more settings ...&#xA;  authenticator:&#xA;    type: Google&#xA;    oauth_client_id: 12345.apps.googleusercontent.com&#xA;    oauth_client_secret: XYZ1234&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To provide multiple authenticators, you will need to manually change to the &lt;code&gt;multi&lt;/code&gt; authenticator type:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;GUI:&#xA;  ... more settings ...&#xA;  authenticator:&#xA;    type: multi&#xA;    sub_authenticators:&#xA;     - type: Google&#xA;       oauth_client_id: 12345.apps.googleusercontent.com&#xA;       oauth_client_secret: XYZ1234&#xA;     - type: GitHub&#xA;       oauth_client_id: 123456&#xA;       oauth_client_secret: 76521376523&#xA;     - type: oidc&#xA;       oidc_issuer: https://accounts.google.com&#xA;       oidc_name: Rapid7&#xA;       avatar: https://example.com/avatar.png&#xA;       oauth_client_id: XXXXX&#xA;       oauth_client_secret: AAAAA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note that you can have multiple &lt;code&gt;OIDC&lt;/code&gt; authenticators and each can have a separate name and an icon associated with it (e.g. if multiple organizations use separate Okta logins).&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/multiple_oauth/https://user-images.githubusercontent.com/3856546/160241517-c2bf85e5-7d5d-4d3b-ac24-b2bfbda5436b.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Logging in with multiple providers&#34; /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    Logging in with multiple providers&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;granting-a-user-a-role&#34;&gt;Granting a user a role.&lt;/h2&gt;&#xA;&lt;p&gt;Velociraptor will trust any of the configured authenticators, to identify the user and based on the username, grant the user the appropriate roles on the Velociraptor server. You will need to grant the user a role either through the command line:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;velociraptor user add --role administrator mike@gmail.comm&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Or via a notebook cell:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sql&#34;&gt;SELECT user_create(user=&amp;quot;mike@gmail.com&amp;quot;, role=&amp;quot;administrator&amp;quot;)&#xA;FROM scope()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;div class=&#34;mynotices warning&#34;&gt;&#xA;  &lt;div heading=&#34; Trusting multiple providers &#34;&gt;&lt;p&gt;Be aware that trusting multiple identity providers can result in account hijack if a user can get an account of the same name on another provider. Velociraptor just uses the account name provided by the OAuth provider to grant access and does not keep track of which provider actually identified the user.&lt;/p&gt;&#xA;&lt;p&gt;In simple terms, if a user has username &amp;ldquo;mike&amp;rdquo; on &lt;code&gt;OIDC&lt;/code&gt; provider 1 and another user can get say a GitHub account for the user &amp;ldquo;mike&amp;rdquo;, then the second user can impersonate the first user by logging in with the second provider.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;</description>
    </item>
    <item>
      <title>How do I debug the client while it is running?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/debugging_clients/</link>
      <pubDate>Mon, 21 Mar 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/debugging_clients/</guid>
      <description>&lt;h1 id=&#34;how-do-i-debug-the-client-while-it-is-running&#34;&gt;How do I debug the client while it is running?&lt;/h1&gt;&#xA;&lt;p&gt;Sometimes we collect artifacts from clients but for some reason things seem to take longer than expected. Velociraptor has mechanisms to gain visibility into how clients behave and what queries are running.&lt;/p&gt;&#xA;&lt;h2 id=&#34;query-logs&#34;&gt;Query logs&lt;/h2&gt;&#xA;&lt;p&gt;The first port of call is viewing the query logs in the logs tab of the relevant collection.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/debugging_clients/https://user-images.githubusercontent.com/3856546/159195874-ec6c8322-cb70-4254-861a-95888db94201.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Viewing the query logs&#34; /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    Viewing the query logs&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;As the query is running, it will emit a message to let us know that it is waiting for rows. We use this to determine that the query is still running on the client.&lt;/p&gt;&#xA;&lt;h2 id=&#34;collecting-profiles&#34;&gt;Collecting profiles&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;code&gt;Generic.Client.Profile&lt;/code&gt; artifact allows us to collect internal state of the client. Simply collect this from the client, while other queries are running&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;figure&#34;&gt;&#xA;    &lt;img src=&#34;https://www.velociraptor-docs.org/knowledge_base/tips/debugging_clients/https://user-images.githubusercontent.com/3856546/159196011-28808471-4111-42ba-bfd3-819381bdf596.png&#34;&#xA;         class=&#34;inline&#34;&#xA;         alt=&#34;Client Profile&#34; /&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    Client Profile&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The most common thing to collect include:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The Goroutine dump shows a stack trace of all currently running goroutines (similar to threads). This helps us understand if there is a deadlock or another bug.&lt;/li&gt;&#xA;&lt;li&gt;The logs delivers a recent dump of client logs. Normally the client does &lt;strong&gt;not&lt;/strong&gt; write it&amp;rsquo;s logs to file to avoid information leakage issues. You can see the logs on the console by running the client with the &lt;code&gt;-v&lt;/code&gt; flag, but each client also keeps the last 1000 messages in a memory buffer so they can be available if needed. This option sends the recent logs to the server.&lt;/li&gt;&#xA;&lt;li&gt;Query logs are a recent log of VQL queries running on the endpoint. This gives us an idea of exactly what the client is doing.&lt;/li&gt;&#xA;&lt;li&gt;Metrics are internal program counters that provide visibility of performance related items.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;When asking for help on Discord or our mailing list, we will often ask for the profiles collected from the client (or server). At a minimum we will need the above items to diagnose any issues.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices tip&#34;&gt;&#xA;  &lt;div heading=&#34;tip&#34;&gt;&lt;p&gt;The nice thing about collecting profiles is that the client does &lt;strong&gt;not&lt;/strong&gt; need to be restarted and we do not need to run a special debug build - all clients are capable of collecting profile information at any time.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h3 id=&#34;references&#34;&gt;References&lt;/h3&gt;&#xA;&lt;p&gt;You can read more about &lt;a href=&#34;https://www.velociraptor-docs.org/blog/2020/2020-08-16-profiling-the-beast-58913437fd16/&#34;&gt;profiling Velociraptor here&lt;/a&gt;.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How do I deploy the client as agentless (without install)?</title>
      <link>https://www.velociraptor-docs.org/knowledge_base/tips/deploying_in_agentless_mode/</link>
      <pubDate>Mon, 21 Mar 2022 00:00:00 +0000</pubDate>
      <guid>https://www.velociraptor-docs.org/knowledge_base/tips/deploying_in_agentless_mode/</guid>
      <description>&lt;h1 id=&#34;how-do-i-deploy-the-client-as-agentless-without-install&#34;&gt;How do I deploy the client as agentless (without install)?&lt;/h1&gt;&#xA;&lt;p&gt;Sometimes we need to deploy Velociraptor in an IR and can not install&#xA;it permanently as a service.&lt;/p&gt;&#xA;&lt;h2 id=&#34;windows-environments&#34;&gt;Windows Environments&lt;/h2&gt;&#xA;&lt;p&gt;It is possible to deploy the client using Group Policy by using&#xA;&lt;code&gt;Scheduled task&lt;/code&gt; feature to cause domain connected machines to run the&#xA;client. See details &lt;a href=&#34;https://www.velociraptor-docs.org/blog/html/2019/03/02/agentless_hunting_with_velociraptor/&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The first step is to place the client and the generated&#xA;&lt;code&gt;client.config.yaml&lt;/code&gt; on a public read only windows share.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Update the config file&amp;rsquo;s writeback location to somewhere writable&#xA;on the client (e.g. &lt;code&gt;C:\Windows\Temp\velo.writeback.yaml&lt;/code&gt;)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Next create a &lt;code&gt;Scheduled Task&lt;/code&gt; in a new group policy object that&#xA;applies to the relevant OU.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The scheduled task should be launched as &lt;code&gt;NT_AUTHORITY\SYSTEM&lt;/code&gt; from&#xA;the read only share. With the appropriate command line. For example:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code&gt;\\dc\deployment\velociraptor.exe --config \\dc\deployment\client.config.yaml client --mutant MyVeloName&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;div class=&#34;mynotices warning&#34;&gt;&#xA;  &lt;div heading=&#34; Controlling number of instances &#34;&gt;&lt;p&gt;Window&amp;rsquo;s Group Policy allows setting only a single instance of the&#xA;program to run at the time, however we found in practice this is not&#xA;reliable and sometimes GPO will launch dozens of copies of&#xA;Velociraptor over time. To avoid this we use the &lt;code&gt;--mutant&lt;/code&gt; flag which&#xA;will exit if a mutant of this name already exists.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;h2 id=&#34;linux-environments&#34;&gt;Linux Environments&lt;/h2&gt;&#xA;&lt;h3 id=&#34;systemd&#34;&gt;Systemd&lt;/h3&gt;&#xA;&lt;p&gt;It is possible to execute a program in a &amp;ldquo;transient scope&amp;rdquo;, which enables it to be controlled and inspected just like a regular service (unit) in Linux, without the need to create persistent configurations.&#xA;Using &lt;code&gt;systemd-run&lt;/code&gt; the process will be executed and its parent will be the &lt;code&gt;init&lt;/code&gt; process, and will not terminate until the host is rebooted.&lt;/p&gt;&#xA;&lt;p&gt;To execute the Velociraptor binary run the following:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;systemd-run -u velociraptor_tmp /tmp/velociraptor.bin client --config /tmp/client.config.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Once the service is running, you should now be free to terminate the SSH / management session without terminating the process.&lt;/p&gt;&#xA;&lt;p&gt;You can manually terminate the service with: &lt;code&gt;systemctl stop velociraptor_tmp.service &lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can check it&amp;rsquo;s status with: &lt;code&gt;systemctl status velociraptor_tmp.service&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;mynotices warning&#34;&gt;&#xA;  &lt;div heading=&#34; Temporary locations &#34;&gt;&lt;p&gt;On Linux /tmp is cleaned up by a service, which gets triggered on shutdown.&#xA;You will need to arrange for the Velociraptor binary and configuration file to be transferred again if the host reboots.&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;p&gt;You can read more about the &lt;code&gt;systemd-run&lt;/code&gt; here for flags etc: &lt;a href=&#34;https://www.freedesktop.org/software/systemd/man/systemd-run.html&#34; target=&#34;_blank&#34; &gt;https://www.freedesktop.org/software/systemd/man/systemd-run.html&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
  </channel>
</rss>
