Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_MAL_UNC2891_Slapstick

Detects UNC2891 Slapstick pam backdoor

MalwareSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Frank Boldewin (@r3c0nst), slightly modifier by Florian Roth
Date
2022-03-30
Modified
2023-01-05
Score / Quality
75 / 85

What this rule detects

Detects UNC2891 Slapstick pam backdoor

Targets: Linux ELF.

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

Summary generated from the rule's metadata and condition.

Rule source

mal-unc2891-slapstick.yarDetection Rule License 1.1
rule SIGNATURE_BASE_MAL_UNC2891_Slapstick : FILE
{
	meta:
		description = "Detects UNC2891 Slapstick pam backdoor"
		author = "Frank Boldewin (@r3c0nst), slightly modifier by Florian Roth"
		id = "eb5db507-ac12-5c11-9dd9-ec34b9a80e1c"
		date = "2022-03-30"
		modified = "2023-01-05"
		reference = "https://github.com/fboldewin/YARA-rules/tree/master"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_unc2891_mal_jan23.yar#L19-L39"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		hash = "9d0165e0484c31bd4ea467650b2ae2f359f67ae1016af49326bb374cead5f789"
		logic_hash = "4bc51a47a1b620c3bb950c287c38a37e528e79f9720fb4d9fa9ebecbeca82036"
		score = 75
		quality = 85
		tags = "FILE"

	strings:
		$code1 = {F6 50 04 48 FF C0 48 39 D0 75 F5}
		$code2 = {88 01 48 FF C1 8A 11 89 C8 29 F8 84 D2 0F 85}
		$str1 = "/proc/self/exe" fullword ascii
		$str2 = "%-23s %-23s %-23s %-23s %-23s %s" fullword ascii
		$str3 = "pam_sm_authenticate" ascii
		$str_fr1 = "HISTFILE=/dev/null"

	condition:
		uint32( 0 ) == 0x464c457f and filesize < 100KB and ( all of ( $code* ) or all of ( $str* ) )
}

Strings (6 patterns)

IdentifierTypeValueModifiers
$code1hex{F6 50 04 48 FF C0 48 39 D0 75 F5}
$code2hex{88 01 48 FF C1 8A 11 89 C8 29 F8 84 D2 0F 85}
$str1text"/proc/self/exe"fullword ascii
$str2text"%-23s %-23s %-23s %-23s %-23s %s"fullword ascii
$str3text"pam_sm_authenticate"ascii
$str_fr1text"HISTFILE=/dev/null"

Condition

uint32( 0 ) == 0x464c457f and filesize < 100KB and ( all of ( $code* ) or all of ( $str* ) )

In plain words (Heuristic)

  • The file must start with the ELF header — a Linux/Unix executable.
  • The file must be smaller than 100KB (a cheap guard that skips large files).
  • All patterns in ( $code* ) must match.
  • All patterns in ( $str* ) 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

Sample hashes

Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).

  • 9d0165e0484c31bd4ea467650b2ae2f359f67ae1016af49326bb374cead5f789

Licence & attribution

Author: Frank Boldewin (@r3c0nst), slightly modifier by Florian Roth

Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a

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: eb5db507-ac12-5c11-9dd9-ec34b9a80e1c

Tags:FILE