吉沃运营专员 发表于 2022-1-18 17:23:38

Atomic Red Team

https://github.com/redcanaryco/atomic-red-team
Atomic Red Team™ 是一个简单的测试库,每个安全团队都可以执行这些测试来测试他们的控制。测试是集中的,几乎没有依赖关系,以结构化的格式定义,最直接的应用场景是 红队使用,红队可以根据框架中的技术通过脚本进行自动化攻击。

Red Canary 公司以红队为名的 Atomic Red Team 项目,是目前 Github 上关注人数最多的 ATT&CK 项目。其使用简单、上手快,首先需要搭建好相关环境,选择相关的测试用例,包括 Windows、Linux 及 MacOS 用例。然后可以根据每个用例的描述及提供的脚本进行测试,可能有些用例需要替换某些变量。

接下来,可以根据部署的产品进行检测,查看是否发现相关入侵技术,如果没有检测到入侵,需要对检测技术进行改进。最后,不断重复这个过程,以不断提高入侵检测能力,从而更好地覆盖 ATT&CK 的整个攻击技术矩阵。

一、准备开始
在执行第一个 atomic 测试前所需要做的一切。

1.1 准备环境
在开始测试前,需要准备下列东西:


[*]测试许可:在执行 atomic 测试之前,请务必征得环境所有者的许可;
[*]一台测试机:设置一台模仿环境构建的机器,确保安全解决方案处于活动状态;

1.2 选择一项测试用例
我们将所有 atomic 测试文件存储在 Atomic Red Team™ 存储库的 atomics 目录中,为了使事情井井有条,我们将测试划分到以它们所代表的 MITRE ATT&CK® 技术命名的目录中,例如,进程注入测试保存在 atomic-red-team/atomics/T1055/ 中。

每个技术目录包含以下内容:


[*]YAML 测试文件;
[*]Markdown 测试文件;
[*]源文件依赖项的可选 src 目录;
[*]二进制依赖项的可选 bin 目录;

浏览 atomics 目录以进行适当的测试,还可以从以下列表之一中选择一个测试:


[*]All atomic tests
[*]Tests for Linux
[*]Tests for macOS
[*]Tests for Windows

1.3 运行测试用例
打开 Markdown 测试定义文件并导航到您选择的测试。

1.3.1 安装依赖
一些测试有一个 "依赖项" 子标题,这些测试需要额外的文件才能运行。要安装依赖项,请执行 "获取 Prereq 命令" 子标题中的命令。

1.3.2 运行测试用例
要运行测试,请执行 "攻击命令" 子标题中的命令,请注意您的安全解决方案收集了哪些信息 (如果有)。

1.3.3 清理环境
一些测试会改变环境,要恢复这些更改,请运行 "清理命令" 子标题中的命令。

提示:请务必将任何 #{<input>} 参数替换为 Markdown 测试文件的 "输入" 标题指定的输入。

1.4 下一步操作

[*]使用安全解决方案收集的数据来评估和提高检测覆盖率。
[*]使用 Invoke-Atomic 等执行框架自动运行 atomic 测试。

二、APIs
有关 Atomic Red Team Ruby API 的信息

2.1 安装 Atomic Red Team Ruby API
Atomic Red Team 包含一个 Ruby API,使用它来验证测试和生成文档,要安装 Atomic Red Team API,请将以下内容添加到您的 Gemfile:
gem 'atomic-red-team', git: 'git@github.com:redcanaryco/atomic-red-team.git', branch: :master
2.2 导入 ATT&CK API
Atomic Red Team 使用 ATT&CK 的 STIX™ 表示提取有关 MITRE ATT&CK® 数据集的信息。我们围绕该数据结构创建了一个轻量级包装器,以使其易于使用。

要使用 ATT&CK API,请在命令行中运行以下命令:
$ bundle exec irb
2.2.0 :001 > require 'attack_api'
2.3 查看 APIs
可以通过访问 Atomic Red Team 存储库中的 atomic_red_team 目录来查看 API 代码和文档,例如使用 Atomic Red Team API 的实用程序,请参见 bin 目录。

