RAT蓝队自动化测试框架

发布时间 2023-07-06 18:03:43作者: 迷茫の陈Sir

RAT 是根据 MITRE ATT&CK 战术矩阵测试蓝队检测能力的脚本框架,由 python2.7 编写,共有 50 多种不同 ATT&CK 技术点和编译好的 exe 程序,根据蓝队人员需要选择进程注入、持久化等操作。

仓库地址

https://github.com/endgameinc/RTA/tree/master

环境要求

Python2.7

部分脚本依赖如下:

依赖组件 RTA 脚本 来源
Sysinternals Suite user_dir_escalation.py, sip_provider.py, system_restore_proc.py,trust_provider.py Microsoft
MsXsl msxsl_network.py

要注意的是 Windows Defender 或其他反病毒产品可能会在 RTA 运行时阻止或以其他方式干扰 RTA。

工具使用

单例运行

C:\RTA\red_ttp>python certutil_file_obfuscation.py
[+] Encoding target
win10-x64 > c:\Windows\System32\certutil.exe -encode c:\windows\system32\cmd.exe "C:\RTA\red_ttp\encoded.txt"
输入长度 = 289792
输出长度 = 398524
CertUtil: -encode 命令成功完成。

[+] Decoding target
win10-x64 > c:\Windows\System32\certutil.exe -decode "C:\RTA\red_ttp\encoded.txt" "C:\Users\win2021ltsc\Desktop\RTA\red_ttp\decoded.exe"
输入长度 = 398524
输出长度 = 289792
CertUtil: -decode 命令成功完成。

[+] Cleaning up
[-] Removing C:\RTA\red_ttp\encoded.txt
[-] Removing C:\RTA\red_ttp\decoded.exe

全部运行

python run_rta.py

Windows 运行

for %f in (*.py) do python %f

日志查看

如果 Windows 装了 sysmon 等日志查看工具,可以在事件查看器中看到捕获的日志记录,以上述 certutil_file_obfuscation 为例,该脚本使用 certutil 将 cmd 编码为 txt 文件,并后续进行了解码,在时间查看器的 应用程序和服务日志-Microsoft-Windows-Sysmon-Operation 中可以看到以下日志
image