1
免责声明
本公众号提供的工具、教程、学习路线、精品文章均为原创或互联网收集,旨在提高网络安全技术水平为目的,只做技术研究,谨遵守国家相关法律法规,请勿用于违法用途,如果您对文章内容有疑问,可以尝试加入交流群讨论或留言私信,如有侵权请联系小编处理。
2
内容速览
普通CS没有做流量混淆会被防火墙拦住流量,所以偶尔会看到CS上线了机器但是进行任何操作都没有反应,这里尝试一下做流量混淆。参考网上的文章,大部分是两种方法,一种更改teamserver 里面与CS流量相关的内容,一种是利用Keytool工具生成新的store证书,我们需要做的修改大概为3个地方:
1)修改默认端口
2)去除store证书特征
3)修改profile
编辑teamserver文件,更改server port部分50000
查看证书,默认密码123456
keytool -list -v -keystore cobaltstrike.store
可以看到未修改的证书还是有很明显的cs特征的,比如 Alias name、Owner、Issuer字段
Keytool是一个Java的证书管理工具,下面用Keytool生成一个store证书
keytool -h
Illegal option: -h
ey and Certificate Management Tool
Commands:
-certreq Generates a certificate request
-changealias Changes an entry's alias
-delete Deletes an entry
-exportcert Exports certificate
-genkeypair Generates a key pair
-genseckey Generates a secret key
-gencert Generates certificate from a certificate request
-importcert Imports a certificate or a certificate chain
-importpass Imports a password
-importkeystore Imports one or all entries from another keystore
-keypasswd Changes the key password of an entry
-list Lists entries in a keystore
-printcert Prints the content of a certificate
-printcertreq Prints the content of a certificate request
-printcrl Prints the content of a CRL file
-storepasswd Changes the store password of a keystore
使用以下命令生成一个新的store证书,-alias 和 -dname 可以自由发挥,也可以用其他的来混淆流量
keytool -keystore cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias Microsec.com -dname "CN=Microsec e-Szigno Root CA, OU=e-Szigno CA, O=Microsec Ltd., L=Budapest, S=HU, C=HU"
参数 含义
-alias 指定别名
-storepass 指定更改密钥库的存储口令
-keypass pass 指定更改条目的密钥口令
-keyalg 指定算法
-dname 指定所有者信息
也可以编辑 teamserver
文件来生成证书
现在很多WAF都能检测出CS的流量特征,而CS的流量由Malleable C2配置来掌控的,所以我们需要定向去配置这个Malleable-C2。
下载Malleable-C2-Profiles文件
CS中集成了一个包含在Linux平台下的C2lint工具,可以检查profile代码是否有问题
chmod 777 c2lint
./c2lint ./Malleable-C2-Profiles/APT/havex.profile
因为0.0.0.0是Cobalt Strike DNS Beacon特征,可以在profile内加一段 set dns_idle "8.8.8.8"; 之后profile内默认的能改则改
http-get部分,包括uri和header都可以根据实战抓包进行修改