Skip to content

YARA · Mandiant red team tool countermeasures

FIREEYE_RT_Hacktool_MSIL_Sharpivot_3

This rule looks for .NET PE files that have the strings of various method names in the SharPivot code.

Hack toolMandiant red team tool countermeasuresBSD 2-Clause LicenseCompiles with YARA-X (with warnings)
Author
FireEye
Date
2020-12-08
Modified
2020-12-10
Score / Quality
75 / 75

What this rule detects

This rule looks for .NET PE files that have the strings of various method names in the SharPivot code.

Targets: Windows PE.

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

YARA-X says: warning[duplicate_pattern_value]: duplicate pattern value

Summary generated from the rule's metadata and condition.

Rule source

hacktool-msil-sharpivot-3.yarBSD 2-Clause License
rule FIREEYE_RT_Hacktool_MSIL_Sharpivot_3 : FILE
{
	meta:
		description = "This rule looks for .NET PE files that have the strings of various method names in the SharPivot code."
		author = "FireEye"
		id = "616333fc-4075-5f04-823a-1164717a2b87"
		date = "2020-12-08"
		modified = "2020-12-10"
		reference = "https://github.com/mandiant/red_team_tool_countermeasures/"
		source_url = "https://github.com/mandiant/red_team_tool_countermeasures//blob/3561b71724dbfa3e2bb78106aaa2d7f8b892c43b/rules/SHARPIVOT/production/yara/HackTool_MSIL_SharPivot_3.yar#L4-L31"
		license_url = "https://github.com/mandiant/red_team_tool_countermeasures//blob/3561b71724dbfa3e2bb78106aaa2d7f8b892c43b/LICENSE.txt"
		hash = "e4efa759d425e2f26fbc29943a30f5bd"
		logic_hash = "ecf13e47e409efd68b508735a84be6a1627f5b0c0cea6b90434fc9ba5b1d8cf5"
		score = 75
		quality = 75
		tags = "FILE"
		rev = 3

	strings:
		$msil = "_CorExeMain" ascii wide
		$str1 = "SharPivot" ascii wide
		$str2 = "ParseArgs" ascii wide
		$str3 = "GenRandomString" ascii wide
		$str4 = "ScheduledTaskExists" ascii wide
		$str5 = "ServiceExists" ascii wide
		$str6 = "lpPassword" ascii wide
		$str7 = "execute" ascii wide
		$str8 = "WinRM" ascii wide
		$str9 = "SchtaskMod" ascii wide
		$str10 = "PoisonHandler" ascii wide
		$str11 = "SCShell" ascii wide
		$str12 = "SchtaskMod" ascii wide
		$str13 = "ServiceHijack" ascii wide
		$str14 = "commandArg" ascii wide
		$str15 = "payloadPath" ascii wide
		$str16 = "Schtask" ascii wide

	condition:
		( uint16( 0 ) == 0x5A4D and uint32( uint32( 0x3C ) ) == 0x00004550 ) and $msil and all of ( $str* )
}

Strings (17 patterns)

IdentifierTypeValueModifiers
$msiltext"_CorExeMain"ascii wide
$str1text"SharPivot"ascii wide
$str2text"ParseArgs"ascii wide
$str3text"GenRandomString"ascii wide
$str4text"ScheduledTaskExists"ascii wide
$str5text"ServiceExists"ascii wide
$str6text"lpPassword"ascii wide
$str7text"execute"ascii wide
$str8text"WinRM"ascii wide
$str9text"SchtaskMod"ascii wide
$str10text"PoisonHandler"ascii wide
$str11text"SCShell"ascii wide
$str12text"SchtaskMod"ascii wide
$str13text"ServiceHijack"ascii wide
$str14text"commandArg"ascii wide
$str15text"payloadPath"ascii wide
$str16text"Schtask"ascii wide

Condition

( uint16( 0 ) == 0x5A4D and uint32( uint32( 0x3C ) ) == 0x00004550 ) and $msil and all of ( $str* )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $str* ) must match.
  • Pattern $msil must be present.

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

  • e4efa759d425e2f26fbc29943a30f5bd

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: 616333fc-4075-5f04-823a-1164717a2b87

Metadata

rev3

Tags:FILE