AGGRESSOR SCRIPT官方文档翻译-3. Data Model

Cobalt Strike的团队服务器存储您的主机、服务、凭证和其他信息。 它还广播该信息,并使其对所有客户端可用。

数据 API

使用 &data_query功能查询Cobalt Strike的数据模型。该功能可以访问Cobalt Strike客户端维护的所有状态和信息。使用&data_keys 来获得你可能查询的不同数据片段的列表。此示例查询Cobalt Strike数据模型中的所有数据,并将其导出到一个文本文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
command export {
# 注册命令
local('$handle $model $row $entry $index');
# 声明局部变量
$handle = openf(">export.txt");
# 打开一个文件句柄
foreach $model (data_keys()) {
# 遍历数据模型
println($handle, "== $model ==");
println($handle, data_query($model));
}

closef($handle);
# 关闭文件句柄
println("See export.txt for the data.");
}

控制台执行:

image-20210710090308507

导出的数据:

image-20210710090246700

Cobalt Strike提供了几个函数,可以更直观地使用数据模型。

模型 函数 描述
applications &applications 系统配置信息 [View -> Applications]
archives &archives 连接事件/活动
beacons &beacons 活动的 beacons
credentials &credentials 用户名、口令等.
downloads &downloads 下载的文件
keystrokes &keystrokes 键盘记录
screenshots &screenshots 截屏
services &services 服务和服务信息
sites &sites 资产信息
socks &pivots SOCKS代理服务器和端口转发
targets &targets 主机和主机信息

这些函数在数据模型中为每个条目返回一个一行的数组。 每个条目是一个具有描述条目的不同键/值对的字典。

理解数据模型的最佳方法是通过Aggressor Script 控制台来研究它。进入View -> Script Console并使用x命令计算表达式。例如:

Querying Data from the Aggressor Script console

从Aggressor Script 控制台查询数据

使用 on DATA_KEY 订阅对特定数据模型的更改。

1
2
3
on keystrokes {
println("I have new keystrokes: $1");
}
⬆︎TOP