Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Backdoor_Powershellempire_Csharp

Detects CSharp version of Empire

MalwareSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2022-04-15
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detects CSharp version of Empire

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

backdoor-powershellempire-csharp.yarDetection Rule License 1.1
rule SEKOIA_Backdoor_Powershellempire_Csharp : FILE
{
	meta:
		description = "Detects CSharp version of Empire"
		author = "Sekoia.io"
		id = "952e8e9b-8e4d-4550-9cf4-7ffd2f9d0672"
		date = "2022-04-15"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/backdoor_powershellempire_csharp.yar#L1-L23"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "536ef1167627c3dadb866d55e7eae2220c3fbd6961e2cfa71656656d984b9b90"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ = "[-] Catastrophic .Net Agent Failure, Attempting Agent Restart:" ascii wide
		$ = "[!] Upload failed - No Delimiter" ascii wide
		$ = "SELECT * FROM Win32_IP4RouteTable" ascii wide
		$ = "no shell command supplied" ascii wide
		$ = "[-] CmdletInvocationException:" ascii wide
		$ = "[*] File download of" ascii wide
		$ = "Script successfully saved in memory" ascii wide
		$ = "Invoke-Empire" ascii wide
		$ = "website to reach:" ascii wide

	condition:
		uint16be( 0 ) == 0x4d5a and 5 of them and filesize < 1MB
}

Strings (9 patterns)

IdentifierTypeValueModifiers
$text"[-] Catastrophic .Net Agent Failure, Attempting Agent Restart:"ascii wide
$text"[!] Upload failed - No Delimiter"ascii wide
$text"SELECT * FROM Win32_IP4RouteTable"ascii wide
$text"no shell command supplied"ascii wide
$text"[-] CmdletInvocationException:"ascii wide
$text"[*] File download of"ascii wide
$text"Script successfully saved in memory"ascii wide
$text"Invoke-Empire"ascii wide
$text"website to reach:"ascii wide

Condition

uint16be( 0 ) == 0x4d5a and 5 of them and filesize < 1MB

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be smaller than 1MB (a cheap guard that skips large files).
  • At least 5 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: 952e8e9b-8e4d-4550-9cf4-7ffd2f9d0672

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE