Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Uta0218_Upstyle_Backdoor_Strings

Detects UPSTYLE backdoor

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

What this rule detects

Detects UPSTYLE backdoor

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

Summary generated from the rule's metadata and condition.

Rule source

apt-uta0218-upstyle-backdoor-strings.yarDetection Rule License 1.1
rule SEKOIA_Apt_Uta0218_Upstyle_Backdoor_Strings : FILE
{
	meta:
		description = "Detects UPSTYLE backdoor"
		author = "Sekoia.io"
		id = "098fbad7-efaf-4198-83de-208c2ae16f89"
		date = "2024-04-16"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_uta0218_upstyle_backdoor_strings.yar#L1-L27"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "bcba657b0b302f4b46f09bc4b815a581d22208b5d9f99e1233878f775241f92e"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1_1 = "f.write(b'''import base64;exec(base64.b64decode(b" ascii
		$s1_2 = "atime=os.path.getatime(" ascii
		$s2_1 = "exec(base64.b64decode(functioncode))" ascii base64
		$s2_2 = "os.path.exists(systempth):" ascii base64
		$s2_3 = ".read().replace(b\"\\x00\",b\" \")" ascii base64
		$s3_1 = "if WRITE_FLAG:" ascii base64
		$s3_2 = "re.search(SHELL_PATTERN" ascii base64
		$s3_3 = "import threading,time,os,re,base64" ascii base64

	condition:
		filesize < 1500 and ( 2 of ( $s1_* ) or 2 of ( $s2_* ) or 2 of ( $s3_* ) )
}

Strings (8 patterns)

IdentifierTypeValueModifiers
$s1_1text"f.write(b'''import base64;exec(base64.b64decode(b"ascii
$s1_2text"atime=os.path.getatime("ascii
$s2_1text"exec(base64.b64decode(functioncode))"ascii base64
$s2_2text"os.path.exists(systempth):"ascii base64
$s2_3text".read().replace(b\"\\x00\",b\" \")"ascii base64
$s3_1text"if WRITE_FLAG:"ascii base64
$s3_2text"re.search(SHELL_PATTERN"ascii base64
$s3_3text"import threading,time,os,re,base64"ascii base64

Condition

filesize < 1500 and ( 2 of ( $s1_* ) or 2 of ( $s2_* ) or 2 of ( $s3_* ) )

In plain words (Heuristic)

  • The file must be smaller than 1500 (a cheap guard that skips large files).
  • At least 2 patterns in ( $s1_* ) must match.
  • At least 2 patterns in ( $s2_* ) must match.
  • At least 2 patterns in ( $s3_* ) 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: 098fbad7-efaf-4198-83de-208c2ae16f89

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE