关于Payload-Generator
Payload-Generator是一款功能强大的安全测试脚本,该工具专为红队研究人员设计,可以帮助广大研究人员在Cobalt Strike中使用Payload-Generator实现Payload自动化构建。

工具要求
Visual Studio 2022
.NET Framework v4.8
工具下载
广大研究人员可以直接使用下列命令将该项目源码克隆至本地:
git clone https://github.com/Workingdaturah/Payload-Generator.git
然后打开Visual Studio,导入Payload-Generator源代码,并完成项目构建即可。
工具使用
该工具本质上是一个aggressor脚本,并且只能在“C:\Tools\cobaltstrike\aggressors\PG”这个专门的预定路径中使用,在添加新的aggressor脚本时候,会自动在Cobalt Strike的菜单栏中显示新的按钮:

该脚本将会以自动化的形式完成Payload的创建,在下面的例子中,工具将会编译一个带有CreateThread API的C#二进制代码:

为了完成Payload的自动化构建,工具会将预先确定的值添加到菜单选项中,因此这个API将适用于x86架构源码,并且程序集类型为winexe以避免弹出控制台:

我们还可以通过编辑PG.cna文件来添加更多的模板,将新的脚本存储到“/scripts/”目录中,下图中的注释内容会告诉你如何添加一个新的菜单:

下图中我们可以看到,它需要用到C#项目文件来创建这些源代码,因为它使用了MSBUILD来进行自动化构建:

该样本Payload有可能会被反病毒产品检测到,因此我们建议广大研究人员将脚本路径添加到排除路径,或使用一个虚拟机操作系统来进行测试以避免其他问题。
当然了,广大研究人员也可以根据自己的需求来修改代码以增加更多的自定义功能。
工具使用演示

项目地址
Payload-Generator:【GitHub传送门】
参考资料
GitHub - offsecginger/AggressorScripts: Various Aggressor Scripts I've Created.