Initial OfficeCom Sentinel client and deployment assets

This commit is contained in:
OfficeCom Codex
2026-07-17 00:39:28 +02:00
commit 7cdc0395c4
58 changed files with 6199 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWindowsForms>false</UseWindowsForms>
<AssemblyName>AttackTracerNinjaServerBootstrapper</AssemblyName>
<RootNamespace>AttackTracerNinjaServerBootstrapper</RootNamespace>
<Version>1.0.9</Version>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="payload.zip" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,70 @@
using System.Diagnostics;
using System.IO.Compression;
using System.Reflection;
namespace AttackTracerNinjaServerBootstrapper;
internal static class Program
{
private static int Main()
{
string tempRoot = Path.Combine(Path.GetTempPath(), "AttackTracerNinjaServerSetup", Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(tempRoot);
try
{
Assembly assembly = Assembly.GetExecutingAssembly();
string resourceName = assembly.GetManifestResourceNames()
.First(name => name.EndsWith("payload.zip", StringComparison.OrdinalIgnoreCase));
string zipPath = Path.Combine(tempRoot, "payload.zip");
using (Stream resourceStream = assembly.GetManifestResourceStream(resourceName)
?? throw new InvalidOperationException("Embedded payload.zip was not found."))
using (FileStream output = File.Create(zipPath))
{
resourceStream.CopyTo(output);
}
string extractRoot = Path.Combine(tempRoot, "payload");
ZipFile.ExtractToDirectory(zipPath, extractRoot);
string installScript = Path.Combine(extractRoot, "install-attacktracer-ninja-server.ps1");
if (!File.Exists(installScript))
{
throw new FileNotFoundException("Installer script missing from payload.", installScript);
}
var startInfo = new ProcessStartInfo
{
FileName = "powershell.exe",
Arguments = $"-ExecutionPolicy Bypass -File \"{installScript}\"",
WorkingDirectory = extractRoot,
UseShellExecute = true
};
using Process process = Process.Start(startInfo)
?? throw new InvalidOperationException("Failed to launch installer process.");
process.WaitForExit();
return process.ExitCode;
}
catch (Exception ex)
{
Console.Error.WriteLine($"AttackTracerNinjaServer installer failed: {ex}");
return 1;
}
finally
{
try
{
if (Directory.Exists(tempRoot))
{
Directory.Delete(tempRoot, recursive: true);
}
}
catch
{
}
}
}
}