2020-10-22 14:15:27 +03:00
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
using MalwareMultiScan.Backends.Backends.Abstracts;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
namespace MalwareMultiScan.Backends.Backends.Implementations
|
|
|
|
{
|
|
|
|
public class KesScanBackend : AbstractLocalProcessScanBackend
|
|
|
|
{
|
|
|
|
public KesScanBackend(ILogger logger) : base(logger)
|
|
|
|
{
|
|
|
|
}
|
2020-10-23 11:11:19 +03:00
|
|
|
|
2020-10-22 14:15:27 +03:00
|
|
|
public override string Id { get; } = "kes";
|
2020-10-23 11:11:19 +03:00
|
|
|
|
2020-10-22 14:15:27 +03:00
|
|
|
protected override string BackendPath { get; } = "/bin/bash";
|
2020-10-23 11:11:19 +03:00
|
|
|
|
2020-10-22 14:15:27 +03:00
|
|
|
protected override Regex MatchRegex { get; } =
|
|
|
|
new Regex(@"[ +]DetectName.*: (?<threat>.*)", RegexOptions.Compiled | RegexOptions.Multiline);
|
|
|
|
|
|
|
|
protected override string GetBackendArguments(string path)
|
|
|
|
{
|
|
|
|
return $"/usr/bin/kesl-scan {path}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|