当前位置:网站首页>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还是有时候不太稳定,有条件的可以换个好的,但是注意要关掉缓存。
边栏推荐
- 测试周期被压缩?教你9个方法去应对
- 使用Nacos管理配置
- 模拟卷Leetcode【普通】1091. 二进制矩阵中的最短路径
- 技术分享 | 常见接口协议解析
- Simulation volume leetcode [general] 1218 Longest definite difference subsequence
- Caused by:org. gradle. api. internal. plugins . PluginApplicationException: Failed to apply plugin
- Black cat takes you to learn UFS protocol Chapter 18: how UFS configures logical units (Lu Management)
- Py06 字典 映射 字典嵌套 键不存在测试 键排序
- 端午节快乐Wish Dragon Boat Festival is happy
- MySQL is sorted alphabetically
猜你喜欢

【无App Push 通用测试方案

Basic knowledge of MySQL

The whole process realizes the single sign on function and the solution of "canceltoken" of undefined when the request is canceled

生物医学英文合同翻译,关于词汇翻译的特点

Black cat takes you to learn EMMC Protocol Part 10: EMMC read and write operation details (read & write)

Lecture 8: 1602 LCD (Guo Tianxiang)

Detailed explanation of P problem, NP problem, NPC problem and NP hard problem

mysql按照首字母排序

Private cloud disk deployment

Drug disease association prediction based on multi-scale heterogeneous network topology information and multiple attributes
随机推荐
leetcode 24. 两两交换链表中的节点
字幕翻译中翻英一分钟多少钱?
Simulation volume leetcode [general] 1143 Longest common subsequence
RestTemplate、Feign实现Token传递
论文摘要翻译,多语言纯人工翻译
Win10 cannot operate (delete, cut) files
使用Nacos管理配置
【MQTT从入门到提高系列 | 01】从0到1快速搭建MQTT测试环境
Error getting a new connection Cause: org. apache. commons. dbcp. SQLNestedException
Simulation volume leetcode [general] 1314 Matrix area and
全链路压测:构建三大模型
今日夏至 Today‘s summer solstice
[Tera term] black cat takes you to learn TTL script -- serial port automation skill in embedded development
MFC dynamically creates dialog boxes and changes the size and position of controls
G - Supermarket
JMeter做接口测试,如何提取登录Cookie
一文揭开,测试外包公司的真 相
My daily learning records / learning methods
Apple has open source, but what about it?
QT: the program input point xxxxx cannot be located in the dynamic link library.