Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_SUSP_Fake_AMSI_DLL_Jun23_1

Detects an amsi.dll that has the same exports as the legitimate one but very different contents or file sizes

Suspicious / huntingSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Florian Roth
Date
2023-06-07
Modified
2023-06-12
Score / Quality
65 / 85

What this rule detects

Detects an amsi.dll that has the same exports as the legitimate one but very different contents or file sizes

Targets: Windows PE.

It defines 7 patterns (7 text, 0 hex, 0 regex). YARA modules used: pe.

Summary generated from the rule's metadata and condition.

Rule source

Includes the imports needed to compile it on its own.

susp-fake-amsi-dll-jun23-1.yarDetection Rule License 1.1
import "pe"

rule SIGNATURE_BASE_SUSP_Fake_AMSI_DLL_Jun23_1 : FILE
{
	meta:
		description = "Detects an amsi.dll that has the same exports as the legitimate one but very different contents or file sizes"
		author = "Florian Roth"
		id = "b12df9de-ecfb-562b-b599-87fa786a33bc"
		date = "2023-06-07"
		modified = "2023-06-12"
		reference = "https://twitter.com/eversinc33/status/1666121784192581633?s=20"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/gen_fake_amsi_dll.yar#L3-L35"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		logic_hash = "ec3db233ab22144bc65614b45bb894a7ea5a4fd40ccb603e6e52cc1b9ff8805b"
		score = 65
		quality = 85
		tags = "FILE"

	strings:
		$a1 = "Microsoft.Antimalware.Scan.Interface" ascii
		$a2 = "Amsi.pdb" ascii fullword
		$a3 = "api-ms-win-core-sysinfo-" ascii
		$a4 = "Software\\Microsoft\\AMSI\\Providers" wide
		$a5 = "AmsiAntimalware@" ascii
		$a6 = "AMSI UAC Scan" ascii
		$fp1 = "Wine builtin DLL"

	condition:
		uint16( 0 ) == 0x5a4d and ( pe.exports ( "AmsiInitialize" ) and pe.exports ( "AmsiScanString" ) ) and ( filesize > 200KB or filesize < 35KB or not 4 of ( $a* ) ) and not 1 of ( $fp* )
}

Strings (7 patterns)

IdentifierTypeValueModifiers
$a1text"Microsoft.Antimalware.Scan.Interface"ascii
$a2text"Amsi.pdb"ascii fullword
$a3text"api-ms-win-core-sysinfo-"ascii
$a4text"Software\\Microsoft\\AMSI\\Providers"wide
$a5text"AmsiAntimalware@"ascii
$a6text"AMSI UAC Scan"ascii
$fp1text"Wine builtin DLL"

Condition

uint16( 0 ) == 0x5a4d and ( pe.exports ( "AmsiInitialize" ) and pe.exports ( "AmsiScanString" ) ) and ( filesize > 200KB or filesize < 35KB or not 4 of ( $a* ) ) and not 1 of ( $fp* )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be smaller than 35KB (a cheap guard that skips large files).
  • The file must be larger than 200KB.
  • At least 4 patterns in ( $a* ) must match.
  • At least 1 patterns in ( $fp* ) must match.
  • Uses the pe module.
  • Checks exported functions or the DLL name.

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: Florian Roth

Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a

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: b12df9de-ecfb-562b-b599-87fa786a33bc

Tags:FILE