Skip to content

YARA · ditekSHen detection

DITEKSHEN_INDICATOR_TOOL_LTM_Sharpexec

Detects SharpExec lateral movement tool

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

What this rule detects

Detects SharpExec lateral movement tool

Targets: Windows PE.

It defines 12 patterns (8 text, 0 hex, 4 regex).

Summary generated from the rule's metadata and condition.

Rule source

indicator-tool-ltm-sharpexec.yarBSD 2-Clause License
rule DITEKSHEN_INDICATOR_TOOL_LTM_Sharpexec : FILE
{
	meta:
		description = "Detects SharpExec lateral movement tool"
		author = "ditekSHen"
		id = "4373a052-9525-5b24-81a4-65cd68afcb6c"
		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#L256-L275"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "17ae5c9f0b22e8ecbbbcbe052e466d00cb7b62cff423688b5138209c52f0698d"
		score = 75
		quality = 73
		tags = "FILE"

	strings:
		$s1 = "fileUploaded" fullword ascii
		$s2 = "$7fbad126-e21c-4c4e-a9f0-613fcf585a71" fullword ascii
		$s3 = "DESKTOP_HOOKCONTROL" fullword ascii
		$s4 = /WINSTA_(ACCESSCLIPBOARD|WINSTA_ALL_ACCESS)/ fullword ascii
		$s5 = /NETBIND(ADD|DISABLE|ENABLE|REMOVE)/ fullword ascii
		$s6 = /SERVICE_(ALL_ACCESS|WIN32_OWN_PROCESS|INTERROGATE)/ fullword ascii
		$s7 = /(Sharp|PS|smb)Exec/ fullword ascii
		$s8 = "lpszPassword" fullword ascii
		$s9 = "lpszDomain" fullword ascii
		$s10 = "wmiexec" fullword ascii
		$s11 = "\\C$\\__LegitFile" wide
		$s12 = "LOGON32_LOGON_NEW_CREDENTIALS" fullword ascii

	condition:
		( uint16( 0 ) == 0x5a4d and 9 of them ) or ( all of them )
}

Strings (12 patterns)

IdentifierTypeValueModifiers
$s1text"fileUploaded"fullword ascii
$s2text"$7fbad126-e21c-4c4e-a9f0-613fcf585a71"fullword ascii
$s3text"DESKTOP_HOOKCONTROL"fullword ascii
$s4regex/WINSTA_(ACCESSCLIPBOARD|WINSTA_ALL_ACCESS)/fullword ascii
$s5regex/NETBIND(ADD|DISABLE|ENABLE|REMOVE)/fullword ascii
$s6regex/SERVICE_(ALL_ACCESS|WIN32_OWN_PROCESS|INTERROGATE)/fullword ascii
$s7regex/(Sharp|PS|smb)Exec/fullword ascii
$s8text"lpszPassword"fullword ascii
$s9text"lpszDomain"fullword ascii
$s10text"wmiexec"fullword ascii
$s11text"\\C$\\__LegitFile"wide
$s12text"LOGON32_LOGON_NEW_CREDENTIALS"fullword ascii

Condition

( uint16( 0 ) == 0x5a4d and 9 of them ) or ( all of them )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in the rule must match.
  • At least 9 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: 4373a052-9525-5b24-81a4-65cd68afcb6c

Tags:FILE