YARA · SEKOIA.IO Community
SEKOIA_Infostealer_Win_Mars_Stealer
Detect Mars Stealer based on specific strings
- Auteur
- Sekoia.io
- Date
- 2022-02-03
- Modifiée
- 2024-12-19
- Score / Qualité
- 75 / 80
Ce que détecte cette règle
Detect Mars Stealer based on specific strings
Famille de malware associée : Mars Stealer.
Cibles : PE Windows.
Elle définit 18 motifs (17 texte, 1 hex, 0 regex). Modules YARA utilisés : pe.
YARA-X indique : warning[deprecated_field]: field `number_of_sections` is deprecated
Résumé généré à partir des métadonnées et de la condition de la règle.
Source de la règle
Inclut les imports nécessaires pour la compiler seule.
import "pe"
rule SEKOIA_Infostealer_Win_Mars_Stealer : FILE
{
meta:
= "Detect Mars Stealer based on specific strings"
= "Sekoia.io"
= "3e2c7440b2fc9e4b039e6fa8152ac8fd"
= "2022-02-03"
= "2024-12-19"
= "https://3xp0rt.com/posts/mars-stealer"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/infostealer_win_mars_stealer.yar#L3-L44"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
= "b2b36a280c3c6cbbb8cbb9f1dd3eb48a4943ebbddb48eba2ac3d0db03924cafd"
= 75
= 80
= "FILE"
= "1.0"
= "2022-02-14"
= "TLP:CLEAR"
strings:
$dec = {a3 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? 00 00 83 c4 ??}
$api00 = "LoadLibrary" ascii
$api01 = "GetProcAddress" ascii
$api02 = "ExitProcess" ascii
$api03 = "advapi32.dll" ascii
$api04 = "crypt32.dll" ascii
$api05 = "GetTickCount" ascii
$api06 = "Sleep" ascii
$api07 = "GetUserDefaultLangID" ascii
$api08 = "CreateMutex" ascii
$api09 = "GetLastError" ascii
$api10 = "HeapAlloc" ascii
$api11 = "GetProcessHeap" ascii
$api12 = "GetComputerName" ascii
$api13 = "VirtualProtect" ascii
$api14 = "GetUserName" ascii
$api15 = "CryptStringToBinary" ascii
$str0 = "JohnDoe" ascii
condition:
uint16( 0 ) == 0x5A4D and ( #dec > 400 and 12 of ( $api* ) and $str0 ) or for any i in ( 0 .. pe.number_of_sections -1 ) : ( pe.sections [ i ] . name == "LLCPPC" and pe.sections [ i ] . raw_data_size < 5000 )
}
Chaînes (18 motifs)
| Identifiant | Type | Valeur | Modificateurs |
|---|---|---|---|
| $dec | hex | {a3 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? 00 00 83 c4 ??} | |
| $api00 | texte | "LoadLibrary" | ascii |
| $api01 | texte | "GetProcAddress" | ascii |
| $api02 | texte | "ExitProcess" | ascii |
| $api03 | texte | "advapi32.dll" | ascii |
| $api04 | texte | "crypt32.dll" | ascii |
| $api05 | texte | "GetTickCount" | ascii |
| $api06 | texte | "Sleep" | ascii |
| $api07 | texte | "GetUserDefaultLangID" | ascii |
| $api08 | texte | "CreateMutex" | ascii |
| $api09 | texte | "GetLastError" | ascii |
| $api10 | texte | "HeapAlloc" | ascii |
| $api11 | texte | "GetProcessHeap" | ascii |
| $api12 | texte | "GetComputerName" | ascii |
| $api13 | texte | "VirtualProtect" | ascii |
| $api14 | texte | "GetUserName" | ascii |
| $api15 | texte | "CryptStringToBinary" | ascii |
| $str0 | texte | "JohnDoe" | ascii |
Condition
uint16( 0 ) == 0x5A4D and ( #dec > 400 and 12 of ( $api* ) and $str0 ) or for any i in ( 0 .. pe.number_of_sections -1 ) : ( pe.sections [ i ] . name == "LLCPPC" and pe.sections [ i ] . raw_data_size < 5000 )En clair (Heuristique)
- Le fichier doit commencer par « MZ » — un exécutable Windows (PE).
- Au moins 12 motifs de ( $api* ) doivent être trouvés.
- Le motif $dec doit apparaître > 400 fois.
- Une boucle for vérifie une propriété sur plusieurs occurrences ou éléments.
- Le motif $str0 doit être présent.
- Utilise le module pe.
- Vérifie les sections PE (noms, nombre ou propriétés).
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é.
Références
Licence et attribution
Auteur : Sekoia.io
Dépôt source : SEKOIA.IO Community @ a438a5901a
Licence : Detection Rule License 1.1 (licence du dépôt)
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: 3e2c7440b2fc9e4b039e6fa8152ac8fd
Métadonnées
| version | 1.0 |
|---|---|
| modification_date | 2022-02-14 |
| classification | TLP:CLEAR |
Tags:FILE
Règles liées
- MalwareSEKOIA.IO Community· Sekoia.io· 2022-03-10
- MalwareSEKOIA.IO Community· Sekoia.io· 2022-04-06
- MalwareMalpedia signator rules· Felix Bilstein - yara-signator at cocacoding dot com· 2026-05-04
- MalwareEmbee Research· Matthew @ Embee_Research· 2023-12-24
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-07-16
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-08-23
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-04-22
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-07-23