Detection rules › Splunk

Zeek x509 Certificate with Punycode

Status
experimental
Group by
"basic_constraints.ca", channel, host
Author
Michael Haag, Splunk
Source
github.com/splunk/security_content

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.

MITRE ATT&CK coverage

TacticTechniques
Command & ControlT1573 Encrypted Channel

Rule body splunk

name: Zeek x509 Certificate with Punycode
id: 029d6fe4-a5fe-43af-827e-c78c50e81d81
version: 7
creation_date: '2022-12-19'
modification_date: '2026-05-13'
author: Michael Haag, Splunk
status: experimental
type: Hunting
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.
data_source: []
search: |-
    `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`
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.
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://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
analytic_story:
    - OpenSSL CVE-2022-3602
asset_type: Network
mitre_attack_id:
    - T1573
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: network
security_domain: network

Stages and Predicates

Stage 1: search

`zeek_x509`

Stage 2: rex

| rex field=san.email{} "\@(?<domain_detected>xn--.*)"

Stage 3: rex

| rex field=san.other_fields{} "\@(?<domain_detected>xn--.*)"

Stage 4: stats

| stats values(domain_detected)
    BY basic_constraints.ca source host

Stage 5: search

| `zeek_x509_certificate_with_punycode_filter`

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
sourcetypeeq
  • zeek:x509:json