Skip to content

YARA · ditekSHen detection

DITEKSHEN_INDICATOR_TOOL_ENUM_Sharpshares

Detects SharpShares multithreaded C# .NET Assembly to enumerate accessible network shares in a domain

Suspicious / huntingditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
Author
ditekSHen
Date
2020-11-06
Modified
2024-09-25
Score / Quality
75 / 75

What this rule detects

Detects SharpShares multithreaded C# .NET Assembly to enumerate accessible network shares in a domain

Targets: Windows PE.

It defines 8 patterns (7 text, 0 hex, 1 regex).

Summary generated from the rule's metadata and condition.

Rule source

indicator-tool-enum-sharpshares.yarBSD 2-Clause License
rule DITEKSHEN_INDICATOR_TOOL_ENUM_Sharpshares : FILE
{
	meta:
		description = "Detects SharpShares multithreaded C# .NET Assembly to enumerate accessible network shares in a domain"
		author = "ditekSHen"
		id = "1da53e34-21a3-5b3c-885e-dcc8814ac3c8"
		date = "2020-11-06"
		modified = "2024-09-25"
		reference = "https://github.com/ditekshen/detection"
		source_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/indicator_tools.yar#L1290-L1305"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "8b35d6a692814e1b27ffc1db4ab124bf621c156aaf57f24796c422ec95a85715"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$s1 = "SharpShares." ascii wide
		$s2 = "GetComputerShares" fullword ascii
		$s3 = "userAccountControl:1.2.840.113556.1.4.803:=2))(operatingSystem=*server*)(!(userAccountControl:1.2" wide
		$s4 = "GetAllShares" fullword ascii
		$s5 = "stealth:" wide
		$s6 = "(&(objectCategory=computer)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(operatingSystem=*server*))" fullword wide
		$s7 = /\/targets|ldap|threads/ wide
		$s8 = "entriesread" fullword ascii

	condition:
		uint16( 0 ) == 0x5a4d and 4 of them
}

Strings (8 patterns)

IdentifierTypeValueModifiers
$s1text"SharpShares."ascii wide
$s2text"GetComputerShares"fullword ascii
$s3text"userAccountControl:1.2.840.113556.1.4.803:=2))(operatingSystem=*server*)(!(userAccountControl:1.2"wide
$s4text"GetAllShares"fullword ascii
$s5text"stealth:"wide
$s6text"(&(objectCategory=computer)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(operatingSystem=*server*))"fullword wide
$s7regex/\/targets|ldap|threads/wide
$s8text"entriesread"fullword ascii

Condition

uint16( 0 ) == 0x5a4d and 4 of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 4 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: ditekSHen

Source repository: ditekSHen detection @ e76c93dcde

Licence: BSD 2-Clause License (repository licence)

Copyright notice: Copyright 2021 by ditekSHen (https://github.com/ditekshen/detection).

Original rule

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

Rule id: 1da53e34-21a3-5b3c-885e-dcc8814ac3c8

Tags:FILE