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
- 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.
import "pe"
rule SIGNATURE_BASE_SUSP_Fake_AMSI_DLL_Jun23_1 : FILE
{
meta:
= "Detects an amsi.dll that has the same exports as the legitimate one but very different contents or file sizes"
= "Florian Roth"
= "b12df9de-ecfb-562b-b599-87fa786a33bc"
= "2023-06-07"
= "2023-06-12"
= "https://twitter.com/eversinc33/status/1666121784192581633?s=20"
= "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/gen_fake_amsi_dll.yar#L3-L35"
= "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
= "ec3db233ab22144bc65614b45bb894a7ea5a4fd40ccb603e6e52cc1b9ff8805b"
= 65
= 85
= "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)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $a1 | text | "Microsoft.Antimalware.Scan.Interface" | ascii |
| $a2 | text | "Amsi.pdb" | ascii fullword |
| $a3 | text | "api-ms-win-core-sysinfo-" | ascii |
| $a4 | text | "Software\\Microsoft\\AMSI\\Providers" | wide |
| $a5 | text | "AmsiAntimalware@" | ascii |
| $a6 | text | "AMSI UAC Scan" | ascii |
| $fp1 | text | "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.
Licence & attribution
Author: Florian Roth
Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a
Licence: Detection Rule License 1.1 (repository licence)
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
Related rules
- Suspicious / huntingSignature Base (Florian Roth / Nextron)· Florian Roth· 2024-02-23
- Suspicious / huntingSignature Base (Florian Roth / Nextron)· Florian Roth· 2024-02-23
- Suspicious / huntingSignature Base (Florian Roth / Nextron)· Florian Roth· 2024-10-25
- Suspicious / huntingSignature Base (Florian Roth / Nextron)· Florian Roth· 2024-02-23
- Suspicious / huntingSignature Base (Florian Roth / Nextron)· Florian Roth· 2023-08-04
- Suspicious / huntingSignature Base (Florian Roth / Nextron)· Florian Roth· 2024-02-23
- Suspicious / huntingSignature Base (Florian Roth / Nextron)· Florian Roth· 2025-08-07
- Suspicious / huntingSignature Base (Florian Roth / Nextron)· Florian Roth· 2025-02-14