mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-24 05:22:22 +00:00
30 lines
958 B
C#
30 lines
958 B
C#
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 ClamavScanBackend : AbstractLocalProcessScanBackend
|
|
{
|
|
public ClamavScanBackend(ILogger logger) : base(logger)
|
|
{
|
|
}
|
|
|
|
public override string Id { get; } = "clamav";
|
|
|
|
public override DateTime DatabaseLastUpdate =>
|
|
File.GetLastWriteTime("/var/lib/clamav/daily.cvd");
|
|
|
|
protected override string BackendPath { get; } = "/usr/bin/clamscan";
|
|
|
|
protected override Regex MatchRegex { get; } =
|
|
new Regex(@"(\S+): (?<threat>[\S]+) FOUND", RegexOptions.Compiled | RegexOptions.Multiline);
|
|
|
|
protected override string GetBackendArguments(string path)
|
|
{
|
|
return $"--no-summary {path}";
|
|
}
|
|
}
|
|
} |