告警流量分析:Cobalt Strike(默认实验文)

前言

软件一般都有流量特征,比如 SQLMap 默认有请求头指纹,这种情况分析 http 流量可以找到哪些包来自 SQLMap,通过 UA 插件修改该指纹就是隐藏特征 。Cobalt Strike 也有默认证书、流量特征等,通过这些数据来判断是否被 Cobalt Strike 控制。

从去除流量特征反推

参考:

Cobalt Strike 服务端和客户端是通过 SSL 加密通讯的,SSL配置文件和代理配置文件由于默认配置,导致 keystore 文件内容通常被用于防火墙识别。

Cobalt Strike 本地密钥文件:cobaltstrike.store

SSL 证书流量特征:
keystore type: jks
Alias name: cobaltstrike
Own: CN=Major Cobalt Strike
Issuer: CN=Major Cobalt Strike

  1. CS 默认端口:50050
  2. 默认 C/S 端通讯证书:字段和固定哈希值识别
  3. HTTP 流量特征:请求的固定地址,请求头等?

在这里插入图片描述

分析流量包

200815084549005001_tmp.pcap - 无有用信息

The file “200815084549005001_tmp.pcap” isn’t a capture file in a format Wireshark understands.
在这里插入图片描述

200929112751005001_tmp.pcap - 无有用信息
流量包协议

文件共有 40 个包,使用的协议都是 TCP,没有 Http 流量。

可疑 IP 地址

公网地址 10.160.161.18 ,访问 微步在线威胁情报社区 查询显示 安全,不是恶意服务器。

Nmap 探测 50050 端口,显示 filtered,默认探测全是 filtered,不会是 PC 吧,但 PC 一般拿不到 A 段地址。
使用 CS 客户端尝试连接该 Server 端,返回 Connection timed out
测试网络连接,发现 ping 不通,应该有防火墙。
查看 TCP 流量包,硬件地址是 Dell_e8:1e:b5(f0:d4:e2:e8:1e:b5)。

跟踪 TCP 流,基本都显示如下的状态,搜索不到关键词 cobalt
在这里插入图片描述

犯错 - one hour passed

参考:

然后在这个数据包卡了一个小时,思考 TCP 通信方式应该是可以执行命令的。想找 Cobalt Strike 的通信模型,确定 TCP 通信是否能对得上……
在这里插入图片描述

在这里插入图片描述
看到了 Beacon 的通信方式又怎样,这个数据包基本没有价值。对着数据包神游一个小时,直到我打开下一个数据包追踪 TCP 流……气蠢中夹杂一丝欣喜。

在这里插入图片描述

201021151312005001_tmp.pcap - 有用信息

流量包协议:文件共有 61 个包,使用的协议都是 TCP,没有 Http 流量。追踪 TCP 数据流,发现与 Cobalt Strike 相关数据。

第一段数据

追踪组合 TCP 数据流,得到的第一段数据如下,跨越长度为 3-4 条记录,属于攻击者向服务器发送的数据包。

{
  "author": [
    "Elastic"
  ],
  "description": "Cobalt Strike is a threat emulation platform commonly modified and used by adversaries to conduct network attack and exploitation campaigns. This rule detects a network activity algorithm leveraged by Cobalt Strike implant beacons for command and control.",
  "false_positives": [
    "This rule should be tailored to either exclude systems, as sources or destinations, in which this behavior is expected."
  ],
  "index": [
    "packetbeat-*"
  ],
  "language": "lucene",
  "license": "Elastic License",
  "name": "Cobalt Strike Command and Control Beacon",
  "note": "This activity has been observed in FIN7 campaigns.",
  "query": "event.category:(network OR network_traffic) AND type:(tls OR http) AND network.transport:tcp AND destination.domain:/[a-z]{3}.stage.[0-9]{8}\\..*/",
  "references": [
    "https://blog.morphisec.com/fin7-attacks-restaurant-industry",
    "https://www.fireeye.com/blog/threat-research/2017/04/fin7-phishing-lnk.html"
  ],
  "risk_score": 73,
  "rule_id": "cf53f532-9cc9-445a-9ae7-fced307ec53c",
  "severity": "high",
  "tags": [
    "Elastic",
    "Network",
    "Threat Detection",
    "Command and Control"
  ],
  "threat": [
    {
      "framework": "MITRE ATT&CK",
      "tactic": {
        "id": "TA0011",
        "name": "Command and Control",
        "reference": "https://attack.mitre.org/tactics/TA0011/"
      },
      "technique": [
        {
          "id": "T1071",
          "name": "Application Layer Protocol",
          "reference": "https://attack.mitre.org/techniques/T1071/"
        },
        {
          "id": "T1568",
          "name": "Dynamic Resolution",
          "reference": "https://attack.mitre.org/techniques/T1568/",
          "subtechnique": [
            {
              "id": "T1568.002",
              "name": "Domain Generation Algorithms",
              "reference": "https://attack.mitre.org/techniques/T1568/002/"
            }
          ]
        }
      ]
    }
  ],
  "timestamp_override": "event.ingested",
  "type": "query",
  "version": 3
}

分析该数据字典,共有 18 个键

18 键名键值
author
descriptionThis rule 检测一个 C2 beacon 可利用的网络活动算法
false_positives
index
languagelucene,Apache发布的开源全文检索引擎工具包
licenseElastic License?
nameCS C2 Beacon
note此活动已在 FIN7 活动中观察到,FIN7是一个国际APT组织
query
references
risk_score73
rule_idcf53f532-9cc9-445a-9ae7-fced307ec53c,这是平台检测规则
severity
tags
threat
timestamp_override
type
version
TCP 流所有 description
rule_iddescription
cf53f532-9cc9-445a-9ae7-fced307ec53c检测 C2 beacon 可利用的网络活动算法
e7075e8d-a966-458e-a183-85cd331af255检测 CS 默认 TLS 证书的使用
66883649-f908-4a5b-a1e0-54090a1d3a32使用 Web 服务混入合法攻击流量
6ea71ff0-9e95-475b-9506-2580d1ce6154检测内部网络客户端何时将 DNS 流量直接发送到 Internet
无,后半段数据大量 function()标识大量 (15) nslookup.exe 执行,其具有来自同一主机的显式查询类型
源地址筛选:ip.src == 10.160.161.16

同上【TCP 流所有 description】,组合得到 5 个完整的 TCP 数据包。

源地址筛选:ip.src == 10.150.187.155

发送 TCP 数据流的数据长度都为0。
在这里插入图片描述

总结

某个防护设备更新了 5条 与 cobalt strike 相关的检测规则,导致误报。

没有推测出是哪家威胁防护平台的规则。

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值