Zeek x509 Certificate with Punycode
THIS IS A EXPERIMENTAL DETECTION
This detection has been marked experimental by the Splunk Threat Research team. This means we have not been able to test, simulate, or build datasets for this detection. Use at your own risk. This analytic is NOT supported.
Description
The following analytic detects the presence of punycode within x509 certificates using Zeek x509 logs. It identifies punycode in the subject alternative name email and other fields by searching for the "xn–" prefix. This activity is significant as punycode can be used in phishing attacks or to bypass domain filters, posing a security risk. If confirmed malicious, attackers could use these certificates to impersonate legitimate domains, potentially leading to unauthorized access or data breaches.
- Type: Hunting
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2024-05-30
- Author: Michael Haag, Splunk
- ID: 029d6fe4-a5fe-43af-827e-c78c50e81d81
Annotations
Kill Chain Phase
- Command and Control
NIST
- DE.AE
CIS20
- CIS 13
CVE
Search
1
2
3
4
5
`zeek_x509`
| rex field=san.email{} "\@(?<domain_detected>xn--.*)"
| rex field=san.other_fields{} "\@(?<domain_detected>xn--.*)"
| stats values(domain_detected) by basic_constraints.ca source host
| `zeek_x509_certificate_with_punycode_filter`
Macros
The SPL above uses the following Macros:
zeek_x509_certificate_with_punycode_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Required fields
List of fields required to use this analytic.
- domain_detected
- basic_constraints.ca
- source
- host
How To Implement
The following analytic requires x509 certificate data to be logged entirely. In particular, for CVE-2022-3602, the punycode will be within the leaf certificate. The analytic may be modified to look for all xn–, or utilize a network IDS/monitoring tool like Zeek or Suricata to drill down into cert captured. Note for Suricata, the certificate is base64 encoded and will need to be decoded to capture the punycode (punycode will need to be decoded after).
Known False Positives
False positives may be present if the organization works with international businesses. Filter as needed.
Associated Analytic Story
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
15.0 | 50 | 30 | A x509 certificate has been identified to have punycode in the subject alternative name on $dest$. |
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.
Reference
- https://community.emergingthreats.net/t/out-of-band-ruleset-update-summary-2022-11-01/117
- https://github.com/corelight/CVE-2022-3602/tree/master/scripts
- https://docs.zeek.org/en/master/logs/x509.html
- https://www.splunk.com/en_us/blog/security/nothing-puny-about-cve-2022-3602.html
- https://www.openssl.org/blog/blog/2022/11/01/email-address-overflows/
- https://docs.zeek.org/en/master/scripts/base/init-bare.zeek.html#type-X509::SubjectAlternativeName
Test Dataset
Replay any dataset to Splunk Enterprise by using our replay.py
tool or the UI.
Alternatively you can replay a dataset into a Splunk Attack Range
source | version: 2