当前位置:网站首页>CS通过(CDN+证书)powershell上线详细版
CS通过(CDN+证书)powershell上线详细版
2022-07-06 06:24:00 【zxl2605】
0x00 简介
这个应该叫做域前置技术:
大致图示:
- 攻击流量通过CDN节点将流量转发到真实的C2服务器
- CDN节点ip通过识别请求的Host头进行流量转
- 可以有效的躲避一些安全设备,也有这一定的反溯源功能,因为流量都去了CDN上
之前看了一些文章,但是大佬有些地方觉得简单肯能就没写,自己搭建的时候就写了一些,算是我的一个笔记吧,感觉较为详细了,比较适合新手。
0x01 需要资源
- cobaltstrike 4.0
- VPS(cs服务器)
- 域名
- CDN
- 国外代理
0x02 域名免费申请
申请地址:https://www.freenom.com/
重点是免费且不用备案的
自行选择申请免费的域名
注意:
要挂代理,然后把个人信息的地址设置成代理的地址,要不可能申请不成功
0x03 免费CDN准备
申请地址:https://dash.cloudflare.com/
自行注册并登录设置CDN
0x04 域名和CDN联动设置
登陆CDN,添加站点为刚刚申请的域名
添加A记录,指向VPS的IP地址
类型 名称 内容 TTL 代理状态
A test 10.1.1.111(VPS地址) 自动 已代理
那么这个地址就是 test.xxxxx.tk
- 1
- 2
- 3
- 4
记住Cloudflare 名称服务器,这个是要设置到域名那边的!
找到自己的域名——管理域名——nameservers
选择使用自己的域名解析:Use custom nameservers (enter below)
Nameserver 1、2 都写CDN提供的地址
为了实时受到我们的命令的响应:我们需要修改缓存规则:
保证这两项是开着的
0x05 C2证书配置
首先选择证书模式:完全
下载证书
生成成功保存下来,我保存的是 com.pem,com.key
在VPS上生成CS可用的配置文件
使用以下命令重新生成cobalstrike.store:
openssl pkcs12 -export -in server.pem -inkey server.key -out spoofdomain.p12 -name 域名 -passout pass:密码
例子:
openssl pkcs12 -export -in com.pem -inkey com.key -out spoofdomain.p12 -name test.xxxxx.tk -passout pass:zzz123456
- 1
- 2
- 3
- 4
使用以下命令创建证书:
keytool -importkeystore -deststorepass 密码 -destkeypass 密码 -destkeystore new.store -srckeystore spoofdomain.p12 -srcstoretype PKCS12 -srcstorepass 密码 -alias 域名
例子
keytool -importkeystore -deststorepass zzz123456 -destkeypass zzz123456 -destkeystore new.store -srckeystore spoofdomain.p12 -srcstoretype PKCS12 -srcstorepass zzz123456 -alias test.xxxxx.tk
- 1
- 2
- 3
- 4
最终生成 new.store 文件,(为cobalstrike.store的替代品)
0x06 C2.profile配置
直接使用以下项目:
https://github.com/FortyNorthSecurity/C2concealer
- 1
使用方法:
安装命令:
chmod u+x install.sh
./install.sh
使用命令:
C2concealer --variant 1 --hostname test.domain.tk
- 1
- 2
- 3
- 4
- 5
这里选择3
因为我们使用的CDN给的证书,然后输入/home/cs/new.store,这就是刚刚生成的new.store的绝对路径来。
最终会生成随机名的profile
成功生成
最后讲生成的这个随机数.profile,复制到cs目录下。
0x07 启动C2
用c2lint 检查下,下面这样就是通过:
./c2lint ca730a6d.profile
- 1
检查成功后,修改teamserver配置
vim teamserver
- 1
修改最后一行的内容
javax.net.ssl.keyStore=./new.store (证书生成的new.store文件地址) -Djavax.net.ssl.keyStorePassword=zzz123456(上面证书的那个密码)
- 1
启动C2
./teamserver 192.168.1.1 password123456 ./C2.profile
- 1
0x08 配置CS
配置一个监听器
配置一个powershell上线,注意要勾选SSL
0x09 成功上线
成功上线
0x10 总结
本次搭建是以免费的网站为主,但是实际操作起来发现,这个CDN还是有时候不太稳定,有条件的可以换个好的,但是注意要关掉缓存。
边栏推荐
- win10无法操作(删除、剪切)文件
- QT: the program input point xxxxx cannot be located in the dynamic link library.
- Win10 cannot operate (delete, cut) files
- Drug disease association prediction based on multi-scale heterogeneous network topology information and multiple attributes
- Summary of leetcode's dynamic programming 4
- Simulation volume leetcode [general] 1061 Arrange the smallest equivalent strings in dictionary order
- MFC关于长字符串unsigned char与CString转换及显示问题
- Digital triangle model acwing 1015 Picking flowers
- F - true liars (category and search set +dp)
- Esp32 esp-idf watchdog twdt
猜你喜欢
在uni-app中使用腾讯视频插件播放视频
D - How Many Answers Are Wrong
org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 ‘outgoing‘ 开头的无效内容
Address bar parameter transmission of list page based on jeecg-boot
記一個基於JEECG-BOOT的比較複雜的增删改功能的實現
联合索引的左匹配原则
【MQTT从入门到提高系列 | 01】从0到1快速搭建MQTT测试环境
LeetCode 739. Daily temperature
Redis core technology and basic architecture of actual combat: what does a key value database contain?
技术分享 | 常见接口协议解析
随机推荐
記一個基於JEECG-BOOT的比較複雜的增删改功能的實現
模拟卷Leetcode【普通】1219. 黄金矿工
org. activiti. bpmn. exceptions. XMLException: cvc-complex-type. 2.4. a: Invalid content beginning with element 'outgoing' was found
[mqtt from getting started to improving series | 01] quickly build an mqtt test environment from 0 to 1
Fledgling Xiao Li's 103rd blog CC2530 resource introduction
PHP uses redis to implement distributed locks
Summary of leetcode's dynamic programming 4
Modify the list page on the basis of jeecg boot code generation (combined with customized components)
Qt:无法定位程序输入点XXXXX于动态链接库。
翻译影视剧字幕,这些特点务必要了解
Making interactive page of "left tree and right table" based on jeecg-boot
Private cloud disk deployment
Defense (greed), FBI tree (binary tree)
My daily learning records / learning methods
使用Nacos管理配置
Technology sharing | common interface protocol analysis
LeetCode 739. Daily temperature
Simulation volume leetcode [general] 1061 Arrange the smallest equivalent strings in dictionary order
Properties file
Pat (Grade B) 2022 summer exam