ID | Technique | Tactic |
---|---|---|
T1573 | Encrypted Channel | Command And Control |
Detection: Zeek x509 Certificate with Punycode
EXPERIMENTAL DETECTION
This detection status is set to experimental. The Splunk Threat Research team has not yet fully tested, simulated, or built comprehensive datasets for this detection. As such, this analytic is not officially supported. If you have any questions or concerns, please reach out to us at research@splunk.com.
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.
Search
1`zeek_x509`
2| rex field=san.email{} "\@(?<domain_detected>xn--.*)"
3| rex field=san.other_fields{} "\@(?<domain_detected>xn--.*)"
4| stats values(domain_detected) by basic_constraints.ca source host
5| `zeek_x509_certificate_with_punycode_filter`
Data Source
Name | Platform | Sourcetype | Source | Supported App |
---|---|---|---|---|
N/A | N/A | N/A | N/A | N/A |
Macros Used
Name | Value |
---|---|
zeek_x509 | sourcetype="zeek:x509:json" |
zeek_x509_certificate_with_punycode_filter | search * |
zeek_x509_certificate_with_punycode_filter
is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
Default Configuration
This detection is configured by default in Splunk Enterprise Security to run with the following settings:
Setting | Value |
---|---|
Disabled | true |
Cron Schedule | 0 * * * * |
Earliest Time | -70m@m |
Latest Time | -10m@m |
Schedule Window | auto |
Creates Risk Event | False |
Implementation
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
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
A x509 certificate has been identified to have punycode in the subject alternative name on $dest$. | 15 | 50 | 30 |
References
-
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://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
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | Not Applicable | N/A | N/A | N/A |
Unit | ❌ Failing | N/A | N/A |
N/A |
Integration | ❌ Failing | N/A | N/A |
N/A |
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: GitHub | Version: 2