gloxec / CrossC2

generate CobaltStrike's cross-platform payload
2.19k stars 337 forks source link

cs4.8 c2profile解析问题 #207

Open Tycx2ry opened 8 months ago

Tycx2ry commented 8 months ago

使用的cs4.8,在windows下>genCrossC2.Win.exe 1.1.1.1 443 .cobaltstrike.beacon_keys ;;js.profile Linux x64 a.out upx 4.8 profile使用的是https://github.com/threatexpress/malleable-c2/blob/master/jquery-c2.4.8.profile

{cs = 4.1 ~ 4.8} parse c2profile: js.profile panic: runtime error: slice bounds out of range [:6] with length 2

goroutine 17 [running, locked to thread]: main.get_match_string(0xc000201600?, {0xc00027b3ac, 0x2}, {0xc000404180, 0x176}, 0x0) /mnt/fs/libc2profile-musl/libc2profile.go:177 +0xcd main.fmt_profile_dedata({0x6?, 0x226ff69?}, {0xc000198c80, 0xc00027a5a0?, 0x7?}) /mnt/fs/libc2profile-musl/libc2profile.go:223 +0x4c5 main.fmt_profile_get_server(0xc0003fa4f8?) /mnt/fs/libc2profile-musl/libc2profile.go:322 +0x39 main.parsefile(0xc000072000?, 0x0?, 0x1?) /mnt/fs/libc2profile-musl/libc2profile.go:131 +0x226 Aborted (core dumped)

Tycx2ry commented 8 months ago

我模糊测试出来的具体地方:http-get中server中output中append的值为;}是就会报错: append ";}"; 超过6个字符就好了

gloxec commented 8 months ago

嗯嗯,因为前后追加字符过少的话,在解析数据时可能会产生元数据误定位bug

所以推荐c2profile中的可定位数据在6位以上,后续将会主动报错提示该类问题

480840342 commented 6 months ago

想问以下你们cs4.8 使用最新的cs2怎么上线linux的,我这边创建不了beacon

gloxec commented 6 months ago

@480840342 可以描述具体的使用方式及对应的 输出/报错 吗?