Skip to main content

与 Mitre Att&ck Enterprise 框架交互的轻量级 Python 模块。

项目描述

下载 PyPI 版本 执照:麻省理工学院 图片 图片

enterpriseattack - MITRE 的 Enterprise Att&ck

与MITRE ATT&CK Enterprise 数据集交互的轻量级 Python 模块。由于它的速度和最小的依赖而构建用于生产应用程序。阅读文档以获取更多信息。

MITRE 攻击​​(&ck)

MITRE ATT&CK® 是一个全球可访问的基于真实世界观察的对手战术和技术知识库。ATT&CK 知识库被用作在私营部门、政府以及网络安全产品和服务社区中开发特定威胁模型和方法的基础。

依赖项

  • Python 3.x
  • ujson >= 3.0.0
  • 请求 >= 2.9.2

安装

通过 Pip 安装:

pip install enterpriseattack

或者克隆存储库:

git clone https://github.com/xakepnz/enterpriseattack.git
cd enterpriseattack
python3 setup.py install

回到顶部

码头工人:

构建 docker 镜像:

docker build enterpriseattack:0.1.4 .
docker tag enterpriseattack:0.1.4 enterpriseattack:latest

在容器上运行基准测试:

docker run enterpriseattack

回到顶部

用法

初始化一个攻击对象:

import enterpriseattack

attack = enterpriseattack.Attack()

示例:传递自定义参数:

在此示例中,您可以选择从何处下载官方 Mitre Att&ck json,包括要通过的代理。或者,如果您想将 json 文件保存在单独的位置,您可以更改 enterprise_json 参数。默认情况下,它保存在您的默认站点包位置。

  • update - 布尔值强制刷新下载(每次调用),覆盖之前的文件。
  • include_deprecated - 布尔值,包括 Miter Att&ck 已弃用的对象(来自以前的 Att&ck 版本)。
attack = enterpriseattack.Attack(
   enterprise_json=None,
   url='https://raw.githubusercontent.com/mitre/cti/master/enterprise-attack/enterprise-attack.json',
   include_deprecated=False,
   update=False,
   proxies={'http':'http://127.0.0.1:1337'}
)

示例:迭代策略/技术/sub_techniques:

for tactic in attack.tactics:
   print(tactic.name)
   for technique in tactic.techniques:
      print(technique.name)
      print(technique.detection)

for software in attack.software:
    for technique in software.techniques:
        for sub_technique in technique.sub_techniques:
            print(software.name, technique.name, sub_technique.name)

示例:创建任何 tactic/technique/sub_technique/group/software/datasource 的 json 对象:

for tactic in attack.tactics:
   print(tactic.to_json())

for group in attack.groups:
   print(group.to_json())

...

有关更多示例,请参阅文档

回到顶部

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

enterpriseattack-0.1.5.tar.gz (9.7 kB 查看哈希

已上传 source

内置发行版

enterpriseattack-0.1.5-py3.9.egg (35.3 kB 查看哈希

已上传 0 1 5

enterpriseattack-0.1.5-py2-none-any.whl (17.5 kB 查看哈希

已上传 py2