我的 Citrix ADC NetScaler CVE-2019-19781 漏洞 DFIR 笔记。
基于 Splunk 的视角。
以下资源表明,摄取日志对于正确分析入侵指标至关重要。
永远不要浪费一场好的危机……摄取所有日志!
由于逻辑漏洞,远程预认证任意命令执行(即可靠执行可能)。
https://support.citrix.com/article/CTX267027
https://www.fireeye.com/blog/threat-research/2020/01/vigilante-deploying-mitigation-for-citrix-netscaler-vulnerability-while-maintaining-backdoor.html
https://www.trustedsec.com/blog/netscaler-remote-code-execution-forensics/
http://deyda.net/index.php/en/2020/01/15/checklist-for-citrix-adc-cve-2019-19781/
https://github.com/x1sec/CVE-2019-19781/blob/master/CVE-2019-19781-DFIR.md
https://nvd.nist.gov/vuln/detail/CVE-2019-19781
https://www.reddit.com/r/blueteamsec/comments/en4m7j/multiple_exploits_for_cve201919781_citrix/
荷兰国家网络安全中心:
https://english.ncsc.nl/latest/news/2020/january/20/install-patches-for-citrix-adc-en-citrix-gateway-servers
https://www.ncsc.nl/actueel/advisory?id=NCSC%2D2019%2D0979
来自NCSC的流程图:
https://english.ncsc.nl/binaries/ncsc-en/documents/publications/2020/januari/21/flowchart-citrix-vulnerability/Flowchart+Citrix+vulnerability.pdf
大多数组织、网站、公司都在重复同样的内容……:-( 就像我一样 ;-)
/var/log/httpaccess.log | /var/log/httperror.log | /etc/httpd.conf | /var/log/websocketd.log 来自转储文件以及我们从Netscalers获取的syslog数据。检查Web服务器日志条目,确认是否成功利用…
检查已知恶意软件的文件系统路径
选择条件:c-uri-path:- '/../vpns/' - '/vpns/cfg/smb.conf' - '/vpns/portal/scripts/.pl' 以及你能想到的所有其他变体。在Netscaler目录中查找恶意术语或意外修改。
/shell/crontab-l.out
/shell/top-b.out + 其他
/var/log/bash.log 来自转储文件 & index=yourindex host=yournetscalerhosts (bash.log 和 sh.log)
基本上检查shell历史中的所有后利用行为…
/shell/sockstat.out 和其他方法。检查已知恶意软件使用的端口。
index=yourshodanindex asn=yourASN# CVE-2019-19781 vulns.CVE-2019-19781.verified=true
不评论 😅
在Splunk中检查(基于Sigma规则 --> https://github.com/Neo23x0/sigma/blob/master/rules/web/web_citrix_cve_2019_19781_exploit.yml#L17
detection:
selection:
c-uri-path:
- '/../vpns/'
- '/vpns/cfg/smb.conf'
- '/vpns/portal/scripts/.pl'
condition: selection
fields:
- client_ip
- vhost
- url
- response
更多可能的威胁指标:
昨晚,我们的Citrix #netscaler CVE-2019-19781蜜罐遭到一个新后门的攻击。它是一个通过…IRC通信的DDoS僵尸程序。请注意连接到50.71.90.246:4545的连接以及名为/tmp/.perl的文件
如果我遗漏了什么,请添加威胁指标或其他要检查的内容。#Sh*trix
#蜜罐日志到Splunk
https://github.com/x1sec/citrix-honeypot
结果/数据写入 ./log 目录。它们包括:
hits.log - 扫描尝试和利用尝试,包含所有数据(例如标头、POST正文)
all.log - 所有命中服务器的HTTP请求
logins.log - 尝试登录Web界面
tlsErrors.log - 互联网扫描器通常会向443端口发送无效数据,此处记录HTTPS错误
#更新
Citrix于2020年1月23日发布补丁:https://www.citrix.com/blogs/2020/01/23/fixes-now-available-for-citrix-adc-citrix-gateway-versions-12-1-and-13-0/
重新安装Netscalers后,安装Splunk Universal Forwarder(FreeBSD安装)
文档:
https://docs.splunk.com/Documentation/Forwarder/8.0.1/Forwarder/Installanixuniversalforwarder#Install_the_universal_forwarder_on_FreeBSD
二进制:
https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=freebsd&version=8.0.1&product=universalforwarder&filename=splunkforwarder-8.0.1-6db836e2fb9e-freebsd-11.1-amd64.txz&wget=true
如何配置Citrix NetScaler生成syslog数据:
https://docs.splunk.com/Documentation/AddOns/released/CitrixNetscaler/Setup
https://docs.citrix.com/en-us/citrix-adc/12-1/system/audit-logging/configuring-audit-logging.html
Splunk Add-On for Citrix Netscaler:
https://splunkbase.splunk.com/app/2770/