Aller au contenu

YARA · elceef yara-rulz

ELCEEF_Suspicious_SFX

Detects self-extracting archives (SFX) executing cmd.exe or powershell.exe

Suspect / chasseelceef yara-rulzMIT LicenseCompile avec YARA-X (avertissements)
Auteur
marcin@ulikowski.pl
Date
2023-04-04
Score / Qualité
65 / 73

Ce que détecte cette règle

Detects self-extracting archives (SFX) executing cmd.exe or powershell.exe

Cibles : PE Windows.

Elle définit 5 motifs (3 texte, 2 hex, 0 regex).

YARA-X indique : warning[text_as_hex]: hex pattern could be written as text literal

Résumé généré à partir des métadonnées et de la condition de la règle.

Source de la règle

suspicious-sfx.yarMIT License
rule ELCEEF_Suspicious_SFX : FILE
{
	meta:
		description = "Detects self-extracting archives (SFX) executing cmd.exe or powershell.exe"
		author = "marcin@ulikowski.pl"
		id = "78f4ae8b-ba17-5c02-a6f0-66bec873aba8"
		date = "2023-04-04"
		modified = "2023-04-04"
		reference = "https://www.crowdstrike.com/blog/self-extracting-archives-decoy-files-and-their-hidden-payloads/"
		source_url = "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/rules/Suspicious_SFX.yara#L1-L22"
		license_url = "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/LICENSE"
		logic_hash = "688ed356e2fa936a0e07a8479591c28fb457053ed94351bad4bf367b02f04b0a"
		score = 65
		quality = 73
		tags = "FILE"

	strings:
		$rar = { 52 61 72 21 }
		$zip = { 50 4b 03 04 }
		$setup_cmd = "\nSetup=cmd"
		$setup_powershell = "\nSetup=powershell"
		$silent = "\nSilent=1"

	condition:
		filesize < 1MB and uint16be( 0 ) == 0x4d5a and any of ( $zip , $rar ) and any of ( $setup_* ) and $silent
}

Chaînes (5 motifs)

IdentifiantTypeValeurModificateurs
$rarhex{ 52 61 72 21 }
$ziphex{ 50 4b 03 04 }
$setup_cmdtexte"\nSetup=cmd"
$setup_powershelltexte"\nSetup=powershell"
$silenttexte"\nSilent=1"

Condition

filesize < 1MB and uint16be( 0 ) == 0x4d5a and any of ( $zip , $rar ) and any of ( $setup_* ) and $silent

En clair (Heuristique)

  • Le fichier doit commencer par « MZ » — un exécutable Windows (PE).
  • Le fichier doit faire moins de 1MB (garde-fou peu coûteux qui écarte les gros fichiers).
  • Au moins un motif de ( $zip , $rar ) doit être trouvé.
  • Au moins un motif de ( $setup_* ) doit être trouvé.
  • Le motif $silent doit être présent.

Tester cette règle dans votre navigateur

Déposez un fichier pour le scanner avec cette règle grâce à YARA-X compilé en WebAssembly. Rien n’est envoyé.

Déposez un fichier ici ou cliquez pour choisirScanné localement avec YARA-X. Fichiers jusqu’à 200 Mo.

Ouvrir dans l’éditeur

Références

Licence et attribution

Auteur : marcin@ulikowski.pl

Dépôt source : elceef yara-rulz @ 5683b294a1

Licence : MIT License (licence du dépôt)

Mention de copyright : Copyright (c) 2022 Marcin Ulikowski

Règle d’origine

Reprise via YARA Forge 20260927, qui préfixe les noms de règles par la source et ajoute des champs meta normalisés.

Identifiant de règle: 78f4ae8b-ba17-5c02-a6f0-66bec873aba8

Tags:FILE