Lead.EnvironmentManagement 2.0.0

dotnet add package Lead.EnvironmentManagement --version 2.0.0
                    
NuGet\Install-Package Lead.EnvironmentManagement -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lead.EnvironmentManagement" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lead.EnvironmentManagement" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Lead.EnvironmentManagement" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lead.EnvironmentManagement --version 2.0.0
                    
#r "nuget: Lead.EnvironmentManagement, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lead.EnvironmentManagement@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lead.EnvironmentManagement&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Lead.EnvironmentManagement&version=2.0.0
                    
Install as a Cake Tool

Lead.EnvironmentManagement

One-click preset sandbox environments for Windows and Linux — system info spoofing, file virtualization, and runtime variable inspection, built on top of Lead.Sandbox.

Features

  • Preset Environments: Windows/Linux sandbox with Honeypot, Block, or Redirect modes
  • System Info Spoofing: Fake Environment, RuntimeInformation API responses
  • Linux File Virtualization: Virtual /proc, /etc files (cpuinfo, os-release, passwd, etc.)
  • Runtime Inspection: Read/write static/instance fields and properties, invoke methods on loaded assemblies

Quick Start

using Lead.EnvironmentManagement;

// Windows honeypot sandbox
using var sandbox = PresetSandbox.CreateWindowsHoneypot();

// Linux honeypot with custom profile
var linuxProfile = new EnvironmentProfile
{
    IsLinux = true,
    MachineName = "my-fake-host",
    ProcessorCount = 2,
    ProcessArchitecture = Architecture.Arm64,
};
using var linux = PresetSandbox.CreateLinuxHoneypot(linuxProfile);

// Load and inspect a plugin
var result = await sandbox.LoadPluginAsync("plugin.dll");
if (result.Success)
{
    var inspector = sandbox.Inspector!;
    var value = inspector.GetStaticFieldValue("MyApp.Config", "Version");
    inspector.SetStaticFieldValue("MyApp.Config", "Version", "2.0");
}

Preset Environments

Method OS Mode Description
CreateWindowsHoneypot() Windows Honeypot Allow + log all access
CreateWindowsBlock() Windows Block Block file/network access
CreateWindowsRedirect() Windows Redirect Redirect to sandbox directory
CreateLinuxHoneypot() Linux Honeypot Allow + log + virtual /proc, /etc
CreateLinuxBlock() Linux Block Block file/network access
CreateLinuxRedirect() Linux Redirect Redirect to sandbox directory

Environment Profiles

Built-in profiles: EnvironmentProfile.WindowsDefault, EnvironmentProfile.LinuxDefault, EnvironmentProfile.LinuxArm64.

Custom profiles:

var profile = new EnvironmentProfile
{
    MachineName = "fake-server",
    UserName = "admin",
    ProcessorCount = 16,
    ProcessArchitecture = Architecture.X64,
    OSArchitecture = Architecture.X64,
    OSDescriptionString = "Linux 5.15.0-generic x86_64",
    EnvironmentVariables = new() { { "CUSTOM_VAR", "value" } }
};

Runtime Inspector

var inspector = sandbox.Inspector;

// Static fields/properties
inspector.GetStaticFieldValue("Namespace.Type", "FieldName");
inspector.SetStaticFieldValue("Namespace.Type", "FieldName", value);
inspector.GetStaticPropertyValue("Namespace.Type", "PropertyName");
inspector.SetStaticPropertyValue("Namespace.Type", "PropertyName", value);

// Instance fields/properties
inspector.GetInstanceFieldValue(instance, "FieldName");
inspector.SetInstanceFieldValue(instance, "FieldName", value);
inspector.GetInstancePropertyValue(instance, "PropertyName");
inspector.SetInstancePropertyValue(instance, "PropertyName", value);

// Method invocation
inspector.InvokeStaticMethod("Namespace.Type", "MethodName", args);
inspector.InvokeInstanceMethod(instance, "MethodName", args);

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 92 5/31/2026
1.0.1 94 5/30/2026
1.0.0 102 5/29/2026