Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_APT_RU_Sandworm_PY_May20_1

Detects Sandworm Python loader

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

What this rule detects

Detects Sandworm Python loader

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

Summary generated from the rule's metadata and condition.

Rule source

apt-ru-sandworm-py-may20-1.yarDetection Rule License 1.1
rule SIGNATURE_BASE_APT_RU_Sandworm_PY_May20_1 : FILE
{
	meta:
		description = "Detects Sandworm Python loader"
		author = "Florian Roth (Nextron Systems)"
		id = "a392d800-1fe8-5ae9-b813-e1dfcedecda6"
		date = "2020-05-28"
		modified = "2023-12-05"
		reference = "https://twitter.com/billyleonard/status/1266054881225236482"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_sandworm_exim_expl.yar#L131-L148"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		hash = "c025008463fdbf44b2f845f2d82702805d931771aea4b506573b83c8f58bccca"
		logic_hash = "2ccc4c7fc75c04cbcab34904de2e7ab055a15c1017ec0f8d01b06454f4395047"
		score = 75
		quality = 85
		tags = "FILE"

	strings:
		$x1 = "o.addheaders=[('User-Agent','Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko')]" ascii fullword
		$s1 = "exec(o.open('http://" ascii
		$s2 = "__import__({2:'urllib2',3:'urllib.request'}"

	condition:
		uint16( 0 ) == 0x6d69 and filesize < 1KB and 1 of ( $x* ) or 2 of them
}

Strings (3 patterns)

IdentifierTypeValueModifiers
$x1text"o.addheaders=[('User-Agent','Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko')]"ascii fullword
$s1text"exec(o.open('http://"ascii
$s2text"__import__({2:'urllib2',3:'urllib.request'}"

Condition

uint16( 0 ) == 0x6d69 and filesize < 1KB and 1 of ( $x* ) or 2 of them

In plain words (Heuristic)

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

  • c025008463fdbf44b2f845f2d82702805d931771aea4b506573b83c8f58bccca

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: a392d800-1fe8-5ae9-b813-e1dfcedecda6

Tags:FILE