Skip to content

YARA · Mandiant red team tool countermeasures

FIREEYE_RT_Hacktool_PY_Impacketobfuscation_2

wmiexec

Hack toolMandiant red team tool countermeasuresBSD 2-Clause LicenseCompiles with YARA-X
Author
FireEye
Date
2020-12-01
Modified
2020-12-09
Score / Quality
75 / 75

What this rule detects

wmiexec

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

Summary generated from the rule's metadata and condition.

Rule source

hacktool-py-impacketobfuscation-2.yarBSD 2-Clause License
rule FIREEYE_RT_Hacktool_PY_Impacketobfuscation_2
{
	meta:
		description = "wmiexec"
		author = "FireEye"
		id = "f1059f66-eaff-5866-bafb-c94236cf96a0"
		date = "2020-12-01"
		date = "2020-12-01"
		modified = "2020-12-09"
		reference = "https://github.com/mandiant/red_team_tool_countermeasures/"
		source_url = "https://github.com/mandiant/red_team_tool_countermeasures//blob/3561b71724dbfa3e2bb78106aaa2d7f8b892c43b/rules/IMPACKETOBF (Wmiexec)/production/yara/HackTool_PY_ImpacketObfuscation_2.yar#L4-L21"
		license_url = "https://github.com/mandiant/red_team_tool_countermeasures//blob/3561b71724dbfa3e2bb78106aaa2d7f8b892c43b/LICENSE.txt"
		hash = "f3dd8aa567a01098a8a610529d892485"
		logic_hash = "ccbbe507798f16c7acf0780770fdb81b2e7dc333ab8bc51e6216816276c3f14b"
		score = 75
		quality = 75
		tags = ""
		rev = 2

	strings:
		$s1 = "import random"
		$s2 = "class WMIEXEC" nocase
		$s3 = "class RemoteShell" nocase
		$s4 = /=[\x09\x20]{0,32}str\(int\(time\.time\(\)\)[\x09\x20]{0,32}-[\x09\x20]{0,32}random\.randint\(\d{1,10}[\x09\x20]{0,32},[\x09\x20]{0,32}\d{1,10}\)\)[\x09\x20]{0,32}\+[\x09\x20]{0,32}str\(uuid\.uuid4\(\)\)\.split\([\x22\x27]\-[\x22\x27]\)\[0\]/
		$s5 = /self\.__shell[\x09\x20]{0,32}=[\x09\x20]{0,32}[\x22\x27]cmd.exe[\x09\x20]{1,32}\/q[\x09\x20]{1,32}\/K [\x22\x27]/ nocase

	condition:
		all of them
}

Strings (5 patterns)

IdentifierTypeValueModifiers
$s1text"import random"
$s2text"class WMIEXEC"nocase
$s3text"class RemoteShell"nocase
$s4regex/=[\x09\x20]{0,32}str\(int\(time\.time\(\)\)[\x09\x20]{0,32}-[\x09\x20]{0,32}random\.randint\(\d{1,10}[\x09\x20]{0,32},[\x09\x20]{0,32}\d{1,10}\)\)[\x09\x20]{0, …
$s5regex/self\.__shell[\x09\x20]{0,32}=[\x09\x20]{0,32}[\x22\x27]cmd.exe[\x09\x20]{1,32}\/q[\x09\x20]{1,32}\/K [\x22\x27]/nocase

Condition

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

Sample hashes

Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).

  • f3dd8aa567a01098a8a610529d892485

Licence & attribution

Author: FireEye

Source repository: Mandiant red team tool countermeasures @ 3561b71724

Licence: BSD 2-Clause License (repository licence)

Copyright notice: Copyright (c) 2023, MANDIANT

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: f1059f66-eaff-5866-bafb-c94236cf96a0

Metadata

rev2