Exploit database

GH-9d8bf7b89f407a0fff790750df76b5d3

lewis-ricardo/amaranth-project

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-8088

19 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files149
lewis-ricardo/amaranth-projectRevision 0a4aa5d06cfd
Next files →

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

Stage06/dump_syscall.py

Python · 4,413 bytes
import paramiko, struct, sys

c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('192.168.30.136', username='lewis', password='lewis123', timeout=10)

# Run a C# helper to dump NtProtectVirtualMemory bytes
code = '''
using System;
using System.Runtime.InteropServices;
using System.Linq;
using System.IO;

class Dumper {
    [DllImport("kernel32")] static extern IntPtr GetModuleHandle(string m);
    [DllImport("kernel32")] static extern IntPtr GetProcAddress(IntPtr h, string n);
    
    static void Main() {
        IntPtr ntdll = GetModuleHandle("ntdll.dll");
        Console.WriteLine("ntdll base: 0x" + ntdll.ToString("X16"));
        
        IntPtr ntProtectVM = GetProcAddress(ntdll, "NtProtectVirtualMemory");
        Console.WriteLine("NtProtectVirtualMemory: 0x" + ntProtectVM.ToString("X16"));
        Console.WriteLine("Offset from base: 0x" + (ntProtectVM.ToInt64() - ntdll.ToInt64()).ToString("X"));
        
        // Dump first 64 bytes
        byte[] buf = new byte[64];
        Marshal.Copy(ntProtectVM, buf, 0, 64);
        Console.WriteLine("Bytes: " + BitConverter.ToString(buf));
        
        // Also dump Zw version (should be same)
        IntPtr zwProtectVM = GetProcAddress(ntdll, "ZwProtectVirtualMemory");
        Console.WriteLine("ZwProtectVirtualMemory: 0x" + zwProtectVM.ToString("X16"));
        if (zwProtectVM != ntProtectVM) {
            byte[] buf2 = new byte[64];
            Marshal.Copy(zwProtectVM, buf2, 0, 64);
            Console.WriteLine("Zw bytes: " + BitConverter.ToString(buf2));
        } else {
            Console.WriteLine("Same as Nt version");
        }
        
        // Find syscall pattern (0F 05)
        for (int i = 0; i < 64; i++) {
            if (buf[i] == 0x0F && i + 1 < 64 && buf[i + 1] == 0x05) {
                Console.WriteLine("syscall at offset: " + i);
                // Find mov eax, SSN before syscall
                for (int j = i - 1; j >= 0 && j > i - 10; j--) {
                    if (buf[j] == 0xB8) {
                        int ssn = BitConverter.ToInt32(buf, j + 1);
                        Console.WriteLine("  SSN at offset " + j + ": 0x" + ssn.ToString("X"));
                        break;
                    }
                }
                break;
            }
        }
        
        // List all Nt* syscall exports for reference
        Console.WriteLine("\nFirst 20 Nt* exports:");
        int count = 0;
        // Read PE export directory
        IntPtr dosHeader = ntdll;
        int e_lfanew = Marshal.ReadInt32(dosHeader, 0x3C);
        IntPtr ntHeaders = ntdll + e_lfanew;
        int exportRVA = Marshal.ReadInt32(ntHeaders + 0x78 + 16);
        if (exportRVA != 0) {
            IntPtr exportDir = ntdll + exportRVA;
            int numNames = Marshal.ReadInt32(exportDir + 24);
            int nameAddr = Marshal.ReadInt32(exportDir + 32);
            IntPtr namePtr = ntdll + nameAddr;
            for (int i = 0; i < numNames && count < 20; i++) {
                int nameRVA = Marshal.ReadInt32(namePtr + i * 4);
                string name = Marshal.PtrToStringAnsi(ntdll + nameRVA);
                if (name.StartsWith("Nt") && name.EndsWith("VirtualMemory")) {
                    int ordAddr = Marshal.ReadInt32(exportDir + 36);
                    int funcAddr = Marshal.ReadInt32(exportDir + 28);
                    short ord = Marshal.ReadInt16(ntdll + ordAddr + i * 2);
                    int fnRVA = Marshal.ReadInt32(ntdll + funcAddr + ord * 4);
                    Console.WriteLine("  " + name + " -> RVA: 0x" + fnRVA.ToString("X"));
                    count++;
                }
            }
        }
    }
}
'''

# Upload and compile
stdin, stdout, stderr = c.exec_command(r'cmd /c echo ' + code.replace('\n', ' ') + r' > C:\Windows\Temp\dumper.cs 2>&1', timeout=10)
print("compile:", stdout.read().decode(errors='replace')[:200])

stdin, stdout, stderr = c.exec_command(r'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /t:exe /out:C:\Windows\Temp\dumper.exe C:\Windows\Temp\dumper.cs 2>&1', timeout=15)
print("compile result:", stdout.read().decode(errors='replace')[:300])

stdin, stdout, stderr = c.exec_command(r'C:\Windows\Temp\dumper.exe', timeout=10)
print("output:")
for line in stdout.read().decode(errors='replace').split('\n'):
    print(f"  {line.strip()}")
    if "Bytes:" in line:
        pass

c.close()