当前位置:网站首页>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还是有时候不太稳定,有条件的可以换个好的,但是注意要关掉缓存。
边栏推荐
- 技术分享 | 常见接口协议解析
- [C language] string left rotation
- Is the test cycle compressed? Teach you 9 ways to deal with it
- leetcode 24. Exchange the nodes in the linked list in pairs
- E - 食物链
- org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 ‘outgoing‘ 开头的无效内容
- PHP uses redis to implement distributed locks
- Cannot create poolableconnectionfactory (could not create connection to database server. error
- 数据库隔离级别
- oscp raven2靶机渗透过程
猜你喜欢
Win10 cannot operate (delete, cut) files
org. activiti. bpmn. exceptions. XMLException: cvc-complex-type. 2.4. a: Invalid content beginning with element 'outgoing' was found
论文翻译英译中,怎样做翻译效果好?
全链路压测:构建三大模型
Summary of leetcode's dynamic programming 4
今日夏至 Today‘s summer solstice
MySQL is sorted alphabetically
Past and present lives of QR code and sorting out six test points
JWT-JSON WEB TOKEN
F - True Liars (种类并查集+DP)
随机推荐
Caused by:org. gradle. api. internal. plugins . PluginApplicationException: Failed to apply plugin
Simulation volume leetcode [general] 1219 Golden Miner
【MQTT从入门到提高系列 | 01】从0到1快速搭建MQTT测试环境
Selenium source code read through · 9 | desiredcapabilities class analysis
JMeter做接口测试,如何提取登录Cookie
Play video with Tencent video plug-in in uni app
Black cat takes you to learn UFS protocol Chapter 4: detailed explanation of UFS protocol stack
Simulation volume leetcode [general] 1447 Simplest fraction
模拟卷Leetcode【普通】1143. 最长公共子序列
Qt:无法定位程序输入点XXXXX于动态链接库。
Basic knowledge of MySQL
Esp32 esp-idf watchdog twdt
MFC 动态创建的对话框及改变控件的大小和位置
[Tera term] black cat takes you to learn TTL script -- serial port automation skill in embedded development
mysql按照首字母排序
模拟卷Leetcode【普通】1091. 二进制矩阵中的最短路径
記一個基於JEECG-BOOT的比較複雜的增删改功能的實現
Left matching principle of joint index
QT: the program input point xxxxx cannot be located in the dynamic link library.
org. activiti. bpmn. exceptions. XMLException: cvc-complex-type. 2.4. a: Invalid content beginning with element 'outgoing' was found