xz

YARA-2025-2241 Medium general Active

Detection patterns for the tool 'xz' taken from the ThreatHunting-Keywords github project

xz.yar Valid Syntax
rule xz
{
    meta:
        description = "Detection patterns for the tool 'xz' taken from the ThreatHunting-Keywords github project" 
        author = "@mthcht"
        reference = "https://github.com/mthcht/ThreatHunting-Keywords"
        tool = "xz"
        rule_category = "signature_keyword"

    strings:
        // Description: backdoor in upstream xz/liblzma leading to ssh server compromise
        // Reference: https://securelist.com/xz-backdoor-story-part-1/112354/
        $string1 = /HEUR\:Trojan\.Script\.XZ/ nocase ascii wide
        // Description: backdoor in upstream xz/liblzma leading to ssh server compromise
        // Reference: https://securelist.com/xz-backdoor-story-part-1/112354/
        $string2 = /MEM\:Trojan\.Linux\.XZ/ nocase ascii wide
        // Description: backdoor in upstream xz/liblzma leading to ssh server compromise
        // Reference: https://securelist.com/xz-backdoor-story-part-1/112354/
        $string3 = /Trojan\.Shell\.XZ/ nocase ascii wide

    condition:
        any of them
}

Rule Metadata

description
Detection patterns for the tool 'xz' taken from the ThreatHunting-Keywords github project
author
@mthcht
reference
https://github.com/mthcht/ThreatHunting-Keywords
tool
xz
rule_category
signature_keyword

String Definitions

{"name":"$string1","value":"\/HEUR\\:Trojan\\.Script\\.XZ\/ nocase ascii wide\n \/\/ Description: backdoor in upstream xz\/liblzma leading to ssh server compromise\n \/\/ Reference: https:\/\/securelist.com\/xz-backdoor-story-part-1\/112354\/"}
{"name":"$string2","value":"\/MEM\\:Trojan\\.Linux\\.XZ\/ nocase ascii wide\n \/\/ Description: backdoor in upstream xz\/liblzma leading to ssh server compromise\n \/\/ Reference: https:\/\/securelist.com\/xz-backdoor-story-part-1\/112354\/"}
{"name":"$string3","value":"\/Trojan\\.Shell\\.XZ\/ nocase ascii wide"}

Threat Analysis

This YARA rule is designed to detect general threats.

Severity Level: Medium

The rule uses pattern matching to identify specific byte sequences, strings, or behavioral patterns associated with malicious activity.

Detection Capabilities

  • File-based detection for executables and documents
  • Memory scanning for running processes
  • Network traffic analysis support

Command Line Usage

# Scan a single file
yara xz.yar /path/to/suspicious/file

# Scan a directory recursively
yara -r xz.yar /path/to/directory/

# Scan with metadata output
yara -m xz.yar target_file

# Scan process memory (Linux)
yara xz.yar /proc/[pid]/exe

Integration Examples

Python (yara-python)

import yara
rules = yara.compile(filepath='xz.yar')
matches = rules.match('/path/to/file')

ClamAV Integration

clamscan --yara-rules=xz.yar /path/to/scan

Rule Information

YARA ID
YARA-2025-2241
Author
Created
August 19, 2025
Last Updated
August 19, 2025
Last Imported
Never

Threat Intelligence

Risk Level Medium
Category general
Detection Confidence Analysis Pending
False Positive Rate Not Available
Last Seen in Wild No Data

Export Options