mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-24 05:22:22 +00:00
27 lines
870 B
C#
27 lines
870 B
C#
using System.Text.RegularExpressions;
|
|
using MalwareMultiScan.Backends.Backends.Abstracts;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace MalwareMultiScan.Backends.Backends.Implementations
|
|
{
|
|
public class ClamavScanBackend : AbstractLocalProcessScanBackend
|
|
{
|
|
public ClamavScanBackend(ILogger logger) : base(logger)
|
|
{
|
|
}
|
|
|
|
public override string Id { get; } = "clamav";
|
|
|
|
protected override string BackendPath { get; } = "/usr/bin/clamdscan";
|
|
|
|
protected override Regex MatchRegex { get; } =
|
|
new Regex(@"(\S+): (?<threat>[\S]+) FOUND", RegexOptions.Compiled | RegexOptions.Multiline);
|
|
|
|
protected override bool ThrowOnNonZeroExitCode { get; } = false;
|
|
|
|
protected override string GetBackendArguments(string path)
|
|
{
|
|
return $"-m --fdpass --no-summary {path}";
|
|
}
|
|
}
|
|
} |