2.4 例子
以下演示了 Atomic Red Team API 的一些实用程序

2.4.1 通过技术编号输出与之有关的所有 atomic 测试
require 'atomic_red_team'

AtomicRedTeam.new.atomic_tests.each do |atomic_yaml|
puts "#{atomic_yaml['attack_technique']}"
atomic_yaml['atomic_tests'].each do |atomic_test_yaml|
    puts "#{atomic_test_yaml['name']}"
end
end
2.4.2 输出与某一项技术相关的所有 atomic 测试
require 'atomic_red_team'

AtomicRedTeam.new.atomic_tests_for_technique('T1117').each do |atomic_test_yaml|
puts "#{atomic_test_yaml['name']}"
end
2.4.3 输出 ATT&CK 技术数量
导入 ATT&CK API,然后:
2.2.0 :020 > Attack.new.techniques.count
=> 219
2.4.4 获取关于某一项技术的信息
导入 ATT&CK API,然后:
2.2.0 :006 >   Attack.new.technique_info('T1117')
=> {"name"=>"Regsvr32", "description"=>"Regsvr32.exe is a command-line program used to register and unregister
object linking and embedding controls, including dynamic link libraries (DLLs), on Windows systems. Regsvr32.exe can
be used to execute arbitrary binaries. (Citation: Microsoft Regsvr32)\n\nAdversaries may take advantage of this
functionality to proxy" <SNIP> }

2.2.0 :007 > Attack.new.technique_info('T1117').keys
=> ["name", "description", "kill_chain_phases", "external_references", "object_marking_refs", "created",
"created_by_ref", "x_mitre_platforms", "x_mitre_data_sources", "x_mitre_defense_bypassed",
"x_mitre_permissions_required", "x_mitre_remote_support", "x_mitre_contributors", "id", "modified", "type"]
2.4.5 获取 ATT&CK 战术及其相关技术的地图
导入 ATT&CK API,然后:
2.2.0 :019 > Attack.new.techniques_by_tactic.each {|tactic, techniques| puts "#{tactic} has #{techniques.count} techniques"}
persistence has 56 techniques
defense-evasion has 59 techniques
privilege-escalation has 28 techniques
discovery has 19 techniques
credential-access has 20 techniques
execution has 31 techniques
lateral-movement has 17 techniques
collection has 13 techniques
exfiltration has 9 techniques
command-and-control has 21 techniques
initial-access has 10 techniques
2.4.6 获取 ATT&CK 矩阵 2D 数组
导入 ATT&CK API,然后:
2.2.0 :062 > Attack.new.ordered_tactics
=> ["initial-access", "execution", "persistence", "privilege-escalation", "defense-evasion", "credential-access",
"discovery", "lateral-movement", "collection", "exfiltration", "command-and-control"]

2.2.0 :071 > Attack.new.ordered_tactic_to_technique_matrix.each {|row| puts row.collect {|technique| technique['name'] if technique}.join(', ')};
Drive-by Compromise, AppleScript, .bash_profile and .bashrc, Access Token Manipulation, Access Token Manipulation, Account Manipulation, Account Discovery, AppleScript, Audio Capture, Automated Exfiltration, Commonly Used Port
Exploit Public-Facing Application, CMSTP, Accessibility Features, Accessibility Features, BITS Jobs, Bash History, Application Window Discovery, Application Deployment Software, Automated Collection, Data Compressed, Communication Through Removable Media
Hardware Additions, Command-Line Interface, AppCert DLLs, AppCert DLLs, Binary Padding, Brute Force, Browser Bookmark Discovery, Distributed Component Object Model, Clipboard Data, Data Encrypted, Connection Proxy
<SNIP>
, , Winlogon Helper DLL, , Timestomp, , , , , ,
, , , , Trusted Developer Utilities, , , , , ,
, , , , Valid Accounts, , , , , ,
, , , , Web Service, , , , , ,

liuming 发表于 2022-1-19 18:29:00

{:5_150:} 好内容值得分享!
页: [1]
查看完整版本: Atomic Red Team