Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Dotnet_Injector_New_Payload

New dotnet injector

GenericSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2022-12-21
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

New dotnet injector

Targets: .NET assembly.

It defines 10 patterns (10 text, 0 hex, 0 regex). YARA modules used: dotnet.

Summary generated from the rule's metadata and condition.

Rule source

Includes the imports needed to compile it on its own.

dotnet-injector-new-payload.yarDetection Rule License 1.1
import "dotnet"

rule SEKOIA_Dotnet_Injector_New_Payload : FILE
{
	meta:
		description = "New dotnet injector"
		author = "Sekoia.io"
		id = "b0a1d471-5381-4fa8-8563-7e72ecd15bed"
		date = "2022-12-21"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/dotnet_injector_new_payload.yar#L3-L30"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "8b5e2f6e7947471e10e0ec85eef1cebe1904c2e77b7cfe92e578ebe306041842"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$f1 = "DownloadFile" ascii
		$f2 = "StreamReader" ascii
		$f3 = "ReadToEnd" ascii
		$f4 = "Reverse" ascii
		$f5 = "Load" ascii
		$f6 = "StringToByteArray" ascii
		$s1 = "Admin" wide
		$s2 = "User" wide
		$p1 = "\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\" wide
		$p2 = ".lnk" wide

	condition:
		filesize < 300KB and all of ( $f* ) and all of ( $s* ) and all of ( $p* ) and dotnet.is_dotnet
}

Strings (10 patterns)

IdentifierTypeValueModifiers
$f1text"DownloadFile"ascii
$f2text"StreamReader"ascii
$f3text"ReadToEnd"ascii
$f4text"Reverse"ascii
$f5text"Load"ascii
$f6text"StringToByteArray"ascii
$s1text"Admin"wide
$s2text"User"wide
$p1text"\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\"wide
$p2text".lnk"wide

Condition

filesize < 300KB and all of ( $f* ) and all of ( $s* ) and all of ( $p* ) and dotnet.is_dotnet

In plain words (Heuristic)

  • The file must be smaller than 300KB (a cheap guard that skips large files).
  • All patterns in ( $f* ) must match.
  • All patterns in ( $s* ) must match.
  • All patterns in ( $p* ) must match.
  • Uses the dotnet module.

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: Sekoia.io

Source repository: SEKOIA.IO Community @ a438a5901a

Licence: Detection Rule License 1.1 (repository licence)

Original rule

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

Rule id: b0a1d471-5381-4fa8-8563-7e72ecd15bed

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE