Giter Site home page Giter Site logo

peithon / justc2file Goto Github PK

View Code? Open in Web Editor NEW
257.0 3.0 34.0 11.52 MB

Burp插件,Malleable C2 Profiles生成器;可以通过Burp代理选中请求,生成Cobalt Strike的profile文件(CSprofile)

Java 81.77% FreeMarker 18.23%
c2profile cobaltstrike burpsuite malleable-c2

justc2file's Introduction

JustC2file: Burp插件--C2 profile生成器

描述

可以通过Burp代理选中请求,生成Cobalt Strike的profile文件

使用

在Burp中安装插件之后,同时选中目标站点至少三条GET/POST请求,且必须同时存在GET/POST;将通过这三个请求响应的数据包生成profile文件,然后复制文本到Cobalt Strike服务器上,使用c2lint进行检测,通过之后可使用该文件启动CS,以达到规避流量检测的效果;测试可以执行命令再用于实际环境中。

演示

1、浏览器无痕页面产生流量

在浏览器中开启无痕模式(防止存在个人信息),然后开启代理,在无痕模式下产生流量;chrome在无痕模式下默认不开启扩展程序,如果没有开启的话:点击右上角菜单图标【三个点】,依次选择【更多工具】-【扩展程序】- 详情,开启。

2、Burp中选中相关流量

回到Burp中,将想用的流量右键高亮显示,找到足够多的流量时同时选中,右键生成CS的配置文件

3、修改配置文件

修改https-certificate

可以不使用默认的配置参数值,利用目标站点的证书信息生成证书,可信度会更高一些。

#默认配置,validity为证书有效期
https-certificate {

   set C   "SI";
   set CN  "www.bing.com";
   set O   "bing.com";
   set OU  "bing.com";
   set validity "365";
}

修改code-signer

如果需要文件签名,修改成你的证书名称和证书密码,并去除注释

#code-signer{
#    set keystore "keystore.jks";
#    set password "123456";
#    set alias "google";
#}

4、使用生成的文件在服务器上启动CS

在服务器使用c2lint测试文件,没有错误后启动CS,使用命令

nohup ./teamserver [external IP] [password] [/path/to/my.profile] &

生成可执行文件,然后在目标上执行,如果执行命令存在结果回显,说明配置文件可以正常使用。下面是在Wireshark中捕获的Cobalt Strike流量,示例文本,图片被压缩了比较糊:

启动CS前的注意事项

关于https-certificate

可以不使用默认的配置参数值,利用目标站点的证书信息生成证书,可信度会更高一些。

#默认配置,validity为证书有效期
https-certificate {

   set C   "SI";
   set CN  "www.bing.com";
   set O   "bing.com";
   set OU  "bing.com";
   set validity "365";
}

在浏览器查看目标站点相关的证书信息,然后填充到https-certificate中的对应的配置参数中。

关于code-signer

Attacks -> Packages -> Windows Executable和Windows Executable (S)生成可执行文件或DLL文件时,默认是不进行签名的,如果需要对可执行文件或 DLL 文件进行签名,要在CS服务器上生成jks证书,然后在profile文件中配置code-signer,步骤如下:

C2profile与keystore证书最好在相同目录下

1、利用keytool生成自己的免费证书

注意,记住-alias后面的参数和-keystore后面的参数后面会在C2-profile文件中使用。

keytool -genkey -alias google -keyalg RSA -validity 36500 -keystore keystore.store

2、将store证书转成.p12格式

这里原来的keystore.store证书会重命名为keystore.store.old

keytool -importkeystore -srckeystore keystore.store -destkeystore keystore.store -deststoretype pkcs12

3、将.p12格式证书转为.jks格式证书

keytool -v -importkeystore -srckeystore keystore.store -srcstoretype PKCS12 -destkeystore keystore.jks -deststoretype JKS

4、C2文件中配置

# 修改成你的证书名称和证书密码,并去除注释
#code-signer{
#    set keystore "keystore.jks";
#    set password "123456";
#    set alias "google";
#}

更新日志

  • 2022-01-15 第一个正式版本补充

    • 添加支持cs4.4版本
  • 2022-01-14 更新第一个正式版本

    • 将测试版本的代码重构
      • 采用mvc模式重新构建代码
      • 支持cs4.2
    • 支持http-stager通过流量获取
    • 新增prependappend通过流量自动生成
    • 支持post-ex模块随机生成
    • 新增process-inject定义
  • 2021-12-28 第一个测试版本,支持http-gethttp-post通过选取的流量生成,其他的都是随机产生。

参考文献

CS官方文档

Randomized Malleable C2 Profiles Made Easy

How to Write Malleable C2 Profiles for Cobalt Strike

threatexpress/malleable-c2

justc2file's People

Contributors

peithon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

justc2file's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.