最后更新于2024年2月27日星期二17:16:10 GMT

*快速7事件响应顾问Noah Hemker, Tyler Starks, 恶意软件分析师汤姆·埃尔金斯为本博客提供了分析和见解.*

Rapid7事件响应被用于调查一起涉及未经授权访问两个面向公众的Confluence服务器的事件,这两个服务器是多个恶意软件执行的来源. Rapid7发现了利用的证据 CVE-2023-22527 within available Confluence logs. During the investigation, Rapid7在范围内服务器上识别了加密挖掘软件和Sliver命令与控制(C2)有效载荷. Sliver is a modular C2 framework that provides adversarial emulation capabilities for red teams; however, 它也经常被威胁行为者滥用. 银色有效载荷用于在环境中执行后续威胁行为者目标. 没有适当的安全工具来监视系统网络流量和防火墙通信, 这种活动会在不被发现的情况下进行,导致进一步的妥协.

Rapid7 customers

Rapid7 consistently monitors emergent threats 确定有新的检测机会的领域. 最近出现的silver C2恶意软件促使Rapid7团队对正在使用的技术和潜在风险进行了彻底的分析. Rapid7 InsightIDR has an alert rule 可疑Web请求-可能利用Atlassian Confluence CVE-2023-22527 的使用情况,所有IDR客户都可以使用 text-inline.vm 与CVE-2023-22527漏洞一致. A vulnerability check 也适用于InsightVM和expose客户. 一个用于寻找Confluence CVE-2023-22527漏洞证据的快速盗龙神器可以在快速盗龙神器交易所获得 here. Read Rapid7’s blog on CVE-2023-22527.

Observed Attacker Behavior

Rapid7 IR通过对两个受影响的面向公众的Confluence服务器上的可用取证文物进行分类,开始了调查. 这些服务器都运行着易受攻击的Confluence软件版本,这些版本被滥用来获取远程代码执行(RCE)功能. Rapid7审查了服务器访问日志,以识别可疑的存在 POST 请求与已知漏洞一致,包括 CVE-2023-22527. 此漏洞是一个严重的OGNL注入漏洞,它滥用了 text-inline.vm 通过向服务器发送修改后的POST请求来修改Confluence的组件.

证据显示有多个实例利用了该CVE, however, 在访问日志中记录的标准标头信息中无法找到嵌入式命令的证据. 不能检查包捕获(PCAP)以识别嵌入命令, but the identified POST 请求与CVE的利用一致.
以下是在访问日志中发现的一些利用Confluence CVE的示例:

Access.log Entry
POST /template/aui/text-inline.vm HTTP/1.0 200 5961ms 7753 - Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
POST /template/aui/text-inline.vm HTTP/1.0 200 70ms 7750 - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15
POST /template/aui/text-inline.vm HTTP/1.0 200 247ms 7749 - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0

Evidence showed the execution of a curl 命令后利用CVE导致将加密恶意软件投放到系统中. 对Confluence服务器的恶意POST请求关联的IP地址与识别出的IP地址匹配 curl command. 这表明被丢弃的加密恶意软件与Confluence CVE利用直接相关.
As a result of the executed curl command, file w.sh was written to the /tmp/ directory on the system. 该文件是一个bash脚本,用于枚举操作系统, 下载密码挖掘安装文件, 然后执行加密挖矿二进制文件. The bash script then executed the wget command to download javs.tar.gz from the IP address 38.6.173[.]11 over port 80. This file was identified to be the XMRigCC 加密挖矿恶意软件,导致系统资源利用率与加密挖矿活动一致. Service javasgs_miner.service 是否在系统上创建并设置为以root身份运行以确保持久化.

中包含的代码片段 w.sh 定义用于下载和执行XMRigCC二进制文件的通信参数.

Rapid7在里面发现了额外的日志证据 Catalina.log 在HTTP响应头中引用上述文件的下载. 此响应注册为“无效”,因为它包含无法准确解释的字符. 证据证实了XMRigCC矿机的成功下载和执行, 因此,上述Catalina日志可能对分析人员识别企图或成功利用的额外证据有用.

