Skip to content

YARA · Mandiant red team tool countermeasures

FIREEYE_RT_Hacktool_PY_Impacketobfuscation_1

smbexec

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

smbexec

It defines 6 patterns (4 text, 0 hex, 2 regex).

Summary generated from the rule's metadata and condition.

Rule source

hacktool-py-impacketobfuscation-1.yarBSD 2-Clause License
rule FIREEYE_RT_Hacktool_PY_Impacketobfuscation_1
{
	meta:
		description = "smbexec"
		author = "FireEye"
		id = "992d1132-3136-5e1b-a1ef-dcdf36ebf0f5"
		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 (Smbexec)/production/yara/HackTool_PY_ImpacketObfuscation_1.yar#L4-L22"
		license_url = "https://github.com/mandiant/red_team_tool_countermeasures//blob/3561b71724dbfa3e2bb78106aaa2d7f8b892c43b/LICENSE.txt"
		hash = "0b1e512afe24c31531d6db6b47bac8ee"
		logic_hash = "45a4c0426b29b8c8bede9c4e8292131da7e756d48fc3ac4a07d08fd52383d21e"
		score = 75
		quality = 75
		tags = ""
		rev = 1

	strings:
		$s1 = "class CMDEXEC" nocase
		$s2 = "class RemoteShell" nocase
		$s3 = "self.services_names"
		$s4 = "import random"
		$s6 = /self\.__shell[\x09\x20]{0,32}=[\x09\x20]{0,32}[\x22\x27]%CoMSpEC%[\x09\x20]{1,32}\/q[\x09\x20]{1,32}\/K [\x22\x27]/ nocase
		$s7 = /self\.__serviceName[\x09\x20]{0,32}=[\x09\x20]{0,32}self\.services_names\[random\.randint\([\x09\x20]{0,32}0[\x09\x20]{0,32},[\x09\x20]{0,32}len\(self\.services_names\)[\x09\x20]{0,32}-[\x09\x20]{0,32}1\)\]/

	condition:
		all of them
}

Strings (6 patterns)

IdentifierTypeValueModifiers
$s1text"class CMDEXEC"nocase
$s2text"class RemoteShell"nocase
$s3text"self.services_names"
$s4text"import random"
$s6regex/self\.__shell[\x09\x20]{0,32}=[\x09\x20]{0,32}[\x22\x27]%CoMSpEC%[\x09\x20]{1,32}\/q[\x09\x20]{1,32}\/K [\x22\x27]/nocase
$s7regex/self\.__serviceName[\x09\x20]{0,32}=[\x09\x20]{0,32}self\.services_names\[random\.randint\([\x09\x20]{0,32}0[\x09\x20]{0,32},[\x09\x20]{0,32}len\(self\.service …

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).

  • 0b1e512afe24c31531d6db6b47bac8ee

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: 992d1132-3136-5e1b-a1ef-dcdf36ebf0f5

Metadata

rev1