Add basic miner check

This commit is contained in:
Marcel Baumgartner
2023-07-22 02:08:39 +02:00
parent 512a989609
commit 173bff67df

View File

@@ -162,6 +162,29 @@ public class MalwareScanService
}
}
async Task ScanMinerJar()
{
var access = await ServerService.CreateFileAccess(server, null!);
var fileElements = await access.Ls();
if (fileElements.Any(x => x.Name == "libraries" && !x.IsFile))
{
await access.Cd("libraries");
fileElements = await access.Ls();
if (fileElements.Any(x => x.Name == "jdk" && !x.IsFile))
{
results.Add(new ()
{
Title = "Found Miner",
Description = "Detected suspicious library directory which may contain a script for miners",
Author = "Marcel Baumgartner"
});
}
}
}
async Task ScanFakePlayerPlugins()
{
var access = await ServerService.CreateFileAccess(server, null!);
@@ -190,6 +213,7 @@ public class MalwareScanService
// Execute scans
await ScanSelfBot();
await ScanFakePlayerPlugins();
await ScanMinerJar();
return results.ToArray();
}