Windows.OSQuery.Generic
Type: Client
Deploys the osquery binary and runs a user-specified SQL query, returning parsed JSON results.
OSQuery is an excellent tool for querying system state across the three main supported Velociraptor platforms: Windows/Linux/MacOS.
You can read more about OSQuery on https://osquery.io/
Required permissions: EXECVE
Precondition: SELECT OS From info() where OS = 'windows'
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Query |
string | SELECT * FROM osquery_info |
Tools
This artifact uses these external tools, managed by the server’s tool inventory (see Managing external tools):
OSQueryWindows
References
Source
Defined in artifacts/definitions/Windows/OSQuery/Generic.yaml.
name: Windows.OSQuery.Generic
description: |
Deploys the osquery binary and runs a user-specified SQL query,
returning parsed JSON results.
OSQuery is an excellent tool for querying system state across the
three main supported Velociraptor platforms: Windows/Linux/MacOS.
You can read more about OSQuery on https://osquery.io/
reference:
- https://osquery.io/
- https://github.com/osquery/osquery
# I am not actually sure if OSQuery allows arbitrary command execution via SQL?
required_permissions:
- EXECVE
precondition: SELECT OS From info() where OS = 'windows'
tools:
- name: OSQueryWindows
github_project: Velocidex/OSQuery-Releases
github_asset_regex: windows-amd64.exe
parameters:
- name: Query
default: "SELECT * FROM osquery_info"
sources:
- query: |
LET binary <= SELECT OSPath
FROM Artifact.Generic.Utils.FetchBinary(ToolName="OSQueryWindows")
LET result = SELECT * FROM execve(
argv=[binary[0].OSPath, "--json", Query],
length=1000000)
SELECT * FROM foreach(row=result,
query={
SELECT * FROM parse_json_array(data=Stdout)
})