mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-25 14:01:13 +00:00
add sophos and mcafee scan backend
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
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";
|
||||
|
||||
public override DateTime DatabaseLastUpdate =>
|
||||
File.GetLastWriteTime("/opt/sophos-av/lib/sav/vdlsync.upd");
|
||||
|
||||
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}";
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user