Catalina Log Entry
警告[http-nio-8090-exec-239 url: /rest/table-filter/.0/service/license; user: Redacted ] org.apache.coyote.http11.Http11Processor.preerresponse HTTP响应头[X-Cmd-Response],值为[HTTP://38.6.173.11/xmrigCC-3.4.0-linux-generic-static-amd64.tar.gz xmrigCC-3.4.0-linux-generic-static-amd64.tar.gz... 已从响应中删除,因为它无效

Rapid7随后将重点转移到开始检查两个服务器上的系统网络连接. 证据显示有一个已知被滥用IP地址的活跃连接 193.29.13[.]179 communicating over port 8888 from both servers. netstat 命令输出显示网络连接的源程序被调用 X-org and was located within the system’s /tmp directory. According to firewall logs, 从这个服务器到恶意IP地址的第一个被识别的通信与被识别的时间戳一致 X-org file creation. Rapid7识别了另一个驻留在备用服务器上的恶意文件 X0 这两个文件共享相同的SHA256哈希,表明它们是相同的二进制. 这些文件的散列已在下面的ioc部分中提供.

对防火墙日志的检查提供了受影响系统和恶意IP地址之间通信的全面视图. 防火墙日志过滤了受损服务器和恶意IP地址之间的流量,显示入站和出站数据传输与已知的C2行为一致. Rapid7解码并调试了silver有效负载,以提取任何可用的妥协指标(ioc)。. 在silver有效载荷中,Rapid7确认了以下IP地址 193.29.13[.]179 would communicate over port 8888 using the mTLS authentication protocol.

在silver第一次与C2沟通之后, 检查本地系统上与当前会话关联的用户名, read etc/passwd and etc/machine-id 然后再次与C2沟通. The contents of passwd and machine-id 提供系统信息,如主机名和系统上的任何帐户. 发现来自系统的缓存凭据与进一步支持此凭据访问的出站C2流量相关联. 此活动与GitHub版本中提供的标准功能一致 here.

稍后将使用silver C2连接执行 wget commands used to download Kerbrute, Traitor, and Fscan to the servers. Kerbute was executed from dev/shm 并且通常用于通过Kerberos预身份验证暴力破解和枚举有效的Active Directory帐户. The Traitor binary was executed from the var/tmp 目录,其中包含要利用的功能 Pwnkit and Dirty Pipe as seen within evidence on the system. Fscan was executed from the var/tmp directory with the file name f 并执行扫描以枚举环境中存在的系统. Rapid7执行了遏制措施,以阻止任何进一步的威胁行为者活动. 在环境中没有确定其他开发后目标.

Mitigation guidance

以减轻本博客中概述的攻击者行为, 应考虑以下缓解技术:

  • 确保在面向公众的服务器上关闭不必要的端口和服务.

  • 所有面向公众的服务器都应该定期打补丁,并使用最新的软件版本.

  • 应该将环境防火墙日志聚合到一个集中的安全解决方案中,以便检测异常的网络通信.

  • 应该实现防火墙规则来拒绝来自未经批准的地理位置的入站和出站流量.

  • 托管web应用程序的面向公众的服务器应该实现一个受限制的shell, where possible, 与标准bash shell相比,限制可用命令的功能和范围.

MITRE ATT&CK Techniques

Tactics Techniques Details
Command and Control Application Layer Protocol (T1071) Sliver C2 connection
Discovery Domain Account Discovery (T1087) 活动目录的Kerbrute枚举
Reconnaissance Active Scanning (T1595) Fscan enumeration
Privilege Escalation Setuid and Setgid (T1548.001) Traitor privilege escalation
Execution Unix Shell (T1059.004) silver有效载荷和后续命令执行
Credential Access Brute Force (T1110) Kerbrute活动目录暴力破解组件
Credential Access OS Credential Dumping (T1003.008) 提取/etc/passwd文件的内容
Impact Resource Hijacking (T1496) Execution of cryptomining software
Initial Access 利用面向公众的应用程序(T1190) 合流日志中文本内联滥用的证据

Indicators of Compromise

Attribute Value Description
Filename and Path /dev/shm/traitor-amd64 Privilege escalation binary
SHA256 fdfbfc07248c3359d9f1f536a406d4268f01ed63a856bd6cef9dccb3cf4f2376 Hash for Traitor binary
Filename and Path /var/tmp/kerbrute_linux_amd64 活动目录的Kerbrute枚举
SHA256 710年a9d2653c8bd3689e451778dab9daec0de4c4c75f900788ccf23ef254b122a Hash for Kerbrute binary
Filename and Path /var/tmp/f Fscan enumeration
SHA256 b26458a0b60f4af597433fb7eff7b949ca96e59330f4e4bb85005e8bbcfa4f59 Hash for Fscan binary
Filename and Path /tmp/X0 Sliver binary
SHA256 29 bd4fa1fcf4e28816c59f9f6a248bedd7b9867a88350618115efb0ca867d736 Hash for Sliver binary
Filename and Path /tmp/X-org Sliver binary
SHA256 29 bd4fa1fcf4e28816c59f9f6a248bedd7b9867a88350618115efb0ca867d736 Hash for Sliver binary
IP Address 193.29.13.179 Sliver C2 IP address
Filename and Path /tmp/w.sh Bash script for XMrigCC cryptominer
SHA256 8 d7c5ab5b2cf475a0d94c2c7d82e1bbd8b506c9c80d5c991763ba6f61f1558b0 Hash for bash script
Filename and Path /tmp/javs.tar.gz Compressed crypto installation files
SHA256 ef7c24494224a7f0c528edf7b27c942d18933d0fc775222dd5fffd8b6256736b Hash for crypto installation files
Log-Based IOC "POST /template/aui/text-inline.vm HTTP/1.0 200”,后面跟着包含curl的GET请求 利用Confluence访问中的行为.log
IP Address 195.80.148.18 与利用文本内联和curl相关的IP地址
IP Address 103.159.133.23 与利用文本内联和curl相关的IP地址