YARA · ditekSHen detection
DITEKSHEN_MALWARE_Win_Mercurial
Detects Mercurial infostealer
- Author
- ditekSHen
- Date
- 2020-11-06
- Modified
- 2024-11-01
- Score / Quality
- 75 / 75
What this rule detects
Detects Mercurial infostealer
Associated malware family: Mercurial.
Targets: Windows PE.
It defines 13 patterns (12 text, 0 hex, 1 regex).
Summary generated from the rule's metadata and condition.
Rule source
malware-win-mercurial.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Mercurial : FILE
{
meta:
= "Detects Mercurial infostealer"
= "ditekSHen"
= "c262ada2-01ca-5fc1-adef-987908514019"
= "2020-11-06"
= "2024-11-01"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L6573-L6593"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "400f8f717a4e07bf4de508c02bbcd9e82bf21f3df84c989fc622378f33e192f0"
= 75
= 75
= "FILE"
strings:
$x1 = "mercurial grabber" wide nocase
$x2 = "\"text\":\"Mercurial Grabber |" wide
$x3 = "/nightfallgt/mercurial-grabber" wide
$s1 = "/LimerBoy/Adamantium-Thief/" ascii
$s2 = "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0" fullword wide
$s3 = "StealCookies" fullword ascii
$s4 = "StealPasswords" fullword ascii
$s5 = "DetectDebug" fullword ascii
$s6 = "CaptureScreen" fullword ascii
$s7 = "WebhookContent" fullword ascii
$s8 = /Grab(Token|Product|IP|Hardware)/ fullword ascii
$p1 = "[\\w-]{24}\\.[\\w-]{6}\\.[\\w-]{27}" fullword ascii wide
$p2 = "mfa\\.[\\w-]{84}" fullword ascii wide
condition:
uint16( 0 ) == 0x5a4d and ( 1 of ( $x* ) or 5 of ( $s* ) or ( all of ( $p* ) and 3 of ( $s* ) ) )
}
Strings (13 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $x1 | text | "mercurial grabber" | wide nocase |
| $x2 | text | "\"text\":\"Mercurial Grabber |" | wide |
| $x3 | text | "/nightfallgt/mercurial-grabber" | wide |
| $s1 | text | "/LimerBoy/Adamantium-Thief/" | ascii |
| $s2 | text | "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0" | fullword wide |
| $s3 | text | "StealCookies" | fullword ascii |
| $s4 | text | "StealPasswords" | fullword ascii |
| $s5 | text | "DetectDebug" | fullword ascii |
| $s6 | text | "CaptureScreen" | fullword ascii |
| $s7 | text | "WebhookContent" | fullword ascii |
| $s8 | regex | /Grab(Token|Product|IP|Hardware)/ | fullword ascii |
| $p1 | text | "[\\w-]{24}\\.[\\w-]{6}\\.[\\w-]{27}" | fullword ascii wide |
| $p2 | text | "mfa\\.[\\w-]{84}" | fullword ascii wide |
Condition
uint16( 0 ) == 0x5a4d and ( 1 of ( $x* ) or 5 of ( $s* ) or ( all of ( $p* ) and 3 of ( $s* ) ) )In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- All patterns in ( $p* ) must match.
- At least 1 patterns in ( $x* ) must match.
- At least 5 patterns in ( $s* ) must match.
- At least 3 patterns in ( $s* ) must match.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
Drop a file here or click to chooseScanned locally with YARA-X. Files up to 200 MB.
References
Licence & attribution
Author: ditekSHen
Source repository: ditekSHen detection @ e76c93dcde
Licence: BSD 2-Clause License (repository licence)
Copyright notice: Copyright 2021 by ditekSHen (https://github.com/ditekshen/detection).
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: c262ada2-01ca-5fc1-adef-987908514019
Tags:FILE
Related rules
- ARKBIRD_SOLG_MAL_Luna_Stealer_Apr_2021_1Metadata onlyMalwareArkbird SOLG (DailyIOC)· Arkbird_SOLG· 2021-08-29
- MalwareditekSHen detection· ditekSHen· 2034-02-17
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06