ByteGuard.FileValidator.Scanner.Amsi
1.0.0-dev-01002
Prefix Reserved
See the version list below for details.
dotnet add package ByteGuard.FileValidator.Scanner.Amsi --version 1.0.0-dev-01002
NuGet\Install-Package ByteGuard.FileValidator.Scanner.Amsi -Version 1.0.0-dev-01002
<PackageReference Include="ByteGuard.FileValidator.Scanner.Amsi" Version="1.0.0-dev-01002" />
<PackageVersion Include="ByteGuard.FileValidator.Scanner.Amsi" Version="1.0.0-dev-01002" />
<PackageReference Include="ByteGuard.FileValidator.Scanner.Amsi" />
paket add ByteGuard.FileValidator.Scanner.Amsi --version 1.0.0-dev-01002
#r "nuget: ByteGuard.FileValidator.Scanner.Amsi, 1.0.0-dev-01002"
#:package ByteGuard.FileValidator.Scanner.Amsi@1.0.0-dev-01002
#addin nuget:?package=ByteGuard.FileValidator.Scanner.Amsi&version=1.0.0-dev-01002&prerelease
#tool nuget:?package=ByteGuard.FileValidator.Scanner.Amsi&version=1.0.0-dev-01002&prerelease
ByteGuard.FileValidator.Scanners.Amsi 
ByteGuard.FileValidator.Scanners.Amsi is a Microsoft Antimalware Scan Interface (AMSI) specific antimalware scanner implementation for ByteGuard.FileValidator.
AMSI is a Windows API that allows applications to submit content for scanning and receive a verdict from the installed antimalware provider. It lets you route files through the OS antimalware engine (for example Microsoft Defender or any other AMSI-integrated AV) before they’re accepted by your application.
⚠️ Important: This package is one layer in a defense-in-depth strategy.
It does not replace endpoint protection, sandboxing, input validation, or other security controls.
⚠️ Important: This package uses the Microsoft Antimalware Scan Interface (AMSI) and will submit content to the installed antimalware engine on the host (e.g., Microsoft Defender). Malicious samples or test files (such as the EICAR test file) may trigger alerts and incidents in your security monitoring. Make sure your security/operations team is aware of this integration before running tests in shared or production environments.
Features
- AMSI-based implementation of
IAntimalwareScannerforByteGuard.FileValidator - Works with any AMSI-compatible antivirus installed on the host machine
Prerequisites
- Operating system
- Windows 10+ or Windows Server 2016+ (AMSI is available and supported on these versions).
- Antimalware
- An AMSI-integrated antimalware engine installed and enabled (e.g. Microsoft Defender Antivirus).
- Core packages
Getting Started
Installation
This package is published and installed via NuGet.
Reference the package in your project:
dotnet add package ByteGuard.FileValidator.Scanners.Amsi
Usage
using ByteGuard.FileValidator;
using ByteGuard.FileValidator.Scanners.Amsi;
var amsiConfig = new AmsiScannerConfiguration()
{
ApplicationName = "MyApplication"
};
var amsiScanner = new AmsiAntimalwareScanner(amsiConfig);
var configuration = //...;
var fileValidator = new FileValidator(configuration, amsiScanner);
var isValid = fileValidator.IsValidFile(fileStream, fileName);
The FileValidator will automatically scan the file once provided as argument, and whenever using either IsValidFile or IsMalwareClean functions.
Configuration
AmsiScannerConfiguration supports the following settings:
| Settings | Required | Description |
|---|---|---|
ApplicationName |
Yes | The logical name used when registering the AMSI session (helps AV engines with context). |
Example
[HttpPost("upload")]
public async Task<IActionResult> Upload(IFormFile file)
{
using var stream = file.OpenReadStream();
var amsiConfig = new AmsiScannerConfiguration()
{
ApplicationName = "MyApplication"
};
var amsiScanner = new AmsiAntimalwareScanner(amsiConfig);
var configuration = //...
var validator = new FileValidator(configuration, amsiScanner);
if (!validator.IsValidFile(file.FileName, stream))
{
return BadRequest("Invalid or unsupported file.");
}
// Proceed with processing/saving...
return Ok();
}
Testing the AMSI integration
If you verify the integration using known test signatures (for example, the EICAR test file), be aware that:
- The installed AV engine may quarantine or block the file.
- Alerts may be raised and forwarded to your SIEM / security team.
- In tightly monitored environments, you should coordinate with your security team before running such tests.
Security notes & limitations
- AMSI relies on the underlying antimalware provider for detection. If the provider is disabled, misconfigured, or missing signatures, detection quality will be affected.
- Attackers constantly attempt to evade or disable AMSI; treat AMSI as a signal, not as a guarantee.
- Always combine this package with:
- Principle of least privilege for storage and processing
- Endpoint protection and monitoring
License
ByteGuard.FileValidator.Scanners.Amsi is Copyright © ByteGuard Contributors - Provided under the MIT license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8.1
- ByteGuard.FileValidator (>= 1.0.1-dev-01029)
-
.NETStandard 2.0
- ByteGuard.FileValidator (>= 1.0.1-dev-01029)
-
net10.0
- ByteGuard.FileValidator (>= 1.0.1-dev-01029)
-
net8.0
- ByteGuard.FileValidator (>= 1.0.1-dev-01029)
-
net9.0
- ByteGuard.FileValidator (>= 1.0.1-dev-01029)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 576 | 12/1/2025 |
| 1.0.0-dev-01002 | 558 | 12/1/2025 |