Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Luckymouse_Rshell_Strings

Detects LuckyMouse RShell Mach-O implant

APT / threat actorSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2022-08-05
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detects LuckyMouse RShell Mach-O implant

Targets: Windows PE, macOS Mach-O.

It defines 2 patterns (0 text, 2 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

apt-luckymouse-rshell-strings.yarDetection Rule License 1.1
rule SEKOIA_Apt_Luckymouse_Rshell_Strings : FILE
{
	meta:
		description = "Detects LuckyMouse RShell Mach-O implant"
		author = "Sekoia.io"
		id = "89f18013-ea3e-440f-821e-cef102a43b7b"
		date = "2022-08-05"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_luckymouse_rshell_strings.yar#L1-L26"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "ffca47856d4c4d83312220cff23c0a556be0e675d59ac009c2f74fc0e39cb816"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ = { 64 69 72 00 70 61 74 68
        00 64 6F 77 6E 00 72 65
        61 64 00 75 70 6C 6F 61
        64 00 77 72 69 74 65 00
        64 65 6C }
		$ = { 6C 6F 67 69 6E 00 68 6F
        73 74 6E 61 6D 65 00 6C
        61 6E 00 75 73 65 72 6E
        61 6D 65 00 76 65 72 73
        69 6F 6E }

	condition:
		( uint32be( 0 ) == 0xCFFAEDFE or uint16be( 0 ) == 0x4d5a ) and filesize < 300KB and all of them
}

Strings (2 patterns)

IdentifierTypeValueModifiers
$hex{ 64 69 72 00 70 61 74 68 00 64 6F 77 6E 00 72 65 61 64 00 75 70 6C 6F 61 64 00 77 72 69 74 65 00 64 65 6C }
$hex{ 6C 6F 67 69 6E 00 68 6F 73 74 6E 61 6D 65 00 6C 61 6E 00 75 73 65 72 6E 61 6D 65 00 76 65 72 73 69 6F 6E }

Condition

( uint32be( 0 ) == 0xCFFAEDFE or uint16be( 0 ) == 0x4d5a ) and filesize < 300KB and all of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must start with a Mach-O / fat binary magic — a macOS executable.
  • The file must be smaller than 300KB (a cheap guard that skips large files).
  • All patterns in the rule 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.

Open in editor

References

Licence & attribution

Author: Sekoia.io

Source repository: SEKOIA.IO Community @ a438a5901a

Licence: Detection Rule License 1.1 (repository licence)

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: 89f18013-ea3e-440f-821e-cef102a43b7b

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE