APT_MAL_APT27_Rshell_Jul24
Description
YARA rule to detect RSHELL of APT27
Query · yara
strings:
$a1 = "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%" ascii
$a2 = "/proc/self/exe" ascii
$s1 = "HISTFILE" ascii fullword
$s2 = "/tmp/guid" ascii fullword
$sop1 = { e8 ?? ?? ?? ?? c7 43 04 00 00 00 00 8b 3b 85 ff 7e 2? e8 ?? ?? 0? 00 85 c0 7e 0? }
$sop2 = { c7 43 04 00 00 00 00 8b 3b 85 ff 7e 2? e8 ?? ?? 0? 00 85 c0 7e 0? f7 d8 }
condition:
(
uint32be(0) == 0x7f454c46 // Linux
or ( uint32be(0) == 0xcafebabe and uint32be(4) < 0x20 ) // Universal mach-O App with dont-match-java-class-file hack
or uint32(0) == 0xfeedface // 32-bit mach-O
or uint32(0) == 0xfeedfacf // 64-bit mach-O
)
and filesize < 2MB
and all of ($a*)
and 2 of ($s*)
or 3 of ($s*)