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

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

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

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

工具目录

分类

查看所有分类
Loading categories
atomic-operator — 一个用于跨多个操作系统环境执行Atomic Red Team测试(Atomics)的Python包。 | Kitploit
工具/GitHubGitHub/swimlane/atomic-operator
防御工具脚本与自动化渗透测试云安全学习与教育红队Archived
GitHubswimlane/atomic-operator

atomic-operator

一个用于跨多个操作系统环境执行Atomic Red Team测试(Atomics)的Python包。

查看仓库
1563152年前Kitploit 审核通过

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

PyPI Status Python Version [License][license]

Read the documentation at https://atomic-operator.com/ Code Quality & Tests

Black

atomic-operator

此 Python 包用于在多种操作系统环境中执行 Atomic Red Team 测试(Atomics)。

(新增内容?)

为什么?

atomic-operator 使安全专业人员能够针对 atomic-red-team 中定义的既定技术测试其检测和防御能力。通过使用 atomic-operator 这样的测试框架,您可以识别自己的防御能力以及防御覆盖范围的缺口。

此外,atomic-operator 还可用于许多其他场景,例如:

  • 生成警报以测试产品
  • 测试 EDR 和其他安全工具
  • 从对手角度识别执行防御规避的方法
  • 等等。

特性

  • 支持在 Windows、macOS 和 Linux 系统上本地和远程执行 Atomic Red Team 测试
  • 支持针对 iaas:aws 运行原子测试
  • 可以提示输入参数,但并非必需
  • 辅助下载 atomic-red-team 仓库
  • 可基于配置文件进一步自动化
  • 提供命令行和可导入的 Python 包
  • 当指定一个或多个技术时,可选择特定测试
  • 在所有原子测试中搜索最合适的测试
  • 通过命令行将 input_arguments 作为输入传递给测试
  • 等等

快速开始

atomic-operator 是一个仅支持 Python 的包,托管在 PyPi 上,适用于 Python 3.6 及以上版本。

如果您需要 PowerShell 版本,请查看 Invoke-AtomicRedTeam。

root@kitploit:~
pip install atomic-operator

以下步骤将指导您设置并运行 atomic-operator。

  • 获取 Atomics 安装/克隆 Atomic Red Team 仓库
  • atomic-operator 了解 atomic-operator 中的可用选项
  • 在命令行上运行测试 或 在脚本中运行测试
  • 通过配置文件运行测试

安装

您可以在 OS X、Linux 或 Windows 上安装 atomic-operator。您也可以直接从源代码安装。请根据下方相应操作系统的标题查看安装命令。

先决条件

以下库是必需的,并将由 atomic-operator 安装:

root@kitploit:~
pyyaml==5.4.1
fire==0.4.0
requests==2.26.0
attrs==21.2.0
pick==1.2.0

macOS、Linux 和 Windows:

root@kitploit:~
pip install atomic-operator

使用 M1 处理器的 macOS

root@kitploit:~
git clone https://github.com/swimlane/atomic-operator.git
cd atomic-operator

# 解决 ModuleNotFoundError: No module named 'setuptools_rust'
brew install rust
pip3 install --upgrade pip
pip3 install setuptools_rust

# 回到常规编程任务...
pip install -r requirements.txt
python setup.py install

从源代码安装

root@kitploit:~
git clone https://github.com/swimlane/atomic-operator.git
cd atomic-operator
pip install -r requirements.txt
python setup.py install

使用示例(命令行)

您可以在命令行或自己的 Python 脚本中运行 atomic-operator。要在命令行使用 atomic-operator,只需在终端中输入以下命令:

root@kitploit:~
atomic-operator --help
atomic-operator run -- --help

请注意,要查看 run 命令的详细信息,请运行 atomic-operator run -- --help 而非 atomic-operator run --help

检索原子测试

要使用 atomic-operator,您必须在本地系统上拥有一个或多个 atomic-red-team 测试(Atomics)。atomic-operator 允许您下载 Atomic Red Team 仓库。您可以通过在命令行中运行以下命令来下载:

root@kitploit:~
atomic-operator get_atomics 
# 您可以使用 --destination 标志指定目标目录
atomic-operator get_atomics --destination "/tmp/some_directory"

本地运行测试

要运行测试,您必须提供一些附加属性(以及可选的选项)。运行测试的主要方法名为 run。

root@kitploit:~
# 这将运行与您本地操作系统兼容的所有测试
atomic-operator run --atomics-path "/tmp/some_directory/redcanaryco-atomic-red-team-3700624"

当您提供一个或多个特定技术时,您可以选择单个测试。例如,在命令行上运行以下命令:

root@kitploit:~
atomic-operator run --techniques T1564.001 --select_tests

将向用户显示与该技术相关的测试选择列表。用户可以通过按空格键高亮所需测试来选择一项或多项测试:

root@kitploit:~
 为技术 T1564.001(隐藏工件:隐藏的文件和目录)选择测试

 * 在隐藏目录中创建隐藏文件 (61a782e5-9a19-40b5-8ba4-69a4b9f3d7be)
   Mac 隐藏文件 (cddb9098-3b47-4e01-9d3b-6f5f323288a9)
   使用 Attrib 创建 Windows 系统文件 (f70974c8-c094-4574-b542-2c545af95a32)
   使用 Attrib 创建 Windows 隐藏文件 (dadb792e-4358-4d8d-9207-b771faa0daa5)
   隐藏文件 (3b7015f2-3144-4205-b799-b05580621379)
   隐藏目录 (b115ecaf-3b24-4ed2-aefe-2fcb9db913d3)
   显示所有隐藏文件 (9a1ec7da-b892-449f-ad68-67066d04380c)

以下命令允许您为测试提供自定义输入参数。您可以通过将键值对字典作为 input_arguments 参数传递给 run 方法来实现这一点。

root@kitploit:~
atomic-operator run --techniques T1564.001 --input_arguments '{"project-id": "some_value", "another_key": "another value"}'
# 请在 input_arguments 值周围加上单引号。

远程运行测试

要远程运行测试,您必须提供一些附加属性(以及可选的选项)。运行测试的主要方法名为 run。

root@kitploit:~
# 这将运行与您本地操作系统兼容的所有测试
atomic-operator run --atomics-path "/tmp/some_directory/redcanaryco-atomic-red-team-3700624" --hosts "10.32.1.0" --username "my_username" --password "my_password"

当远程对 Windows 主机运行命令时,您可能需要配置 PSRemoting。详见此处:Windows 远程管理

附加参数

您可以通过运行以下命令查看附加参数:

root@kitploit:~
atomic-operator run -- --help

您应该会看到类似以下的输出:

root@kitploit:~
NAME
    atomic-operator run - 运行 Atomic Red Team 测试的主要方法。

SYNOPSIS
    atomic-operator run <flags>

DESCRIPTION
    运行 Atomic Red Team 测试的主要方法。

FLAGS
    --techniques=TECHNIQUES
        Type: list
        Default: ['all']
        一个或多个由 attack_technique ID 定义的技术。默认为 'all'。
    --test_guids=TEST_GUIDS
        Type: list
        Default: []
        一个或多个原子测试 GUID。默认为 None。
    --select_tests=SELECT_TESTS
        Type: bool
        Default: False
        从提供的技术中选择一个或多个测试。默认为 False。
    --atomics_path=ATOMICS_PATH
        Default: '/U...
        原子测试的路径。默认为 os.getcwd()。
    --input_arguments={}
        Default: {}
        要传递给测试的输入参数字典。
    --check_prereqs=CHECK_PREREQS
        Default: False
        是否检查前置依赖(prereq_comand)。默认为 False。
    --get_prereqs=GET_PREREQS
        Default: False
        是否要检索前置条件。默认为 False。
    --cleanup=CLEANUP
        Default: False
        是否要运行清理命令。默认为 False。
    --copy_source_files=COPY_SOURCE_FILES
        Default: True
        是否将相关源文件(src、bin 等)复制到远程主机。默认为 True。
    --command_timeout=COMMAND_TIMEOUT
        Default: 20
        每个命令的超时时间。默认为 20。
    --debug=DEBUG
        Default: False
        是否输出正在运行的测试的详细信息。默认为 False。
    --prompt_for_input_args=PROMPT_FOR_INPUT_ARGS
        Default: False
        是否提示为每个测试输入参数。默认为 False。
    --return_atomics=RETURN_ATOMICS
        Default: False
        是否返回原子测试而非运行它们。默认为 False。
    --config_file=CONFIG_FILE
        Type: Optional[]
        Default: None
        用于在环境中自动化 atomic-operator 的配置文件路径。默认为 None。
    --config_file_only=CONFIG_FILE_ONLY
        Default: False
        是否仅基于提供的 config_file 运行测试。默认为 False。
    --hosts=HOSTS
        Default: []
        一个或多个运行测试的远程主机列表。默认为 []。
    --username=USERNAME
        Type: Optional[]
        Default: None
        用于远程连接身份验证的用户名。默认为 None。
    --password=PASSWORD
        Type: Optional[]
        Default: None
        用于远程连接身份验证的密码。默认为 None。
    --ssh_key_path=SSH_KEY_PATH
        Type: Optional[]
        Default: None
        用于远程连接身份验证的 SSH 密钥路径。默认为 None。
    --private_key_string=PRIVATE_KEY_STRING
        Type: Optional[]
        Default: None
        用于远程连接身份验证的私有 SSH 密钥字符串。默认为 None。
    --verify_ssl=VERIFY_SSL
        Default: False
        是否通过 RDP(Windows)连接时验证 SSL。默认为 False。
    --ssh_port=SSH_PORT
        Default: 22
        用于远程连接身份验证的 SSH 端口。默认为 22。
    --ssh_timeout=SSH_TIMEOUT
        Default: 5
        用于远程连接身份验证的 SSH 超时(秒)。默认为 5。
    接受其他标志。
        如果提供,则与测试输入匹配的键将被替换。默认为 None。

使用 config_file 运行 atomic-operator

除了通过 atomic-operator 传递参数外,您还可以传入一个 config_file 的路径,该文件包含所有原子测试及其可能的输入。您可以在此处查看此 config_file 的示例:

root@kitploit:~
atomic_tests:
  - guid: f7e6ec05-c19e-4a80-a7e7-241027992fdb
    input_arguments:
      output_file:
        value: custom_output.txt
      input_file:
        value: custom_input.txt
  - guid: 3ff64f0b-3af2-3866-339d-38d9791407c3
    input_arguments:
        second_arg:
          value: SWAPPPED argument
  - guid: 32f90516-4bc9-43bd-b18d-2cbe0b7ca9b2

使用示例(脚本)

要使用 atomic-operator,您必须实例化一个 AtomicOperator 对象。

root@kitploit:~
from atomic_operator import AtomicOperator

operator = AtomicOperator()

# 这将下载 atomic-red-team 仓库的本地副本

print(operator.get_atomics('/tmp/some_directory'))

# 这将在本地系统上运行测试
operator.run(
    technique: str='All', 
    atomics_path=os.getcwd(), 
    check_dependencies=False, 
    get_prereqs=False, 
    cleanup=False, 
    command_timeout=20, 
    debug=False,
    prompt_for_input_args=False,
    **kwargs
)

获取帮助

如果您有问题或遇到任何问题,请创建一个 issue。

构建工具

  • carcass - Python 打包模板

贡献

请阅读 CONTRIBUTING.md 了解我们的行为准则以及提交 pull request 的流程。

版本控制

我们使用 SemVer 进行版本控制。

作者

  • Josh Rickard - 初始工作 - MSAdministrator

另请参阅参与此项目的 贡献者 列表。

许可证

本项目采用 MIT 许可证 - 详情请参见 LICENSE 文件

鸣谢

  • 感谢 keithmccammon 帮助识别基于 macOS M1 处理器的问题并提供了修复方案
下载工具
参数名称类型默认值描述
techniqueslistall一个或多个由 attack_technique ID 定义的技术。
test_guidslistNone一个或多个原子测试 GUID。
select_testsboolFalse当指定了技术时,选择一个或多个要运行的原子测试。
atomics_pathstros.getcwd()原子测试的路径。
input_argumentsdict{}要传递给测试的输入参数字典。
check_prereqsboolFalse是否检查前置依赖(prereq_comand)。
get_prereqsboolFalse是否要检索前置条件。
cleanupboolFalse是否要运行清理命令。
copy_source_filesboolTrue是否要将相关源文件(src、bin 等)复制到远程主机。
command_timeoutint20每个命令的超时时间(秒)。
debugboolFalse是否输出正在运行的测试的详细信息。
prompt_for_input_argsboolFalse是否提示为每个测试输入参数。
return_atomicsboolFalse是否返回原子测试而非运行它们。
config_filestrNone用于在环境中自动化 atomic-operator 的配置文件路径。
config_file_onlyboolFalse是否仅基于提供的 config_file 运行测试。
hostslistNone一个或多个运行测试的远程主机列表。
usernamestrNone用于远程连接身份验证的用户名。
passwordstrNone用于远程连接身份验证的密码。
ssh_key_pathstrNone用于远程连接身份验证的 SSH 密钥路径。
private_key_stringstrNone用于远程连接身份验证的私有 SSH 密钥字符串。
verify_sslboolFalse是否在通过 RDP(Windows)连接时验证 SSL。
ssh_portint22用于远程连接身份验证的 SSH 端口。
ssh_timeoutint5用于远程连接身份验证的 SSH 超时(秒)。
**kwargsdictNone如果向 run 命令传递了其他标志,我们将尝试将其与原子测试中定义的输入匹配,并用提供的值替换。