mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-24 05:22:22 +00:00
27 lines
882 B
C#
27 lines
882 B
C#
using System.Text.RegularExpressions;
|
|
using MalwareMultiScan.Backends.Backends.Abstracts;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace MalwareMultiScan.Backends.Backends.Implementations
|
|
{
|
|
public class SophosScanBackend : AbstractLocalProcessScanBackend
|
|
{
|
|
public SophosScanBackend(ILogger logger) : base(logger)
|
|
{
|
|
}
|
|
|
|
public override string Id { get; } = "sophos";
|
|
|
|
protected override string BackendPath { get; } = "/opt/sophos-av/bin/savscan";
|
|
|
|
protected override bool ThrowOnNonZeroExitCode { get; } = false;
|
|
|
|
protected override Regex MatchRegex { get; } =
|
|
new Regex(@">>> Virus '(?<threat>.*)' found in file .*", RegexOptions.Compiled | RegexOptions.Multiline);
|
|
|
|
protected override string GetBackendArguments(string path)
|
|
{
|
|
return $"-f -archive -ss {path}";
|
|
}
|
|
}
|
|
} |