{"id":9911,"date":"2021-07-30T14:06:07","date_gmt":"2021-07-30T11:06:07","guid":{"rendered":"https:\/\/kifarunix.com\/?p=9911"},"modified":"2024-03-18T19:29:53","modified_gmt":"2024-03-18T16:29:53","slug":"install-and-setup-velociraptor-on-debian-10","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-and-setup-velociraptor-on-debian-10\/","title":{"rendered":"Install and Setup Velociraptor on Debian 10"},"content":{"rendered":"\n
Welcome to our tutorial on how to install and setup Velociraptor on Debian 10. Velociraptor<\/a> is an endpoint monitoring open source tool that allows collection of host based state information of various end points using Velocidex Query Language (VQL) queries for monitoring. It is based on GRR, OSQuery and Google\u2019s Rekall tool.<\/p>\n\n\n\n There are different methods of deploying Velociraptor as outlined on getting started page<\/a>.<\/p>\n\n\n\n In this tutorial, we will deploy Velociraptor using the standalone deployment method. This method employs server-client deployment model. Agents are installed on clients systems to be monitored.<\/p>\n\n\n\n Velociraptor has six main components:<\/p>\n\n\n\n Get the latest Velociraptor Linux binary from the official Velociraptor Github releases<\/a> page and save it to system binary directory.<\/p>\n\n\n\n Download the current release version of Velociraptor from the Github repository page above.<\/p>\n\n\n\n Replace the value of the VER variable above with the current release version number.<\/p>\n\n\n\n Then run the command below to download Velociraptor installer;<\/p>\n\n\n\n This downloads the binary and save it as Once the download of the binary installer is complete, make it executable by running the command below;<\/p>\n\n\n\n The binary should now be available on the current PATH.<\/p>\n\n\n\n Velociraptor uses a pair of configuration files to control the server and endpoints<\/em>. To generate server configuration file, you can use the command To obtain help about this command, run;<\/p>\n\n\n\n You can run the command interactively or you can run it non-interactively and later customize the auto-generated configuration file.<\/p>\n\n\n\n Before we proceed, create a configuration directory for Velociraptor;<\/p>\n\n\n\n To run the Velociraptor configuration generation command interactively;<\/p>\n\n\n\n When run, you will be prompted to provides some required details.<\/p>\n\n\n\n Choose the operating system, which in this setup is Linux, press ENTER to proceed<\/p>\n\n\n\n Choose data store directory. press enter to choose default path otherwise, enter your path<\/strong>;<\/p>\n\n\n\n Choose the kind of SSL\/TLS certs to use, we use self signed in this setup.<\/p>\n\n\n\n Set the frontend domain name that you can use to access Velociraptor;<\/p>\n\n\n\n Ensure the hostname is resolvable<\/strong>.<\/p>\n\n\n\n Set the Frontend and GUI ports;<\/p>\n\n\n\n Set the frontend login credentials. Press enter once you have set the users to end the user creation prompt;<\/p>\n\n\n\n Sample output after user creation;<\/p>\n\n\n\n Set the logging directory;<\/p>\n\n\n\n Set the path to write the configuration files to;<\/p>\n\n\n\n Client configuration file;<\/p>\n\n\n\n And that is it.<\/p>\n\n\n\n If you want to manually generate the configuration file for later customization, simply run<\/p>\n\n\n\n This generates the config to the standard output.<\/p>\n\n\n\n To save to a file;<\/p>\n\n\n\n Update the Velociraptor API, GUI, Monitoring bind addresses which is set to loopback address by default. Replace the IP: 192.168.59.12 with your server’s IP address.<\/p>\n\n\n\n Optionally you can change the server url<\/em>, the Frontend bind address etc.<\/p>\n\n\n\n Additionally, you can open the configuration file, Its important to note client \u2013 server communications are encrypted over HTTPS. The keys are embedded in the configuration file.<\/p>\n\n\n\n You can create additional user to access the GUI by running the command below;<\/p>\n\n\n\n Enter a password for the user when prompted:<\/p>\n\n\n\n The above command adds the user Other available roles are:<\/p>\n\n\n\n You can run Velociraptor in standalone mode or as a service.<\/p>\n\n\n\n To run in standalone mode, use the Sample output:<\/p>\n\n\n\n The output indicates which port the GUI and Front-end are listening on.<\/p>\n\n\n\n Access the server on https:\/\/SERVER-IP:8889<\/strong>. Use the user and password created earlier.<\/p>\n\n\n\n GUI communications are authenticated with basic Auth.<\/p>\n\n\n\n You can create systemd service to run Velociraptor as a service.<\/p>\n\n\n\n Create the systemd service file:<\/p>\n\n\n\n Reload systemd daemon:<\/p>\n\n\n\n Start and enable velociraptor to start at boot time:<\/p>\n\n\n\n Check the status of velociraptor.<\/p>\n\n\n\n Access the GUI and login into the interface, you\u2019ll see Velociraptor GUI dashboard.<\/p>\n\n\n\n If UFW is running, open the port in firewall;<\/p>\n\n\n\n Accept the self signed SSL warning and proceed to login to Velociraptor GUI.<\/p>\n\n\n\n Login with the user credentials created before.<\/p>\n\n\n\n <\/a><\/p>\n\n\n\n <\/a><\/p>\n\n\n\n As stated before, Velociraptor server-client communication happens over an encrypted HTTPS channel. You can use self signed SSL or commercially trusted SSL certs.<\/p>\n\n\n\n If you had generated the velociraptor config file manually <\/strong>and you are using the signed SSL certs, then edit the \/etc\/velociraptor\/server.config.yaml<\/em><\/strong> configuration file and append the directive Save and exit the file.<\/p>\n\n\n\n If you had generated the configuration file manually, then generate the client configuration file<\/p>\n\n\n\n NOTE:<\/em><\/strong> Velociraptor clients can be configured in two ways;<\/p>\n\n\n\n This method involves using Velociraptor binary and client configuration file generated from the server. The client configuration file has to be copied to the client machine. This method is ideal for testing purposes, for large deployment the second method, below, is preferred.<\/p>\n\n\n\n This method packages the client configuration file on a Linux package or Windows installer which are then distributed to the clients target machines.<\/p>\n\n\n\n Follow the link below to learn how to install and configure Velociraptor clients on Linux and Windows machines.<\/p>\n\n\n\n Install Velociraptor Client on Linux and Windows Systems<\/a><\/p>\n\n\n\n That brings us to the end of our guide on how to install and setup Velociraptor. Velociraptor is powerful open source tool that can be used to query hosts thus providing endpoint monitoring, digital forensic investigations and Threat Hunting.<\/p>\n\n\n\n Velociraptor Documentation<\/a><\/p>\n\n\n\n Install GVM 21.04 on Rocky Linux 8<\/a><\/p>\n\n\n\nInstalling Velociraptor on Debian 10<\/h2>\n\n\n\n
\n
Download Linux binary Installer<\/strong><\/h3>\n\n\n\n
VER=0.6.0<\/code><\/pre>\n\n\n\n
wget https:\/\/github.com\/Velocidex\/velociraptor\/releases\/download\/v$VER\/velociraptor-v$VER-linux-amd64 -O \/usr\/local\/bin\/velociraptor<\/code><\/pre>\n\n\n\n
\/usr\/local\/bin\/velociraptor<\/strong><\/code>.<\/p>\n\n\n\n
Make the Velociraptor Binary executable<\/strong><\/h3>\n\n\n\n
chmod +x \/usr\/local\/bin\/velociraptor<\/code><\/pre>\n\n\n\n
which velociraptor<\/code><\/pre>\n\n\n\n
\/usr\/local\/bin\/velociraptor<\/code><\/pre>\n\n\n\n
Generate Velociraptor Server Config File<\/strong><\/h3>\n\n\n\n
velociraptor config generate<\/strong><\/code>.<\/p>\n\n\n\n
velociraptor config generate --help<\/code><\/pre>\n\n\n\n
mkdir \/etc\/velociraptor<\/code><\/pre>\n\n\n\n
velociraptor config generate -i<\/code><\/pre>\n\n\n\n
? \nWelcome to the Velociraptor configuration generator\n---------------------------------------------------\n\nI will be creating a new deployment configuration for you. I will\nbegin by identifying what type of deployment you need.\n\n\nWhat OS will the server be deployed on?\n [Use arrows to move, type to filter]\n> linux\n<\/strong> windows\n darwin<\/code><\/pre>\n\n\n\n
? Path to the datastore directory. (\/opt\/velociraptor) \/var\/tmp\/velociraptor<\/strong><\/code><\/pre>\n\n\n\n
> Self Signed SSL\n<\/strong> Automatically provision certificates with Lets Encrypt\n Authenticate users with SSO<\/code><\/pre>\n\n\n\n
? What is the public DNS name of the Frontend (e.g. www.example.com): [? for help] (localhost) vraptor.kifarunix-demo.com<\/strong><\/code><\/pre>\n\n\n\n
? Enter the frontend port to listen on. 8000\n? Enter the port for the GUI to listen on. 8889\n? Are you using Google Domains DynDNS? No<\/code><\/pre>\n\n\n\n
? GUI Username or email address to authorize (empty to end): kifarunix-demo-admin<\/strong>\n? Password ******<\/strong><\/code><\/pre>\n\n\n\n
\n[INFO] 2021-04-26T18:16:59Z _ __ __ _ __ \n[INFO] 2021-04-26T18:16:59Z | | \/ \/__ \/ \/___ _____(_)________ _____ \/ \/_____ _____ \n[INFO] 2021-04-26T18:16:59Z | | \/ \/ _ \\\/ \/ __ \\\/ ___\/ \/ ___\/ __ `\/ __ \\\/ __\/ __ \\\/ ___\/ \n[INFO] 2021-04-26T18:16:59Z | |\/ \/ __\/ \/ \/_\/ \/ \/__\/ \/ \/ \/ \/_\/ \/ \/_\/ \/ \/_\/ \/_\/ \/ \/ \n[INFO] 2021-04-26T18:16:59Z |___\/\\___\/_\/\\____\/\\___\/_\/_\/ \\__,_\/ .___\/\\__\/\\____\/_\/ \n[INFO] 2021-04-26T18:16:59Z \/_\/ \n[INFO] 2021-04-26T18:16:59Z Digging deeper! https:\/\/www.velocidex.com \n[INFO] 2021-04-26T18:16:59Z This is Velociraptor 0.5.8 built on 2021-04-11T22:09:54Z (e468f54c) \n[INFO] 2021-04-26T18:16:59Z Generating keys please wait.... \n<\/code><\/pre>\n\n\n\n
? Path to the logs directory. (\/var\/tmp\/velociraptor\/logs) \/var\/log\/velociraptor<\/strong><\/code><\/pre>\n\n\n\n
? Where should i write the server config file? (server.config.yaml) \/etc\/velociraptor\/server.config.yaml<\/strong><\/code><\/pre>\n\n\n\n
? Where should i write the client config file? (client.config.yaml) \/etc\/velociraptor\/client.config.yaml<\/strong><\/code><\/pre>\n\n\n\n
velociraptor config generate<\/code><\/pre>\n\n\n\n
velociraptor config generate > \/etc\/velociraptor\/server.config.yaml<\/code><\/pre>\n\n\n\n
Velociraptor API, GUI, Monitoring bind addresses<\/h3>\n\n\n\n
sed -e '\/bind_address:\/{s\/127.0.0.1\/192.168.59.12\/}' -i \/etc\/velociraptor\/server.config.yaml<\/code><\/pre>\n\n\n\n
\/etc\/velociraptor\/server.config.yaml<\/code><\/strong>, for editing to update the Datastore location, where Velociraptor is going to save its files.<\/p>\n\n\n\n
Datastore:\n implementation: FileBaseDataStore\n location: \/var\/tmp\/velociraptor<\/strong>\n filestore_directory: \/var\/tmp\/velociraptor<\/strong><\/code><\/pre>\n\n\n\n
Create Additional GUI user<\/strong>s<\/h3>\n\n\n\n
velociraptor --config \/etc\/velociraptor\/server.config.yaml user add admin --role administrator<\/code><\/pre>\n\n\n\n
admin<\/code><\/em><\/strong> with the
administrator<\/code><\/em> role.<\/p>\n\n\n\n
\n
Start Velociraptor Frontend<\/strong><\/h3>\n\n\n\n
Running Velociraptor in Standalone Mode<\/h4>\n\n\n\n
frontend<\/strong><\/code> command as follows;<\/p>\n\n\n\n
velociraptor -c \/etc\/velociraptor\/server.config.yaml frontend -v<\/code><\/pre>\n\n\n\n
-v<\/code> flag is used to show verbose output on the terminal.<\/p>\n\n\n\n
\n[INFO] 2021-07-30T06:42:04-04:00 _ __ __ _ __ \n[INFO] 2021-07-30T06:42:04-04:00 | | \/ \/__ \/ \/___ _____(_)________ _____ \/ \/_____ _____ \n[INFO] 2021-07-30T06:42:04-04:00 | | \/ \/ _ \\\/ \/ __ \\\/ ___\/ \/ ___\/ __ `\/ __ \\\/ __\/ __ \\\/ ___\/ \n[INFO] 2021-07-30T06:42:04-04:00 | |\/ \/ __\/ \/ \/_\/ \/ \/__\/ \/ \/ \/ \/_\/ \/ \/_\/ \/ \/_\/ \/_\/ \/ \/ \n[INFO] 2021-07-30T06:42:04-04:00 |___\/\\___\/_\/\\____\/\\___\/_\/_\/ \\__,_\/ .___\/\\__\/\\____\/_\/ \n[INFO] 2021-07-30T06:42:04-04:00 \/_\/ \n[INFO] 2021-07-30T06:42:04-04:00 Digging deeper! https:\/\/www.velocidex.com \n[INFO] 2021-07-30T06:42:04-04:00 This is Velociraptor 0.6.0 built on 2021-06-25T02:05:13+10:00 (5957468b) \n[INFO] 2021-07-30T06:42:04-04:00 Loading config from file \/etc\/velociraptor\/server.config.yaml\n....\n....\n[INFO] 2021-07-30T06:42:05-04:00 Starting Hunt Dispatcher Service. \n[INFO] 2021-07-30T06:42:05-04:00 Compiled all artifacts. \n[INFO] 2021-07-30T06:42:05-04:00 Starting the hunt manager service with rate limit 30\/s. \n[INFO] 2021-07-30T06:42:05-04:00 Watching for events from Server.Internal.HuntModification \n[INFO] 2021-07-30T06:42:05-04:00 Watching for events from System.Hunt.Participation \n[INFO] 2021-07-30T06:42:05-04:00 Watching for events from Server.Internal.Label \n[INFO] 2021-07-30T06:42:05-04:00 Watching for events from System.Flow.Completion \n[INFO] 2021-07-30T06:42:05-04:00 Starting Enrollment service. \n[INFO] 2021-07-30T06:42:05-04:00 Watching for events from System.Flow.Completion \n[INFO] 2021-07-30T06:42:05-04:00 Watching for events from Server.Internal.Enrollment \n[INFO] 2021-07-30T06:42:05-04:00 server_monitoring: Starting Server Monitoring Service \n[INFO] 2021-07-30T06:42:05-04:00 Closing Server Monitoring Event table \n[INFO] 2021-07-30T06:42:05-04:00 server_monitoring: Updating monitoring table \n[INFO] 2021-07-30T06:42:05-04:00 Starting VFS writing service. \n[INFO] 2021-07-30T06:42:05-04:00 Watching for events from System.Flow.Completion \n[INFO] 2021-07-30T06:42:05-04:00 Watching for events from System.Flow.Completion \n[INFO] 2021-07-30T06:42:05-04:00 Starting Server Artifact Runner Service \n[INFO] 2021-07-30T06:42:05-04:00 Watching for events from Server.Internal.ClientDelete \n[INFO] 2021-07-30T06:42:05-04:00 Throttling connections to 100 QPS \n[INFO] 2021-07-30T06:42:05-04:00 Starting gRPC API server on 192.168.59.12:8001 \n[INFO] 2021-07-30T06:42:05-04:00 Launched Prometheus monitoring server on 192.168.59.12:8003 \n[INFO] 2021-07-30T06:42:05-04:00 GUI is ready to handle TLS requests on https:\/\/192.168.59.12:8889\/ \n[INFO] 2021-07-30T06:42:05-04:00 Frontend is ready to handle client TLS requests at https:\/\/vraptor.kifarunix-demo.com:8000\/ \n<\/code><\/pre>\n\n\n\n
Accessing Velociraptor Web Interface<\/h4>\n\n\n\n
Running Velociraptor as a service<\/strong><\/h4>\n\n\n\n
\ncat > \/etc\/systemd\/system\/velociraptor.service << EOL\n[Unit]\nDescription=Velociraptor linux amd64\nAfter=syslog.target network.target\n\n[Service]\nType=simple\nRestart=always\nRestartSec=120\nLimitNOFILE=20000\nEnvironment=LANG=en_US.UTF-8\nExecStart=\/usr\/local\/bin\/velociraptor -c \/etc\/velociraptor\/server.config.yaml frontend -v\n\n[Install]\nWantedBy=multi-user.target\nEOL\n<\/code><\/pre>\n\n\n\n
systemctl daemon-reload<\/code><\/pre>\n\n\n\n
systemctl enable --now velociraptor <\/code><\/pre>\n\n\n\n
systemctl status velociraptor<\/code><\/pre>\n\n\n\n
\n\u25cf velociraptor.service - Velociraptor linux amd64\n Loaded: loaded (\/etc\/systemd\/system\/velociraptor.service; enabled; vendor preset: enabled)\n Active: active (running) since Fri 2021-07-30 06:46:01 EDT; 6s ago\n Main PID: 1157 (velociraptor)\n Tasks: 8 (limit: 2359)\n Memory: 45.2M\n CGroup: \/system.slice\/velociraptor.service\n \u2514\u25001157 \/usr\/local\/bin\/velociraptor -c \/etc\/velociraptor\/server.config.yaml frontend -v\n\nJul 30 06:46:01 debian velociraptor[1157]: [INFO] 2021-07-30T06:46:01-04:00 Watching for events from System.Flow.Completion\nJul 30 06:46:01 debian velociraptor[1157]: [INFO] 2021-07-30T06:46:01-04:00 Watching for events from System.Flow.Completion\nJul 30 06:46:01 debian velociraptor[1157]: [INFO] 2021-07-30T06:46:01-04:00 Starting Server Artifact Runner Service\nJul 30 06:46:01 debian velociraptor[1157]: [INFO] 2021-07-30T06:46:01-04:00 Watching for events from Server.Internal.ClientDelete\nJul 30 06:46:01 debian velociraptor[1157]: [INFO] 2021-07-30T06:46:01-04:00 Throttling connections to 100 QPS\nJul 30 06:46:01 debian velociraptor[1157]: [INFO] 2021-07-30T06:46:01-04:00 Starting gRPC API server on 192.168.59.12:8001\nJul 30 06:46:01 debian velociraptor[1157]: [INFO] 2021-07-30T06:46:01-04:00 Launched Prometheus monitoring server on 192.168.59.12:8003\nJul 30 06:46:01 debian velociraptor[1157]: [INFO] 2021-07-30T06:46:01-04:00 GUI is ready to handle TLS requests on https:\/\/192.168.59.12:8889\/\nJul 30 06:46:01 debian velociraptor[1157]: [INFO] 2021-07-30T06:46:01-04:00 Frontend is ready to handle client TLS requests at https:\/\/vraptor.kifarunix-demo.com:8000\/\nJul 30 06:46:01 debian velociraptor[1157]: [INFO] 2021-07-30T06:46:01-04:00 Compiled all artifacts.\n<\/code><\/pre>\n\n\n\n
ufw allow 8889\/tcp<\/code><\/pre>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
Install and Configure Velociraptor Client<\/h3>\n\n\n\n
use_self_signed_ssl: true<\/strong><\/code> in the block below the Frontentd<\/strong> URL CA certificate<\/strong><\/em> so as to use the self signed certificate.<\/p>\n\n\n\n
vim \/etc\/velociraptor\/server.config.yaml<\/code><\/pre>\n\n\n\n
...\n nonce: ERlmU1Ivj5w=\n use_self_signed_ssl: true\n<\/strong> writeback_darwin: \/etc\/velociraptor.writeback.yaml\n writeback_linux: \/etc\/velociraptor.writeback.yaml\n...<\/code><\/pre>\n\n\n\n
velociraptor -c \/etc\/velociraptor\/server.config.yaml config client > \/etc\/velociraptor\/client.config.yaml<\/code><\/pre>\n\n\n\n
\n
Client configuration file contains CA certificate that is used for authentication between the client\u2019s machine and the Velociraptor Server.<\/em><\/p>\n<\/blockquote>\n\n\n\nInstall Velociraptor Clients on Linux and Windows Machines<\/h4>\n\n\n\n
Using Velociraptor Binary<\/strong><\/h5>\n\n\n\n
Using Velociraptor client packages<\/strong><\/h5>\n\n\n\n
Conclusion<\/h3>\n\n\n\n
Further Reading<\/h3>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n