Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Unc4990_Emptyspace_Pyc

Detects Python Bytecode of EmptySpace

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

What this rule detects

Detects Python Bytecode of EmptySpace

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

Summary generated from the rule's metadata and condition.

Rule source

apt-unc4990-emptyspace-pyc.yarDetection Rule License 1.1
rule SEKOIA_Apt_Unc4990_Emptyspace_Pyc : FILE
{
	meta:
		description = "Detects Python Bytecode of EmptySpace"
		author = "Sekoia.io"
		id = "d970fd9c-1ce5-471c-96a1-146250f36b89"
		date = "2024-02-01"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_unc4990_emptyspace_pyc.yar#L1-L43"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "98e9c848f6b6276815b040681d7f36548b367257bb75d133309e89e8572a50b7"
		score = 75
		quality = 78
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ = "PYBOOTSTRAP"
		$ = "http://google.com/generate_204"
		$ = "from"
		$ = "pathZ"
		$ = "usernamez"
		$ = "timeZ"
		$ = "win32api"
		$ = "base64Z"
		$ = "json"
		$ = "marshalZ"
		$ = "BOOTSTRAP_VERSION"
		$ = "getZ"
		$ = "sleepZ    b64encode"
		$ = "dumps"
		$ = "executableZ"
		$ = "GetUserNameExZ"
		$ = "NameSamCompatible"
		$ = "encode"
		$ = "decodeZ"
		$ = "request_dataZ"
		$ = "server"
		$ = "post"
		$ = "raise_for_status"
		$ = "exec"
		$ = "loadsZ    b64decode"
		$ = "text"
		$ = "globals"
		$ = "bootstrap.py"
		$ = "<module>"

	condition:
		uint32be( 0 ) == 0x420d0d0a and all of them
}

Strings (29 patterns)

IdentifierTypeValueModifiers
$text"PYBOOTSTRAP"
$text"http://google.com/generate_204"
$text"from"
$text"pathZ"
$text"usernamez"
$text"timeZ"
$text"win32api"
$text"base64Z"
$text"json"
$text"marshalZ"
$text"BOOTSTRAP_VERSION"
$text"getZ"
$text"sleepZ b64encode"
$text"dumps"
$text"executableZ"
$text"GetUserNameExZ"
$text"NameSamCompatible"
$text"encode"
$text"decodeZ"
$text"request_dataZ"
$text"server"
$text"post"
$text"raise_for_status"
$text"exec"
$text"loadsZ b64decode"
$text"text"
$text"globals"
$text"bootstrap.py"
$text"<module>"

Condition

uint32be( 0 ) == 0x420d0d0a and all of them

In plain words (Heuristic)

  • 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: d970fd9c-1ce5-471c-96a1-146250f36b89

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE