Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Oilrig_Powerexchange

Detects OilRig's PowerExchange backdoor

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

What this rule detects

Detects OilRig's PowerExchange backdoor

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

Summary generated from the rule's metadata and condition.

Rule source

apt-oilrig-powerexchange.yarDetection Rule License 1.1
rule SEKOIA_Apt_Oilrig_Powerexchange : FILE
{
	meta:
		description = "Detects OilRig's PowerExchange backdoor"
		author = "Sekoia.io"
		id = "cb6b370f-7b05-480b-865e-ac81ded4a2a4"
		date = "2023-10-24"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_oilrig_powerexchange.yar#L1-L19"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "5e505e9bbb17500f7e9a316b66bccb62089172582478230e0bda736bbefa1fd6"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ = "($h.value).PadRight((($h.value).Length+($h.value).Length%4),'='" ascii wide
		$ = "(($h.value).Length%4 -ne 0)" ascii wide
		$ = "-match \"@@(.*)@@\"" ascii wide
		$ = "[Environment]::NewLine+$_.Exception.Message | Out-File -FilePath" ascii wide
		$ = "ContainsSubjectStrings.Add(\"@@\")" ascii wide

	condition:
		2 of them and filesize < 50KB
}

Strings (5 patterns)

IdentifierTypeValueModifiers
$text"($h.value).PadRight((($h.value).Length+($h.value).Length%4),'='"ascii wide
$text"(($h.value).Length%4 -ne 0)"ascii wide
$text"-match \"@@(.*)@@\""ascii wide
$text"[Environment]::NewLine+$_.Exception.Message | Out-File -FilePath"ascii wide
$text"ContainsSubjectStrings.Add(\"@@\")"ascii wide

Condition

2 of them and filesize < 50KB

In plain words (Heuristic)

  • The file must be smaller than 50KB (a cheap guard that skips large files).
  • 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

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: cb6b370f-7b05-480b-865e-ac81ded4a2a4

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE