Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_APT_APT41_CN_ELF_Speculoos_Backdoor

Detects Speculoos Backdoor used by APT41

APT / threat actorSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Florian Roth (Nextron Systems)
Date
2020-04-14
Modified
2023-12-05
Score / Quality
90 / 85

What this rule detects

Detects Speculoos Backdoor used by APT41

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

Summary generated from the rule's metadata and condition.

Rule source

apt-apt41-cn-elf-speculoos-backdoor.yarDetection Rule License 1.1
rule SIGNATURE_BASE_APT_APT41_CN_ELF_Speculoos_Backdoor : FILE
{
	meta:
		description = "Detects Speculoos Backdoor used by APT41"
		author = "Florian Roth (Nextron Systems)"
		id = "efe2b368-33af-5382-a5f0-0e7dd7f4dea4"
		date = "2020-04-14"
		modified = "2023-12-05"
		reference = "https://unit42.paloaltonetworks.com/apt41-using-new-speculoos-backdoor-to-target-organizations-globally/"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_apt41.yar#L233-L267"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		hash = "6943fbb194317d344ca9911b7abb11b684d3dca4c29adcbcff39291822902167"
		hash = "99c5dbeb545af3ef1f0f9643449015988c4e02bf8a7164b5d6c86f67e6dc2d28"
		logic_hash = "ee4cbbc5fc51fb24cbf6017dfb4763ac72a0b23a3b6e794b909e678ebfbabc03"
		score = 90
		quality = 85
		tags = "FILE"

	strings:
		$xc1 = { 2F 70 72 69 76 61 74 65 2F 76 61 72 00 68 77 2E
               70 68 79 73 6D 65 6D 00 68 77 2E 75 73 65 72 6D
               65 6D 00 4E 41 2D 4E 41 2D 4E 41 2D 4E 41 2D 4E
               41 2D 4E 41 00 6C 6F 30 00 00 00 00 25 30 32 78
               2D 25 30 32 78 2D 25 30 32 78 2D 25 30 32 78 2D
               25 30 32 78 2D 25 30 32 78 0A 00 72 00 4E 41 00
               75 6E 61 6D 65 20 2D 76 }
		$s1 = "badshell" ascii fullword
		$s2 = "hw.physmem" ascii fullword
		$s3 = "uname -v" ascii fullword
		$s4 = "uname -s" ascii fullword
		$s5 = "machdep.tsc_freq" ascii fullword
		$s6 = "/usr/sbin/config.bak" ascii fullword
		$s7 = "enter MessageLoop..." ascii fullword
		$s8 = "exit StartCBProcess..." ascii fullword
		$sc1 = { 72 6D 20 2D 72 66 20 22 25 73 22 00 2F 70 72 6F
               63 2F }

	condition:
		uint16( 0 ) == 0x457f and filesize < 600KB and 1 of ( $x* ) or 4 of them
}

Strings (10 patterns)

IdentifierTypeValueModifiers
$xc1hex{ 2F 70 72 69 76 61 74 65 2F 76 61 72 00 68 77 2E 70 68 79 73 6D 65 6D 00 68 77 2E 75 73 65 72 6D 65 6D 00 4E 41 2D 4E 41 2D 4E 41 …
$s1text"badshell"ascii fullword
$s2text"hw.physmem"ascii fullword
$s3text"uname -v"ascii fullword
$s4text"uname -s"ascii fullword
$s5text"machdep.tsc_freq"ascii fullword
$s6text"/usr/sbin/config.bak"ascii fullword
$s7text"enter MessageLoop..."ascii fullword
$s8text"exit StartCBProcess..."ascii fullword
$sc1hex{ 72 6D 20 2D 72 66 20 22 25 73 22 00 2F 70 72 6F 63 2F }

Condition

uint16( 0 ) == 0x457f and filesize < 600KB and 1 of ( $x* ) or 4 of them

In plain words (Heuristic)

  • The file must be smaller than 600KB (a cheap guard that skips large files).
  • At least 1 patterns in ( $x* ) must match.
  • At least 4 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

Sample hashes

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

  • 6943fbb194317d344ca9911b7abb11b684d3dca4c29adcbcff39291822902167
  • 99c5dbeb545af3ef1f0f9643449015988c4e02bf8a7164b5d6c86f67e6dc2d28

Licence & attribution

Author: Florian Roth (Nextron Systems)

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: efe2b368-33af-5382-a5f0-0e7dd7f4dea4

Tags:FILE