Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
sigma-cli — 基于 pySigma 的 Sigma 命令行界面 | Kitploit
工具/GitHubGitHub/sigmahq/sigma-cli
防御工具实用工具与框架威胁情报入侵检测日志分析
GitHubsigmahq/sigma-cli

sigma-cli

基于 pySigma 的 Sigma 命令行界面

查看仓库
2035132个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Sigma 命令行界面

Tests Coverage Badge Status

这是使用 pySigma 库来管理、列出并将 Sigma 规则转换为查询语言的 Sigma 命令行界面。

入门

安装

安装 Sigma CLI 最简单的方式是通过 pipx 或 pip。为此,请运行以下任一命令:

root@kitploit:~
python -m pipx install sigma-cli
python -m pip install sigma-cli

在 macOS 上使用

root@kitploit:~
python3 -m pip install sigma-cli
root@kitploit:~
brew install sigma-cli

另一种方式是在由 Poetry 管理的虚拟环境中从源代码运行:

root@kitploit:~
git clone https://github.com/SigmaHQ/sigma-cli.git
cd sigma-cli
poetry install
poetry shell

用法

该 CLI 以 sigma 命令形式提供。典型的调用方式如下:

root@kitploit:~
sigma convert -t <backend> -p <processing pipeline 1> -p <processing pipeline 2> [...] <directory or file>

例如,要将目录中的进程创建 Sigma 规则转换为适用于 Sysmon 日志的 Splunk 查询,请运行:

root@kitploit:~
sigma convert -t splunk -p sysmon sigma/rules/windows/process_creation

在进行转换之前,必须使用以下命令安装所需的后端。

要列出所有可用插件,请运行以下命令:

root@kitploit:~
sigma plugin list

使用以下命令安装你选择的插件:

root@kitploit:~
sigma plugin install <backend>

例如,要安装 splunk 后端,请运行:

root@kitploit:~
sigma plugin install splunk

可用的转换后端和处理管道可以通过 sigma list 列出。使用 -O 或 --backend-option 以 key=value 对的形式向后端传递选项(-O testparam=123)。此后端选项参数可以多次使用(-O first=123 -O second=456)。

后端可以支持不同的输出格式,例如纯查询和可导入目标系统的文件。这些格式可以通过 sigma list formats <backend> 列出,并使用 -f 选项指定进行转换。

此外,可以使用 -o 指定输出文件。

输出格式和文件的示例:

root@kitploit:~
sigma convert -t splunk -f savedsearches -p sysmon -o savedsearches.conf sigma/rules/windows/process_creation

输出包含转换后搜索的 Splunk savedsearches.conf 文件。

单独文件输出

对于需要将多个规则转换为单独文件的场景(例如,为了版本控制或选择性部署),请使用 --output-dir 参数以及 --output-filename-template:

root@kitploit:~
sigma convert -t esql -p ecs_windows --output-dir translated_rules/ rules/

这将在 translated_rules/ 目录中为每个转换后的规则创建一个单独的文件。

模板变量:

--output-filename-template 参数接受以下变量:

  • {path}:源目录的相对路径(例如,rules/windows/rule.yml 的 windows)
  • {stem}:不带扩展名的文件名(例如,rule.yml 的 rule)
  • {index}:生成多个查询的规则的查询索引(如果只有一个查询,则为空)

示例:

扁平化输出结构(所有文件在一个目录中):

root@kitploit:~
sigma convert -t esql -p ecs_windows --output-dir translated/ --output-filename-template "{stem}.esql" rules/

保留目录结构:

root@kitploit:~
sigma convert -t esql -p ecs_windows --output-dir translated/ --output-filename-template "{path}/{stem}.esql" rules/

处理具有多个查询的规则:

root@kitploit:~
sigma convert -t esql -p ecs_windows --output-dir translated/ --output-filename-template "{stem}-{index}.esql" rules/

给定输入结构:

root@kitploit:~
rules/
├── windows/
│   └── rule_1.yml
├── linux/
│   └── rule_2.yml

使用 --output-filename-template "{path}/{stem}.esql" 时,输出将是:

root@kitploit:~
translated/
├── windows/
│   └── rule_1.esql
├── linux/
│   └── rule_2.esql

后端和管道的集成

可以通过添加相应的包作为依赖来集成后端和管道:

root@kitploit:~
poetry add <package name>

必须通过在 sigma/cli/backends.py 的 backends 字典中创建 Backend 命名元组来添加后端,该元组包含以下参数:

  • 后端类。
  • 在目标列表(sigma list targets)中向用户显示的名称。
  • 一个字典,将输出格式名称(用于 -f 参数)映射到格式列表(sigma list formats <backend>)中显示的格式描述。这些格式必须受后端支持!

字典键是在 -t 参数中使用的名称。

处理管道在 sigma/cli/pipelines.py 的 pipelines 变量字典中定义。该变量包含一个 ProcessingPipelineResolver,它使用一个字典进行实例化,该字典将可用于 -p 参数的标识符映射到返回 ProcessingPipeline 对象的函数。管道列表(sigma list pipelines)中显示的描述性文本来自 ProcessingPipeline 对象的 name 属性。

维护者

该项目目前由以下人员维护:

  • Thomas Patzke [email protected]
下载工具