velociraptorforensicsdfir
MDstable
NoteSnippetChecklistPlaybook
Velociraptor — Forensique & Collecte Distante
Déploiement Velociraptor : collecte d'artefacts forensiques à distance, hunting, VQL, intégration SOC
snippetintermediate 2026-06-19 4 min read
velociraptorforensicsdfirhuntingvqlendpointsoc
Présentation
Velociraptor est un outil de forensique et de chasse aux menaces (threat hunting) sur les endpoints. Il permet de :
- Collecter des artefacts forensiques à distance (RAM, fichiers, registry, logs)
- Exécuter des requêtes VQL sur des milliers d'endpoints simultanément
- Répondre aux incidents sans déplacement physique
Architecture
Server Velociraptor port 8000/8889TLS mutuellement authentifiClient Velociraptor agent sur chaque endpointWindows Linux macOS
Déploiement — Serveur
bash
# Télécharger le binairewget https//github.com/Velocidex/velociraptor/releases/download/v0.73/velociraptor-v0.73-linux-amd64# Générer la configuration/velociraptor config generate -i# → Renseigner : hostname, port, certificats auto-générés# Lancer le serveur/velociraptor --config serverconfigyaml frontend -v# Créer un admin/velociraptor --config serverconfigyaml user add admin --role administrator# Accès GUI : https://localhost:8889
yaml
# docker-compose.ymlservices:velociraptor:image: wlambert/velociraptor:latestports:- "8000:8000" # Agents- "8889:8889" # GUIvolumes:- ./server.config.yaml:/etc/velociraptor/server.config.yaml- velociraptor_data:/var/lib/velociraptorcommand: frontend -vvolumes:velociraptor_data:
Déploiement Agent (client)
bash
# Générer le MSI Windows depuis le serveur/velociraptor --config serverconfigyaml config repack--exe velociraptor-windows.exe clientconfigyaml velociraptor-client.exe# Installer sur Windows (admin)velociraptor-client.exe service install# Linux — service systemd/velociraptor --config clientconfigyaml client -v# Déploiement masse via GPO (Windows)# MSI téléchargeable depuis la GUI → Déploiement > Agent Installers
VQL — Velociraptor Query Language
VQL est similaire à SQL mais orienté artefacts systèmes.
Structure
sql
SELECT Column1, Column2FROM plugin(arg1='value', arg2='value')WHERE conditionLIMIT 100
Requêtes utiles
sql
-- Processus en cours d'exécutionSELECT Pid, Name, CommandLine, Username, CreateTimeFROM pslist()ORDER BY CreateTime DESC-- Connexions réseau activesSELECT Pid, FamilyString, TypeString,Laddr.IP, Laddr.Port, Raddr.IP, Raddr.Port, StatusFROM netstat()WHERE Status = "ESTABLISHED"-- Fichiers modifiés récemment (< 24h)SELECT FullPath, Mtime, Atime, SizeFROM glob(globs='C:/Users/**')WHERE Mtime > now() - 86400AND NOT IsDir-- Clés Run (persistance registry)SELECT Key.FullPath, Name, DataFROM read_reg_key(globs="HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run/**")-- Services WindowsSELECT Name, DisplayName, State, PathName, StartModeFROM wmi(query="SELECT * FROM Win32_Service WHERE State='Running'")WHERE PathName =~ "Temp|AppData|ProgramData"-- Connexions DNS récentes (cache)SELECT Name, Data.StringsFROM read_reg_key(globs="HKLM/SYSTEM/CurrentControlSet/Services/Dnscache/Parameters/Cache/**")-- Scheduled Tasks suspectesSELECT Name, Command, Arguments, UserIdFROM scheduled_tasks()WHERE UserId != "SYSTEM" AND UserId != "NT AUTHORITY"-- Prefetch (exécutions récentes Windows)SELECT Name, Mtime, Atime, HashFROM glob(globs="C:/Windows/Prefetch/*.pf")ORDER BY Mtime DESCLIMIT 20
Artefacts — Collections prédéfinies
# Artefacts Windows essentiels (GUI → Hunt Manager)WindowsKapeFilesTargets Collecte complte KAPE logs artefactsWindowsEventLogsEvtx Tous les event logs WindowsWindowsForensicsPrefetch Historique dexcutionWindowsForensicsSRUM Historique rseau/CPU par processWindowsRegistryUserAssist Applications rcemment lancesWindowsPersistencePermanentWMI Persistence WMIWindowsSysAllUsers Comptes locauxWindowsNetworkNetstatEnriched Netstat process associ# Artefacts LinuxLinuxSysUsers /etc/passwd /etc/shadowLinuxSysCrontab Crontabs systme et utilisateursLinuxForensicsLastLogin lastlog wtmp btmpLinuxNetworkNetstat Connexions activesLinuxSysBashHistory Historique bash par utilisateur
Hunts — Chasse sur tout le parc
bash
# Via la GUI :# Hunt Manager → New Hunt → Sélectionner artefact → Launch# Cas d'usage courants :# 1. Chercher un IOC sur tout le parc# Artefact : Windows.Search.FileFinder# Paramètre : SearchFilesGlob = **/*mimikatz*# 2. Vérifier si un processus tourne quelque part# VQL : SELECT * FROM pslist() WHERE Name =~ "cobaltstrike"# 3. Collecter les event logs sur tous les endpoints# Artefact : Windows.EventLogs.Evtx# 4. Chercher des clés de registry suspectes# Artefact : Windows.Registry.NTUser
Collecte de mémoire
bash
# Dump mémoire via Velociraptor# Artefact : Windows.Memory.Acquisition# → Génère un fichier .raw téléchargeable depuis le serveur# Analyse avec Volatility ensuitevolatility3 -f memoryraw windowspslistvolatility3 -f memoryraw windowsnetscanvolatility3 -f memoryraw windowsmalfind
Intégration SOC
Wazuh alerte Shuffle workflowShuffle appelle API VelociraptorVelociraptor collecte artefacts sur lendpointRsultats stocks sur le serveur VelociraptorTransfert vers TheHive attachmentsAnalyste SOC consulte les preuves
python
# API Velociraptor (Python)import requests# Lancer une collecte sur un clienturl = "https://velociraptor:8889/api/v1/StartFlowOnClient"headers = {"Authorization": "Bearer API_KEY"}payload = {"client_id": "C.abcdef1234567890","flow": {"artifacts": ["Windows.KapeFiles.Targets"],"parameters": {"request": {"env": [{"key": "Device", "value": "C:"}]}}}}r = requests.post(url, json=payload, headers=headers, verify=False)flow_id = r.json()["flow_id"]
OPS·BRAIN v1.08 notes · Monitoringlocal