Skip to content

YARA · ditekSHen detection

DITEKSHEN_INDICATOR_TOOL_Nsudo

Detects NSudo allowing to run processes as TrustedInstaller or System

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 NSudo allowing to run processes as TrustedInstaller or System

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

indicator-tool-nsudo.yarBSD 2-Clause License
rule DITEKSHEN_INDICATOR_TOOL_Nsudo : FILE
{
	meta:
		description = "Detects NSudo allowing to run processes as TrustedInstaller or System"
		author = "ditekShen"
		id = "9a21b923-b02e-553b-8f53-026d7034c319"
		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#L1356-L1369"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "6bcffa79ca06b0b4178d6ea256f98d917c2b19cec0b059889b8d015d226a53f9"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$x1 = "cmd /c start \"NSudo." wide
		$x2 = "*\\shell\\NSudo" fullword wide
		$x3 = "Projects\\NSudo\\Output\\Release\\x64\\NSudo.pdb" ascii
		$s1 = "-ShowWindowMode=Hide" wide
		$s2 = "?what@exception@@UEBAPEBDXZ" fullword ascii
		$s3 = "NSudo.RunAs." ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( 2 of ( $x* ) or ( 1 of ( $x* ) and 2 of ( $s* ) ) or all of ( $s* ) or 4 of them )
}

Strings (6 patterns)

IdentifierTypeValueModifiers
$x1text"cmd /c start \"NSudo."wide
$x2text"*\\shell\\NSudo"fullword wide
$x3text"Projects\\NSudo\\Output\\Release\\x64\\NSudo.pdb"ascii
$s1text"-ShowWindowMode=Hide"wide
$s2text"?what@exception@@UEBAPEBDXZ"fullword ascii
$s3text"NSudo.RunAs."ascii

Condition

uint16( 0 ) == 0x5a4d and ( 2 of ( $x* ) or ( 1 of ( $x* ) and 2 of ( $s* ) ) or all of ( $s* ) or 4 of them )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $s* ) must match.
  • At least 2 patterns in ( $x* ) must match.
  • At least 1 patterns in ( $x* ) must match.
  • At least 2 patterns in ( $s* ) must match.
  • 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: 9a21b923-b02e-553b-8f53-026d7034c319

Tags:FILE